======================================================================== Configuring and Running Orenosp Linux in HA-Cluster Mode using Heartbeat Version: 20060313 ======================================================================== Instructions Overview 1) Prepare two equivalently configured Linux machines 2) Install Linux Heartbeat 1.2.x clusterware onto each machine 3) Install Orenosp Linux onto each machine Make sure you do install orenosp-rc script into /etc/init.d, but not enable automatic start. After installing orenosp-rc script, do the following to disable automatic restart: # /sbin/chkconfig --level 2345 orenosp off 4) On each machine, configure Heartbeat for active-standby clustering Orenosp 5) Test the clustered Orenosp 6) Configure heartbeat to auto-start on each node # /sbin/chkconfig --level 2345 heartbeat on 7) [Optional] Additional Configuration To Monitor Orenosp Service 1) Prepare two equivalently configured Linux machines ===================================================== 2) Install Linux Heartbeat 1.2.x clusterware onto each machine ============================================================== 3) Install Orenosp Linux onto each machine ========================================== 4) On each machine, configure Heartbeat for active-standby clustering Orenosp ============================================================================= Documentation for Configuring Heartbeat --------------------------------------- http://linux-ha.org/ConfiguringHeartbeat Getting Started With Heartbeat (short introduction to version 1) http://linux-ha.org/GettingStartedWithHeartbeat A Basic Single IP Address Configuration http://linux-ha.org/GettingStarted/OneIPAddress Getting Started with Linux-HA (Heartbeat) (detailed introduction to version 1) http://linux-ha.org/GettingStarted FAQ http://linux-ha.org/FAQ Our Sample Configuration ------------------------ Cluster 2-Node Active-Standby cluster for Orenosp Linux Cluster IP address (virtual IP address, on eth0 of each node) : 192.168.1.155 Node 0 (primary node) hostname: orenosp0 IP address (eth0): 192.168.1.129 IP address (eth1): 192.168.2.10 (optional) Node 1 (secondary, backup node) hostname: orenosp1 IP address (eth0): 192.168.1.128 IP address (eth1): 192.168.2.11 (optional) Node 0 is the primary node. Therefore if node 0 is goes down, node 1 takes over. And when node 0 is back up, it will take over the cluster. This is to say that the cluster will fail back. Configuration-related Files --------------------------- - Heartbeat files /etc/ha.d/ha.cf : basic heartbeat configuration /etc/ha.d/haresources : shared resources and clustered services /etc/ha.d/authkeys : security related (this file must be protected with mode 0600) 1) Make sure you do not have files with the same filename in /etc (like /etc/ha.cf). If you do, please remove them. 2) All of these files must be the same on all nodes in the cluster. You can edit them on the primary node and distribute them to other nodes. - Other files related to Heartbeat /etc/hosts You may need to define hostname to IP address mappings here. You can use the following files as starting samples. ------------ /etc/ha.d/ha.cf ------------- # # === cluster member node definitions === # node orenosp0 node orenosp1 #Mandatory. Hostname of machine in cluster as described by uname -n. # # ==== heartbeat implementation ==== # udpport 694 #Use port number 694 for bcast or ucast communication. #This is the default, and the official IANA registered port number. bcast eth0 #Specifies to use a broadcast heartbeat over eth0 interface #bcast eth0 eth1 #Alternative: Specifies to use a broadcast heartbeat over both eth0 and eth1 interfaces # # === node dead detection parameters === # keepalive 2 #Sets the time between heartbeats to 2 seconds. warntime 10 #Time in seconds before issuing a "late heartbeat" warning in the logs. deadtime 30 #Node is pronounced dead after 30 seconds. initdead 120 #With some configurations, the network takes some time to start working #after a reboot. This is a separate "deadtime" to handle that case. #It should be at least twice the normal deadtime. # # === Failback option === auto_failback on # # === Logging === # debugfile /var/log/ha-debug logfile /var/log/ha-log #Syslog support: Facility to use for syslog()/logger #logfacility local0 # EOF -------------- /etc/ha.d/haresources ---------------- orenosp0 192.168.1.155 orenosp #The node "orenosp0" will be the primary node. #heartbeat will look for scripts of the same name in the following paths: #/etc/ha.d/resource.d : /etc/init.d #In our case, heartbeat will start the product default /etc/init.d/orenosp script. #EOF -------------- /etc/ha.d/authkeys ------------------ auth 2 2 crc #EOF Note you must protect authkeys file: > chmod 600 /etc/ha.d/authkeys -------------- /etc/hosts ------------------- 192.168.1.129 orenosp0 192.168.1.128 orenosp1 5) Test the clustered Orenosp ============================= Distribute the config files described in step 4 to the secondary node. Also make sure you don't have the files with the same filename in /etc directory. If you do, please remove them. Starting Heartbeat on primary node ---------------------------------- /etc/init.d/hearbeart start First, you need to check /var/log/ha-log file (as specified by parameter "logfile" in ha.cf). You should also check /var/log/ha-debug file (as specified by paramater "debugfile" in ha.cf). Heartbeat will first wait for 120 secs (specified by "initdead" parameter). Heartbeat will then announce the virtual IP address (192.168.1.155) and also invokes /etc/init.d/orenosp script to start Orenosp. If everything is successfull, you should be able to access Orenosp using the virtual IP address. Starting Heartbeat on secondary node ------------------------------------ If the primary node comes up successfully, you will bring up the second node. /etc/init.d/hearbeart start Please check ha-log file to see if heartbeat on the secondary node has successfully entered into the standby mode. Halt the primary node --------------------- See if the secondary node will take over the cluster and you should still be able to access Orenosp using the virtual IP address. Bring back up the primay node ----------------------------- See if the primary node will take over the cluster as the failback mode is on. 6) Configure heartbeat to auto-start on each node ================================================= If the cluster test is okay, you want to enable auto-start of hearbeat service on each node. Note that orenosp service should remain manual-start as it will be started by heartbeat. # >/sbin/chkconfig --list heartbeat >/sbin/chkconfig --level 2345 heartbeat on 7) [Optional] Additional Configuration To Monitor Orenosp Service ================================================================= EOF