mysql服务器的HA集群之corosync+drbd+pacemaker实现 中

 三、mysql安装与配置

3.1 node1设为主节点,node2设为备份节点 

 


  
  
  
  
  1. [root@node2 ~]# drbd-overview  
  2. 0:mysql Connected Primary/Secondary UpToDate/UpToDate C r----  
  3. [root@node2 ~]# drbdadm secondary mysql 
  4. [root@node2 ~]# drbdadm role mysql 
  5. Secondary/Secondary 
  6. [root@node2 ~]# drbd-overview  
  7. 0:mysql Connected Secondary/Secondary UpToDate/UpToDate C r----  
  8. [root@node2 ~]# 
  9.  
  10. [root@node1 ~]# drbd-overview  
  11. 0:mysql Connected Secondary/Secondary UpToDate/UpToDate C r----  
  12. [root@node1 ~]# drbdadm primary mysql 
  13. [root@node1 ~]# drbdadm role mysql 
  14. Primary/Secondary 
  15. [root@node1 ~]# drbd-overview  
  16. 0:mysql Connected Primary/Secondary UpToDate/UpToDate C r----  
  17. [root@node1 ~]# 

3.2 node1.magedu.com上安装配置mysql 

  
  
  
  
  1. [root@node1 ~]# groupadd -r mysql 
  2. [root@node1 ~]# useradd -g mysql -r mysql 
  3. [root@node1 ~]# drbd-overview  
  4. 0:mysql Connected Primary/Secondary UpToDate/UpToDate C r----  
  5. [root@node1 ~]# mount /dev/drbd0 /mnt/mysqldata/ 
  6. [root@node1 ~]# mkdir -pv /mnt/mysqldata/data 
  7. mkdir: created directory `/mnt/mysqldata/data' 
  8. [root@node1 ~]# chown -R mysql.mysql /mnt/mysqldata/data/ 
  9. [root@node1 ~]# ll /mnt/mysqldata/  
  10. total 24 
  11. drwxr-xr-x 2 mysql mysql 4096 Feb 7 21:48 data 
  12. -rw-r--r-- 1 root root 4 Feb 7 21:28 f1 
  13. -rw-r--r-- 1 root root 0 Feb 7 21:28 f2 
  14. drwx------ 2 root root 16384 Feb 7 21:26 lost+found 
  15. [root@node1 ~]#cd ha/ 
  16. [root@node1 ha]# tar -zxvf mysql-5.5.15-linux2.6-i686.tar.gz -C /usr/local/ 
  17. [root@node1 ~]# cd /usr/local/  
  18. [root@node1 src]# ln -sv mysql-5.5.15-linux2.6-i686/ mysql 
  19. create symbolic link `mysql' to `mysql-5.5.15-linux2.6-i686/' 
  20. [root@node1 src]# ll 
  21. [root@node1 src]# cd mysql 
  22. [root@node1 mysql]# chown -R mysql:mysql . 
  23. [root@node1 mysql]# scripts/mysql_install_db --user=mysql --datadir=/mnt/mysqldata/data/ 
  24. [root@node1 mysql]# chown -R root . 
  25. [root@node1 mysql]# cp support-files/my-large.cnf /etc/my.cnf 
  26. [root@node1 mysql]# vim /etc/my.cnf 
  27. 39 thread_concurrency = 2 
  28. 40 datadir = /mnt/mysqldata/data/ #指定mysql数据文件的存放位置(添加) 


