Dual-host switch (NewStartHA, SKYbility, hacmp, hp unix dual-host), hpux dual-host
1. Suse linux (NewStartHA ):
#
Cli
Cli: ~>Service-migrate
Select service to migrate:
Current service:
0) bill
1) gdb
2) cancel
Select a service [0, 2]:
Enter the command line prompt for replacement.
2. AIX (HACMP ):
# Smit hacmp
Then enter:
Switch the resource from suibao01 to suibao02: smitty hacmp
3. Suse Linux (SKYbility ):
Dual-machine failover Test
After the HA configuration is complete, you need to perform the last step: Dual-machine failover test. Through testing, you can check whether the entire software is successfully installed.
The test procedure is as follows:
1. Check the status of the master node:
(1) check whether the floating IP address is activated
Run:
#Ip addr
The floating IP address must be bound to eth0: 0.
(2) check whether the file system is mounted
Run:
#Df-k
The following results are returned:
/Dev/sdb1 50403000 14185692 33656952 30%/zxindata
(3) check whether the intelligent network software is started properly
Log On As A zxin10 user and run:
$Zxtool-p
You should be able to see that each process in the intelligent network has been successfully started. In addition, you can view the startup log:/home/zxin10/log/zxcom. log. The information that the intelligent network system successfully connects to the database should be found in this file. If all the checks are correct, the dual-host software is successfully started on the master node, and then perform the following steps.
2. Check whether the HA process is started on the slave node:
#/Etc/init. d/hadaemons status
The hacomm (pid 12016) is running.
The hacenter (pid 12021) is running.
Halockd (pid 12019) is running.
If the preceding figure shows running, the HA process runs normally.
Run the following command to check whether the dual-host startup is normal:
#/Opt/ha/bin/hastat
If the returned Result 5.2 shows that both nodes are in the UP status, the network is in the ONLINE status.
Figure 5.2 check the dual-host status
3. Run the following command on the master node for dual-host failover.
$Superstop
CLUSTER detects application faults, and the dual-host switches.
If you stop the CLUSTER service:
#/Opt/ha/bin/hadaemons stop
The dual-host will be switched immediately, but the current node will not be shut down. The CLUSTER service needs to be started manually the next time you need to switch from the slave node to the master node:
#/Opt/ha/bin/hadaemons start
HA generally stops the dual-host machine on the master node as follows:
(1) Stop the application script
(2) umount File System
(3) Release floating IP addresses
Run the following command on the slave node to check the dual-host stop process:
#/Opt/ha/bin/hastat
If the message "5.2 slave 2" is displayed, the master node is stopped.
Figure 5.2 check dual-host status 1
When the content shown in 5.2 conflict 3 is displayed, it indicates that the service has been successfully switched to the slave server.
Figure 5.2 detection 3 check dual-host status 2
4. Check the system status of the slave node after the dual-host switch
Log on to the slave machine as the root user and check whether the intelligent network software is running on the slave machine:
(1) check whether the floating IP address is activated;
(2) check whether the file system is mounted;
(3) check whether the intelligent network software is started properly.
5. Start CLUSTER on the master node
Run the following command to check the status of the CLUSTER service on the master node:
#/Opt/ha/bin/hadaemons status
If the following result is returned, the HA service is not started.
The hacomm (pid 12016) is running.
The hacenter (pid 12021) is running.
Halockd (pid 12019) is running.
If the CLUSTER service is not started after the system restarts, check the cause. If the master node CLUSTER service is stopped manually, start the CLUSTER service manually:
#/Opt/ha/bin/hadaemons start
Run the following command to check the status:
#/Opt/ha/bin/hastat
When the result shown in 5.2 limit 4 is displayed, the startup is successful.
Figure 5.2 Detection 4 check dual-host status 3
6. Run the following command on the slave node to switch the dual-host to the master node.
#/Opt/ha/bin/hadaemons stop
7. Start HA on the slave Node
#/Opt/ha/bin/hadaemons start
Now, the dual-host environment is ready.
The above is a replacement test conducted through the conventional method. On this basis, you can also perform a variety of testing methods, such as unplugging the network cable of the master node, shutting down the master node, and stopping the database. In all these cases, HA dual-host switching will occur.
4. hp unix:
1. Common maintenance commands for MC/Service Guard
Location of Dual-machine maintenance commands
# Cd/usr/sbin/(use ls cm * to view all the commands for dual-host execution)
1.1 monitor Cluster running status
# Cmviewcl [-v] [-n NN]... [-p PN]... [-l {package | cluster | node}]
[-V] Verbose output
[-N] View information only about the specific node_name (s ).
[-P package_name... View information only about the specific
Package_name (s ).
[-L] pkg | clus | node Display only package, cluster or node specific information
For example:
# Cmviewcl
CLUSTER STATUS
Cluster1 up
NODE STATUS STATE
Imana100 up running
Package status state AUTO_RUN NODE
Pkg_oracle up running enabled imana100
NODE STATUS STATE
Imana101 up running
Package status state AUTO_RUN NODE
Pkg_app up running enabled imana101
You can also run the following command:
Cmviewcl-v; or
Cmquerycl; or
Cmviewconf;
1.2 start cluster
# Cmruncl-v-n imana100
1.3 Stop Cluster operation
# Cmhaltcl-f-v
[-F] Force the cluster to shutdown even if packages are currently running.
[-V] Verbose output
1.4 start a node and add the node to the Cluster
# Cmrunnode-v imana100
1.5 stop running a node while the Cluster continues running on other nodes
# Cmhaltnode [-f] [-v] [NN...]
[-F] Force the node to halt even if there are packages running on it.
[-V] Verbose output
# Cmhaltnode-f-v imana101
1.6 run a package in the Running Cluster
# Cmrunpkg [-n NN] [-v] PN...
[-N] Act on a specific node.
[-V] Verbose output
For example:
# Cmrunpkg-n imana101 pkg_app
Cmrunpkg: Completed successfully on all packages specified.
1.7 stop a running package.
# Cmhaltpkg [-n NN] [-v] PN...
[-N] Act on a specific node.
[-V] Verbose output
For example:
# Cmhaltpkg-n imana101 pkg_app
One or more packages has been halted and will not be started automatically. To start these packages, enable AUTO_RUN via cmmodpkg
-E <Package_Name>.
Cmhaltpkg: Completed successfully on all packages specified.
1.8 change the switching attribute of a package
# Cmmodpkg [-v] [-n NN]... {-e |-d} PN...
[-V] Verbose output
[-N] Modify attributes on specific node (s)-else globally mod.
-E enable
-D disable
PN-package (s) whose switching attributes are changed
Note: CN = cluster_name NN = node_name PN = package_name
Explainations:... = multiple occurences | = OR [descriptor] = optional
1.9 location of Dual-host configuration files
# Cd/etc/cmcluster/(configuration file of the dual-host daemon cluster. ascii)
# Cd/etc/cmcluster/pkg_app/, # cd/etc/cmcluster/pkg_oracle/(pkg_app.ctl and pkg_oracle_ctl are used to define floating IP addresses of two machines)
1.10 dual-machine switch Test
Run
# Cmhaltpkg-v pkg_oracle ---- stop the package on the host
# Cmrunpkg-v-n imana101 pkg_oracle ---- start the package on the slave machine
# Cmmodpkg-e-n imana100 pkg_oracle ---- Allow host failover
Note: If the following error is reported when the package is enabled, run the preceding command to add the node to failover.
# Cmrunpkg-n imana100 pkghlrdb
Cmrunpkg: Node imana100 is currently unable to run package pkg_oracle.
Check the syslog on node imana100 and pkg log files for more detailed information.