Cluster-vs-Zones
From pressy's brainbackup
Contents
Zones configuration and administration
Resource Adding:
# clresourcetype register SUNW.gds (only once) # clresourcetype register SUNW.HAStoragePlus (only once) # clresourcegroup create <group name> [UFS]# clresource create –t HAStoragePlus –g <group name> -p \ FileSystemMountPoints=<global-zone-path> -p Affinityon=true <resource name> [ZFS]# clresource create -t SUNW.HAStoragePlus -g <group name> -p \ Zpools=<pool name> <resource name> # cd /opt/SUNWsczone/sczbt/util # cp sczbt_config <zonename>.config # vi <zonename>.config RS=<resource name> RG=<group name> PARAMETERDIR=<global directory> SC_NETWORK=false SC_LH= FAILOVER=true HAS_RS=<storage-resource> Zonename=<zonename> Zonebootopt= Milestone=multi-user-server Mounts="/global-zone-dir:/local-zone-dir:mount-options <next entry>" # ./sczbt_register –f ./<zonename>.config # clresource enable <resource name> # clresourcegroup online <group name>
Reassigning:
# clresource set -p property_name=value -x extension_property=value \ -y standard_property=value <resource name> # clresourcegroup set –p Nodelist=clnode2,clnode1 <group name> Deletion: # clresource unmonitor <resource> # clresource disable <resource> # clresource delete <resource> # clresourcegroup unmanage <group name> # clresourcegroup delete <group name>
Application agents:
# cd /opt/SUNWsczone/sczsh/util # cp sczsh_config <zonename>.<application>.config # vi <zonename>.<application>.config RS=<resource name> RG=<group name> SCZBT_RS=<zone boot resource> PARAMETERDIR=<global directory> Zonename=<zonename> ServiceStartCommand=sczsh-start-command ServiceStopCommand=sczsh-stop-command ServiceProbeCommand=sczsh-probe-command For example a simple Apache script: # zlogin <zonename> # cp /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf # vi apache.cluster #!/usr/bin/ksh case $1 in start) /lib/svc/method/http-apache2 start ;; stop) /lib/svc/method/http-apache2 stop ;; probe) if echo "GET; exit" | mconnect -p 80 > /dev/null 2>&1 then exit 0; else exit 100; fi ;; esac # exit # ./sczsh_register –f <zonename>.<application>.config
Zone failover
# clresourcegroup switch –n <2nd node> <group name>