mysql提供sysv服务脚本,使其能使用service命令:

  
  
  
  
  1. [root@node1 mysql]# cp support-files/mysql.server /etc/rc.d/init.d/mysqld 
  2. [root@node1 mysql]# scp /etc/my.cnf node2:/etc/ 
  3. my.cnf 100% 4696 4.6KB/s 00:00  
  4. [root@node1 mysql]# scp /etc/rc.d/init.d/mysqld node2:/etc/rc.d/init.d/ 
  5. mysqld 100% 10KB 10.4KB/s 00:00  
  6. [root@node1 mysql]# 
  7. [root@node1 mysql]# chkconfig --add mysqld 
  8. [root@node1 mysql]# chkconfig mysqld off 
  9. [root@node1 mysql]# chkconfig --list mysqld 
  10. mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off 
  11. [root@node1 mysql]# service mysqld start 
  12. Starting MySQL..... [ OK ] 
  13. [root@node1 mysql]# l1 /mnt/mysqldata/data/ 
  14. total 28744 
  15. -rw-rw---- 1 mysql mysql 5242880 Feb 7 22:00 ib_logfile0 
  16. -rw-rw---- 1 mysql mysql 5242880 Feb 7 21:59 ib_logfile1 
  17. -rw-rw---- 1 mysql mysql 18874368 Feb 7 22:00 ibdata1 
  18. drwx------ 2 mysql root 4096 Feb 7 21:53 mysql 
  19. -rw-rw---- 1 mysql mysql 126 Feb 7 22:00 mysql-bin.000001 
  20. -rw-rw---- 1 mysql mysql 19 Feb 7 21:59 mysql-bin.index 
  21. -rw-rw---- 1 mysql root 2127 Feb 7 22:00 node1.magedu.com.err 
  22. drwx------ 2 mysql mysql 4096 Feb 7 21:53 performance_schema 
  23. drwx------ 2 mysql root 4096 Feb 7 21:53 test  
  24. [root@node1 mysql]# service mysqld stop  
  25. Shutting down MySQL. [ OK ] 
  26. [root@node1 mysql]# 


为了使用mysql的安装符合系统使用规范,并将其开发组件导出给系统使用,这里还需要进行如下步骤:

输出mysqlman手册至man命令的查找路径:添加如下行即可:
[root@node1 mysql]# vim /etc/man.config
48
行添加 MANPATH /usr/local/mysql/man
输出mysql的头文件至系统头文件路径/usr/include,这可以通过简单的创建链接实现:
[root@node1 mysql]# ln -sv /usr/local/mysql/include /usr/include/mysql
create symbolic link `/usr/include/mysql' to `/usr/local/mysql/include'
[root@node1 mysql]#
输出mysql的库文件给系统库查找路径:(文件只要是在/etc/ld.so.conf.d/下并且后缀是.conf就可以)而后让系统重新载入系统库
[root@node1 mysql]# echo '/usr/local/mysql/lib' >> /etc/ld.so.conf.d/mysql.conf
[root@node1 mysql]# ldconfig -v |grep mysql 
/usr/local/mysql/lib:
libmysqlclient.so.18 -> libmysqlclient_r.so.18.0.0
修改PATH环境变量,让系统所有用户可以直接使用mysql的相关命令:
[root@node1 mysql]# vim /etc/profile
59 PATH=$PATH:/usr/local/mysql/bin #
添加
[root@node1 mysql]# . /etc/profile
[root@node1 mysql]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin
卸载drbd设备:
[root@node1 mysql]# umount /mnt/mysqldata/
3.3 
node2设为主节点,node1设为备份节点 


  
  
  
  
  1. [root@node1 ~]# drbd-overview  
  2. 0:mysql Connected Primary/Secondary UpToDate/UpToDate C r----  
  3. [root@node1 ~]# drbdadm secondary mysql 
  4. [root@node1 ~]# drbdadm role mysql 
  5. Secondary/Secondary 
  6. [root@node1 ~]# drbd-overview  
  7. 0:mysql Connected Secondary/Secondary UpToDate/UpToDate C r----  
  8. [root@node1 ~]# 
  9.  
  10. [root@node2 ~]# drbd-overview  
  11. 0:mysql Connected Secondary/Secondary UpToDate/UpToDate C r----  
  12. [root@node2 ~]# drbdadm primary mysql 
  13. [root@node2 ~]# drbdadm role mysql 
  14. Primary/Secondary 
  15. [root@node2 ~]# drbd-overview  
  16. 0:mysql Connected Primary/Secondary UpToDate/UpToDate C r----  
  17. [root@node2 ~]# 

3.4 node2.magedu.com上安装配置mysql 

