background
TFSRequirements forGCC 4.1.2compile, two scenarios1is to useCentos5 (comes withgcc 4.1.2), 2UseCENTOS6putGCCreduced to4.1.2. I'm using the first method to successfully run TFS as aHAwhen the question came, the official request was to useHeartbeat 3.x,centos5is a2.x. Start selecting thecentos5under CompileHeartbeat 3successful, but also requires compilingPacemaker, compile the time encountered some problems, may be version matching, dependency is not congruent, even if compiled by considering the subsequent need to compile XXX is not a waste of time, after allcentos5Is already very old.
decided to put compiled tfs centos6 centos6 ha
The problem with this approach is that the TFS Partial OPS command in CENTOS6 is not good enough to load the xxx dependency Library. The workaround is to use the Operations command in CENTOS5. (in the long run, the CENTOS6 GCC will be reduced to 4.1.2)
Okay, here we are.
System Environment
Nameserver1 Master 192.168.6.129eth0
Nameserver2 slave 192.168.6.128 eth0
vip192.168.6.100 ( VIP eth0:0 )
( The open side does not seem to have to manually perform ifconfig eth0:0 192.168.6.100 netmask 255.255.255.0 up)
Systems are VMware installation of centos6.6. .
Install the package first
Yuminstall Heartbeat
also need to install Pacemaker here should be careful not to use yum installation, because the installation of pacemaker is 1.1.12 version,pacemaker the CRM after the 1.1.8 version , so downloaded the pacemaker-1.1.7 version compilation installation (http://down1.chinaunix.net/distfiles/ pacemaker-1.1.7.tar.gz)
Install dependencies before compiling
Yum Install perl-timedate openipmi-libs lm_sensors libxslt libibverbs librdmacm pkgconfig libtool intltool gettext-de Vel glib2-devel python-devel libxml2-devel pam-devel ncurses-devel pygtk2 libtool-ltdl libqb clusterlib Libtool-ltdl-dev El Swig gnutls-devel resource-agents clusterlib cluster-glue-libs-devel heartbeat-devel
(note the use of Epel source. )
#tar –VXF pacemaker-1.1.7.tar.gz
#cd clusterlabs-pacemaker-b5b0a7b
#./autogen.sh
#./Configure
#make && make Install
The above two hosts are to be installed.
Configure Namesever
two hosts. Namesever of the ns.conf
[Public]
#vip
IP_ADDR = 192.168.6.100
# Listening Port
Port =8108
[NameServer]
ip_addr_list = 192.168.6.129|192.168.6.128
The above items are written in the same way as the two hosts, and the other items are the same, just focus on them.
Configurationhearbeat
Assume that two host names are called
192.168.6.129 test1
192.168.6.128 test2
(Test1,test2 modified to your hostname, on test1 directly ping test2 can be represented correctly, modify the host name reference http://blog.csdn.net/l241002209/article/details/42269435)
and then in test1 on the execution
#cd $TBLIB _root/scripts/ha/
#vi HA.CF
Debugfile/var/log/ha-debug
Debug 1
KeepAlive 2
Warntime 5
Deadtime 10
Initdead 30
Auto_failback off
Autojoin None
ucast eth0 192.168.6.128 <-- Note that this is the address to the end.
Udpport 694
Node Tes1
Node Test2
Compression bz2
Logfile/var/log/ha-log
Logfacility local0
CRM Respawn
(Modify finish to save Exit : Wq )
#./deploy
#./nsdep
and then in test2 on the execution
#cd $TBLIB _root/scripts/ha/
#vi HA.CF
Debugfile/var/log/ha-debug
Debug 1
KeepAlive 2
Warntime 5
Deadtime 10
Initdead 30
Auto_failback off
Autojoin None
ucast eth0 192.168.6.129 <-- Note that this is the address to the end.
Udpport 694
Node Tes1
Node Test2
Compression bz2
Logfile/var/log/ha-log
Logfacility local0
CRM Respawn
(Modify finish to save Exit : Wq )
#./deploy
#./nsdep
two hosts. Authkeys must be unified
in the test1 Execution
#sudo Scp/etc/ha.d/authkeys [Email protected]:/etc/ha.d/
(root user does not add sudo, the following does not repeat )
ConfigurationCRM
in the Test1,test2 Execute separately
#sudo vi/etc/passwd
Find hacluster:x:498:498:heartbeat user:/var/lib/heartbeat/cores/hacluster:/sbin/nologin ( basically in the last line )
put the last /sbin/nologin Change into /bin/bash
(Modify finish to save Exit : Wq )
#sudo passwd Hacluster
The password is set by itself and entered two times.
#su Hacluster
Lost password
#crm_attribute--type crm_config--attr-name Symmetric-cluster--attr-value True
#crm_attribute--type crm_config--attr-name stonith-enabled--attr-value false
#crm_attribute--type rsc_defaults--nameresource-stickiness--update 100
( Note If you are prompted to make a mistake, start Heartbeat, #sudo service heartbeat start)
# exit
#vi Ns.xml
............
<instance_attributesid= "Ip-alias-instance_attributes" >
<nvpair id= "Ip-alias-instance_attributes-ip" name= "IP" value= " 192.168.6.100 "/>
<nvpair id= "Ip-alias-instance_attributes-nic" Name= "Nic" Value= " eth0:0 "/>
</instance_attributes>
<operations>
..............
<primitive class= "OCF" id= "Tfs-name-server" provider= "Heartbeat" type= "NameServer" >
<instance_attributesid= "Tfs-name-server-instance_attributes" >
<nvpair id= "Tfs-name-server-instance_attributes-basedir" name= "Basedir" value= " write the installation path for TFS here "/>
<nvpair id= "Tfs-name-server-instance_attributes-nsip" name= "Nsip" value= " 192.168.6.129 "/> (note tes1 write 192.168.6.129,test2 write 192.168.6.128, other red places also to be written according to the actual situation of the host. The rest of the authors are the same)
<nvpair id= "Tfs-name-server-instance_attributes-nsport" name= "Nsport" value= " 8108 "/>
<nvpair id= "Tfs-name-server-instance_attributes-user" name= "user" value= " user name to start TFS "/>
</instance_attributes>
..................
(Modify finish to save Exit : Wq )
#sudo CP ns.xml/var/lib/heartbeat/crm/
#sudo Chown Hacluster:haclient/var/lib/heartbeat/crm/ns.xml
#su Hacluster
#cibadmin--replace--obj_type=resources--xml-file/var/lib/heartbeat/crm/ns.xml
#exit
#sudo Service Heartbeat start ( Note that it was restart before it was started )
ValidationHA
Wait a few moments after startup or
# sudo tail-f/var/log/ha-log ( Live view, don't want to see Ctrl + C)
in the Test1,test2 Execute separately NETSTAT–LNTP
will find that only one host has nameserver Process
Execute on the host that has this process (change to your process number)
#sudo Kill 49148
then go to another host to execute the ( may need to wait a few seconds )
#netstat –LNTP
will find nameserver started up.
Description When there is a host nameserver go, HA another master opportunity to start nameserver to ensure TFS normal operation.
CentOS Build TFS Nameserver HA