添加用户和组:
[root@node2 ~]# groupadd -r mysql
[root@node2 ~]# useradd -g mysql -r mysql
[root@node2 ~]# drbd-overview 
0:mysql Connected Primary/Secondary UpToDate/UpToDate C r---- 
[root@node2 ~]#
挂载drbd设备:
[root@node2 ~]# mount /dev/drbd0 /mnt/mysqldata/
[root@node2 ~]# ll /mnt/mysqldata/
total 24
drwxr-xr-x 5 mysql mysql 4096 Feb 7 22:00 data
-rw-r--r-- 1 root root 4 Feb 7 21:28 f1
-rw-r--r-- 1 root root 0 Feb 7 21:28 f2
drwx------ 2 root root 16384 Feb 7 21:26 lost+found
[root@node2 ~]# ll /mnt/mysqldata/data/
total 28744
-rw-rw---- 1 mysql mysql 5242880 Feb 7 22:00 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Feb 7 21:59 ib_logfile1
-rw-rw---- 1 mysql mysql 18874368 Feb 7 22:00 ibdata1
drwx------ 2 mysql root 4096 Feb 7 21:53 mysql
-rw-rw---- 1 mysql mysql 126 Feb 7 22:00 mysql-bin.000001
-rw-rw---- 1 mysql mysql 19 Feb 7 21:59 mysql-bin.index
-rw-rw---- 1 mysql root 2127 Feb 7 22:00 node1.magedu.com.err
drwx------ 2 mysql mysql 4096 Feb 7 21:53 performance_schema
drwx------ 2 mysql root 4096 Feb 7 21:53 test
[root@node2 ~]#
安装mysql
[root@node2 ~]# cd ha/
[root@node2 ha]# tar -zxvf mysql-5.5.15-linux2.6-i686.tar.gz -C /usr/local/
[root@node2 ha]# cd /usr/local/
[root@node2 local]# ln -sv mysql-5.5.15-linux2.6-i686/ mysql
create symbolic link `mysql' to `mysql-5.5.15-linux2.6-i686/'
[root@node2 local]# cd mysql
一定不能对数据库进行初始化,因为我们在node1上已经初始化了:
[root@node2 mysql]# chown -R root:mysql .
mysql
主配置文件和sysc服务脚本已经从node1复制过来了,不用在添加。
管理mysql服务:
[root@node2 mysql]# chkconfig --add mysqld
[root@node2 mysql]# chkconfig mysqld off
[root@node2 mysql]# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@node2 mysql]#
启动mysql服务:
[root@node2 mysql]# service mysqld start
Starting MySQL....... [ OK ]
[root@node2 mysql]# ll /mnt/mysqldata/data/
total 28756
-rw-rw---- 1 mysql mysql 5242880 Feb 7 22:29 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Feb 7 21:59 ib_logfile1
-rw-rw---- 1 mysql mysql 18874368 Feb 7 22:00 ibdata1
drwx------ 2 mysql root 4096 Feb 7 21:53 mysql
-rw-rw---- 1 mysql mysql 126 Feb 7 22:00 mysql-bin.000001
-rw-rw---- 1 mysql mysql 107 Feb 7 22:29 mysql-bin.000002
-rw-rw---- 1 mysql mysql 38 Feb 7 22:29 mysql-bin.index
-rw-rw---- 1 mysql root 2127 Feb 7 22:00 node1.magedu.com.err
-rw-rw---- 1 mysql root 941 Feb 7 22:29 node2.magedu.com.err
-rw-rw---- 1 mysql mysql 5 Feb 7 22:29 node2.magedu.com.pid
drwx------ 2 mysql mysql 4096 Feb 7 21:53 performance_schema
drwx------ 2 mysql root 4096 Feb 7 21:53 test
测试之后关闭服务:
[root@node2 mysql]# service mysqld stop 
Shutting down MySQL. [ OK ]
[root@node2 mysql]#
为了使用mysql的安装符合系统使用规范,并将其开发组件导出给系统使用,这里还需要进行如下步骤:

输出mysqlman手册至man命令的查找路径:添加如下行即可:
[root@node2 mysql]# vim /etc/man.config
48
行添加 MANPATH /usr/local/mysql/man
输出mysql的头文件至系统头文件路径/usr/include,这可以通过简单的创建链接实现:
[root@node2 mysql]# ln -sv /usr/local/mysql/include /usr/include/mysql
create symbolic link `/usr/include/mysql' to `/usr/local/mysql/include'
[root@node2 mysql]#
输出mysql的库文件给系统库查找路径:(文件只要是在/etc/ld.so.conf.d/下并且后缀是.conf就可以)而后让系统重新载入系统库
[root@node2 mysql]# echo '/usr/local/mysql/lib' >> /etc/ld.so.conf.d/mysql.conf
[root@node2 mysql]# ldconfig -v |grep mysql 
/usr/local/mysql/lib:
libmysqlclient.so.18 -> libmysqlclient_r.so.18.0.0
修改PATH环境变量,让系统所有用户可以直接使用mysql的相关命令:
[root@node2 mysql]# vim /etc/profile
59 PATH=$PATH:/usr/local/mysql/bin #
添加
[root@node2 mysql]# . /etc/profile
[root@node2 mysql]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin
卸载drbd设备:
[root@node2 mysql]# umount /mnt/mysqldata/

四、corosync+pacemaker的安装和配置 

4.1安装有关软件 


  
  
  
  
  1. [root@node1 ~]# cd ha/  
  2. [root@node1 ha]# yum localinstall -y *.rpm --nogpgcheck 
  3. … 
  4. Installed: 
  5. cluster-glue.i386 0:1.0.6-1.6.el5 cluster-glue-libs.i386 0:1.0.6-1.6.el5 
  6. corosync.i386 0:1.2.7-1.1.el5 corosynclib.i386 0:1.2.7-1.1.el5  
  7. heartbeat.i386 0:3.0.3-2.3.el5 heartbeat-libs.i386 0:3.0.3-2.3.el5  
  8. libesmtp.i386 0:1.0.4-5.el5 openais.i386 0:1.1.3-1.6.el5  
  9. openaislib.i386 0:1.1.3-1.6.el5 pacemaker.i386 0:1.1.5-1.1.el5  
  10. pacemaker-cts.i386 0:1.1.5-1.1.el5 pacemaker-libs.i386 0:1.1.5-1.1.el5  
  11. perl-TimeDate.noarch 1:1.16-5.el5 resource-agents.i386 0:1.0.4-1.1.el5 
  12.  
  13. Dependency Installed: 
  14. libibverbs.i386 0:1.1.2-4.el5 librdmacm.i386 0:1.0.8-5.el5  
  15. libtool-ltdl.i386 0:1.5.22-6.1 lm_sensors.i386 0:2.10.7-4.el5  
  16. openhpi-libs.i386 0:2.14.0-5.el5 openib.noarch 0:1.4.1-3.el5 
  17.  
  18. Complete! 
  19. [root@node1 ha]# 
  20.  
  21. [root@node2 ~]# cd ha/ 
  22. [root@node2 ha]# yum localinstall -y *.rpm --nogpgcheck 
  23. … 
  24. Installed: 
  25. cluster-glue.i386 0:1.0.6-1.6.el5 cluster-glue-libs.i386 0:1.0.6-1.6.el5 
  26. corosync.i386 0:1.2.7-1.1.el5 corosynclib.i386 0:1.2.7-1.1.el5  
  27. heartbeat.i386 0:3.0.3-2.3.el5 heartbeat-libs.i386 0:3.0.3-2.3.el5  
  28. libesmtp.i386 0:1.0.4-5.el5 openais.i386 0:1.1.3-1.6.el5  
  29. openaislib.i386 0:1.1.3-1.6.el5 pacemaker.i386 0:1.1.5-1.1.el5  
  30. pacemaker-cts.i386 0:1.1.5-1.1.el5 pacemaker-libs.i386 0:1.1.5-1.1.el5  
  31. perl-TimeDate.noarch 1:1.16-5.el5 resource-agents.i386 0:1.0.4-1.1.el5 
  32.  
  33. Dependency Installed: 
  34. libibverbs.i386 0:1.1.2-4.el5 librdmacm.i386 0:1.0.8-5.el5  
  35. libtool-ltdl.i386 0:1.5.22-6.1 lm_sensors.i386 0:2.10.7-4.el5  
  36. openhpi-libs.i386 0:2.14.0-5.el5 openib.noarch 0:1.4.1-3.el5 
  37.  
  38. Complete! 
  39. [root@node2 ha]# 

4.2 node1node2节点进行相应的配置 

1:切换到主配置文件的目录
[root@node1 ha]# cd /etc/corosync/
[root@node1 corosync]# ll 
total 20
-rw-r--r-- 1 root root 5384 Jul 28 2010 amf.conf.example
-rw-r--r-- 1 root root 436 Jul 28 2010 corosync.conf.example
drwxr-xr-x 2 root root 4096 Jul 28 2010 service.d
drwxr-xr-x 2 root root 4096 Jul 28 2010 uidgid.d
[root@node1 corosync]# cp corosync.conf.example corosync.conf 
[root@node1 corosync]# vim corosync.conf
10 bindnetaddr: 192.168.101.0 #
修改此行
#
添加以下几行
33 service {
34 ver: 0
35 name: pacemaker
36 use_mgmtd: yes
37 }
38 aisexec {
39 user: root
40 group: root
41 }
2:
创建cluster目录
[root@node1 corosync]# mkdir -pv /var/log/cluster
mkdir: created directory `/var/log/cluster'
3:
为了便面其他主机加入该集群,需要认证,生成一authkey
[root@node1 corosync]# corosync-keygen 
Corosync Cluster Engine Authentication key generator.
Gathering 1024 bits for key from /dev/random.
Press keys on your keyboard to generate entropy.
Writing corosync key to /etc/corosync/authkey.
[root@node1 corosync]# ll
total 28
-rw-r--r-- 1 root root 5384 Jul 28 2010 amf.conf.example
-r-------- 1 root root 128 Feb 7 22:47 authkey
-rw-r--r-- 1 root root 555 Feb 7 22:45 corosync.conf
-rw-r--r-- 1 root root 436 Jul 28 2010 corosync.conf.example
drwxr-xr-x 2 root root 4096 Jul 28 2010 service.d
drwxr-xr-x 2 root root 4096 Jul 28 2010 uidgid.d
[root@node1 corosync]#
4:
node1节点上的文件拷贝到节点node2上面(记住要带-p)
[root@node1 corosync]# scp -p authkey corosync.conf node2:/etc/corosync/
authkey 100% 128 0.1KB/s 00:00 
corosync.conf 100% 561 0.6KB/s 00:00 
[root@node1 corosync]# ssh node2 'mkdir -pv /var/log/cluster'
mkdir: created directory `/var/log/cluster'
[root@node1 corosync]#

4.3 node1node2节点上检测

 

1:node1node2节点上面启动 corosync 的服务
[root@node1 corosync]# service corosync start
Starting Corosync Cluster Engine (corosync): [ OK ]
[root@node1 corosync]# ssh node2 'service corosync start'
Starting Corosync Cluster Engine (corosync): [ OK ]
[root@node1 corosync]# 
2:
node1上验证corosync引擎是否正常启动了
[root@node1 ~]# grep -i -e "corosync cluster engine" -e "configuration file" /var/log/messages
Feb 7 22:51:41 node1 corosync[5149]: [MAIN ] Corosync Cluster Engine ('1.2.7'): started and ready to provide service.
Feb 7 22:51:41 node1 corosync[5149]: [MAIN ] Successfully read main configuration file '/etc/corosync/corosync.conf'. 
3: 
node1上查看初始化成员节点通知是否发出
[root@node1 ~]# grep -i totem /var/log/messages
Feb 7 22:51:41 node1 corosync[5149]: [TOTEM ] Initializing transport (UDP/IP).
Feb 7 22:51:41 node1 corosync[5149]: [TOTEM ] Initializing transmit/receive security: libtomcrypt SOBER128/SHA1HMAC (mode 0).
Feb 7 22:51:42 node1 corosync[5149]: [TOTEM ] The network interface [192.168.101.81] is now up.
Feb 7 22:51:42 node1 corosync[5149]: [TOTEM ] A processor joined or left the membership and a new membership was formed. 
4: 
node1上检查过程中是否有错误产生(避免stonith的错误)
[root@node1 ~]# grep -i error: /var/log/messages |grep -v unpack_resources
出现如下1个错误:
Feb 7 22:51:43 node1 corosync[5149]: [pcmk ] ERROR: pcmk_wait_dispatch: Child process mgmtd exited (pid=5161, rc=100)
此处
解决方法:
仔细看了/var/log/messages日志,或者使用crm_verify -L检查一下错误,其实没必要卸载重装。这个错误是由于缺少snoith设备引起的,并不会影响corosync的运行。可以忽略这个错误。
[root@node1 corosync]# crm_verify -L
crm_verify[5247]: 2012/02/07_23:09:37 ERROR: unpack_resources: Resource start-up disabled since no STONITH resources have been defined
crm_verify[5247]: 2012/02/07_23:09:37 ERROR: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option
crm_verify[5247]: 2012/02/07_23:09:37 ERROR: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity
Errors found during check: config not valid
-V may provide more details
[root@node1 corosync]#
5: 
node1上检查pacemaker时候已经启动了?(如下显示正常启动)
[root@node1 ~]# grep -i pcmk_startup /var/log/messages 
Feb 7 22:51:42 node1 corosync[5149]: [pcmk ] info: pcmk_startup: CRM: Initialized
Feb 7 22:51:42 node1 corosync[5149]: [pcmk ] Logging: Initialized pcmk_startup
Feb 7 22:51:42 node1 corosync[5149]: [pcmk ] info: pcmk_startup: Maximum core file size is: 4294967295
Feb 7 22:51:42 node1 corosync[5149]: [pcmk ] info: pcmk_startup: Service: 9
Feb 7 22:51:42 node1 corosync[5149]: [pcmk ] info: pcmk_startup: Local hostname: node1.magedu.com
6: 
node2上验证corosync引擎是否正常启动了
[root@node2 ~]# grep -i -e "corosync cluster engine" -e "configuration file" /var/log/messages
Feb 7 22:53:01 node2 corosync[5246]: [MAIN ] Corosync Cluster Engine ('1.2.7'): started and ready to provide service.
Feb 7 22:53:01 node2 corosync[5246]: [MAIN ] Successfully read main configuration file '/etc/corosync/corosync.conf'.
7: 
node2上查看初始化成员节点通知是否发出
[root@node2 ~]# grep -i totem /var/log/messages
Feb 7 22:53:01 node2 corosync[5246]: [TOTEM ] Initializing transport (UDP/IP).
Feb 7 22:53:01 node2 corosync[5246]: [TOTEM ] Initializing transmit/receive security: libtomcrypt SOBER128/SHA1HMAC (mode 0).
Feb 7 22:53:02 node2 corosync[5246]: [TOTEM ] The network interface [192.168.101.82] is now up.
Feb 7 22:53:02 node2 corosync[5246]: [TOTEM ] A processor joined or left the membership and a new membership was formed.
Feb 7 22:53:03 node2 corosync[5246]: [TOTEM ] A processor joined or left the membership and a new membership was formed.
8: 
node2上检查过程中是否有错误产生(避免stonith的错误,如下显示只有stonith错误,可忽略)
[root@node2 ~]# grep -i error: /var/log/messages |grep -v unpack_resources
Feb 7 22:53:03 node2 corosync[5246]: [pcmk ] ERROR: pcmk_wait_dispatch: Child process mgmtd exited (pid=5258, rc=100)
9: 
node2上检查pacemaker时候已经启动了?(如下显示正常启动)
[root@node2 ~]# grep -i pcmk_startup /var/log/messages
[root@node2 ~]# grep -i pcmk_startup /var/log/messages
Feb 7 22:53:02 node2 corosync[5246]: [pcmk ] info: pcmk_startup: CRM: Initialized
Feb 7 22:53:02 node2 corosync[5246]: [pcmk ] Logging: Initialized pcmk_startup
Feb 7 22:53:02 node2 corosync[5246]: [pcmk ] info: pcmk_startup: Maximum core file size is: 4294967295
Feb 7 22:53:02 node2 corosync[5246]: [pcmk ] info: pcmk_startup: Service: 9
Feb 7 22:53:02 node2 corosync[5246]: [pcmk ] info: pcmk_startup: Local hostname: node2.magedu.com
10: 
node1node2上查看群集的状态
[root@node1 corosync]# crm status
============
Last updated: Tue Feb 7 23:18:39 2012
Stack: openais
Current DC: node1.magedu.com - partition with quorum
Version: 1.1.5-1.1.el5-01e86afaaa6d4a8c4836f68df80ababd6ca3902f
2 Nodes configured, 2 expected votes
0 Resources configured.
============

Online: [ node2.magedu.com node1.magedu.com ]

[root@node1 corosync]#

[root@node2 corosync]# crm status
============
Last updated: Tue Feb 7 23:20:06 2012
Stack: openais
Current DC: node1.magedu.com - partition with quorum
Version: 1.1.5-1.1.el5-01e86afaaa6d4a8c4836f68df80ababd6ca3902f
2 Nodes configured, 2 expected votes
0 Resources configured.
============

Online: [ node2.magedu.com node1.magedu.com ]

[root@node2 corosync]#

 


你可能感兴趣的:(mysql,集群,高可用,drbd,corosync)