corosync+pacemaker+mysql+drbd 实现mysql的高可用

2016-07-12 10:26:24来源:oschina作者:osenlin人点击

corosynccorosync的由来是源于一个Openais的项目,是Openais的一个子 项目,可以实现HA心跳信息传输的功能,是众多实现HA集群软件中之一,heartbeat与corosync是流行的Messaging Layer (集群信息层)工具。而corosync是一个新兴的软件,相比Heartbeat这款很老很成熟的软件,corosync与Heartbeat各有优势,博主就不在这里比较之间的优势了,corosync相对于Heartbeat只能说现在比较流行。


pacemaker:是众多集群资源管理器(Cluster Resource Manager)CRM中的一个,其主要功能是管理来着集群信息层发送来的信息。Pacemaker是集群的核心,它管理逻辑和集群信息. 集群信息更新通过Corosync通知到各个节点.


mysql:一个开源的关系型数据库


drbd:DRBD:(distributed replication block device)即分布式复制块设备。它的工作原理是:在A主机上有对指定磁盘设备写请求时,数据发送给A主机的kernel,然后通kernel中的一个模块,把相同的数据传送给B主机的kernel中一份,然后B主机再写入自己指定的磁盘设备,从而实现两主机数据的同步,也就实现了写操作高可用。类似于raid1一样,实现数据的镜像,DRBD一般是一主一从,并且所有的读写操作,挂载只能在主节点服务器上进行,,但是主从DRBD服务器之间是可以进行调换的。


各个组件之间的关系:其实mysql与drbd根本没有半毛钱的关系,而drbd与mysql相结合就有很重要的作用了,因为drbd实现数据的镜像,当drbd的主节点挂了之后,drbd的辅助节点还可以提供服务,但是主节点不会主动的切换到辅助的节点上面去,于是乎,高可用集群就派上用场了,因为资源定义为高可用的资源,主节点出现故障之后,高可用集群可以自动的切换到辅助节点上去,实现故障转移继续提供服务。


二、安装高可用集群的提前准备


1)、hosts文件


#把主机名改成jie2.com[[email protected]~]#sed-is/`grepHOSTNAME/etc/sysconfig/network|awk-F'=''{print$2}'`/jie2.com/g/etc/sysconfig/network#把主机名改成jie3.com[[email protected]~]#sed-is/`grepHOSTNAME/etc/sysconfig/network|awk-F'=''{print$2}'`/jie3.com/g/etc/sysconfig/network[[email protected]~]#cat>>/etc/hosts<172.16.22.2jie2.comjie2>172.16.22.3jie3.comjie3>EOF[[email protected]~]#cat>>/etc/hosts<172.16.22.2jie2.comjie2>172.16.22.3jie3.comjie3>EOF

2)、ssh互信


[[email protected]~]#ssh-keygen-trsa-P''[[email protected]~]#ssh-copy-id-i.ssh/id_rsa.pubjie3[[email protected]~]#ssh-keygen-trsa-P''[[email protected]~]#ssh-copy-id-i.ssh/id_rsa.pubjie2

3)、关闭NetworkManger


[[email protected]~]#chkconfig--delNetworkManager[[email protected]~]#chkconfigNetworkManageroff[[email protected]~]#serviceNetworkManagerstop[[email protected]~]#chkconfig--delNetworkManager[[email protected]~]#chkconfigNetworkManageroff[[email protected]~]#serviceNetworkManagerstop

4)、时间同步(博主用的是自己的ntp时间服务器)


[[email protected]~]#ntpdate172.16.0.1[[email protected]~]#ntpdate172.16.0.1

三、安装corosync+pacemaker


1)、安装corosync+pacemaker


#节点jie2.com的操作[[email protected]~]#yum-yinstallcorosyncpacemaker[[email protected]~]#yum-y--nogpgcheckinstallcrmsh-1.2.6-4.el6.x86_64.rpmpssh-2.3.1-2.el6.x86_64.rpm#提供crmsh命令接口的软件#节点jie3.com的操作[[email protected]~]#yum-yinstallcorosyncpacemaker[[email protected]~]#yum-y--nogpgcheckinstallcrmsh-1.2.6-4.el6.x86_64.rpmpssh-2.3.1-2.el6.x86_64.rpm

2)、修改配置文件和生成认证文件


配置文件


#节点jie2.com的操作[[email protected]~]#cd/etc/corosync/[[email protected]]#mvcorosync.conf.examplecorosync.conf[[email protected]]#vimcorosync.conf#Pleasereadthecorosync.conf.5manualpagecompatibility:whitetanktotem{#心跳信息传递层version:2#版本secauth:on#认证信息一般onthreads:0#线程interface{#定义心跳信息传递的接口ringnumber:0bindnetaddr:172.16.0.0#绑定的网络地址,写网络地址mcastaddr:226.94.1.1#多播地址mcastport:5405#多播的端口ttl:1#生存周期}}logging{#日志fileline:offto_stderr:no#是否输出在屏幕上to_logfile:yes#定义自己的日志to_syslog:no#是否由syslog记录日志logfile:/var/log/cluster/corosync.log#日志文件的存放路径debug:offtimestamp:on#时间戳是否关闭logger_subsys{subsys:AMFdebug:off}}amf{mode:disabled}service{ver:0name:pacemaker#pacemaker作为corosync的插件进行工作}aisexec{user:rootgroup:root}[[email protected]]#scpcorosync.confjie3:/etc/corosync/##把节点jie2.com的配置文件copy到jie3.com中

认证文件


#节点jie2.com的操作[[email protected]]#corosync-keygenCorosyncClusterEngineAuthenticationkeygenerator.Gathering1024bitsforkeyfrom/dev/random.Presskeysonyourkeyboardtogenerateentropy(bits=152).#遇到这个情况,表示电脑的随机数不够,各位朋友可以不停的随便敲键盘,或者安装软件也可以生成随机数[[email protected]]#scpauthkeyjie3:/etc/corosync/#把认证文件也复制到jie3.com主机上

3)、开启服务和查看集群中的节点信息


#节点jie2.com的操作[[email protected]~]#servicecorosyncstartStartingCorosyncClusterEngine(corosync):[OK][[email protected]~]#crmstatusLastupdated:ThuAug814:43:132013Lastchange:SunSep116:41:182013viacrm_attributeonjie3.comStack:classicopenais(withplugin)CurrentDC:jie3.com-partitionwithquorumVersion:1.1.8-7.el6-394e9062Nodesconfigured,2expectedvotesOnline:[jie2.comjie3.com]#节点jie3.com的操作[[email protected]~]#servicecorosyncstartStartingCorosyncClusterEngine(corosync):[OK][[email protected]~]#crmstatusLastupdated:ThuAug814:43:132013Lastchange:SunSep116:41:182013viacrm_attributeonjie3.comStack:classicopenais(withplugin)CurrentDC:jie3.com-partitionwithquorumVersion:1.1.8-7.el6-394e9062Nodesconfigured,2expectedvotesOnline:[jie2.comjie3.com]


四、编译安装mysql(两个节点的操作过程都是一样)


#节点jie2.com的操作#1)、解压编译安装[[email protected]~]#tarxfmysql-5.5.33.tar.gz[[email protected]~]#yum-ygroupinstall"Developmenttools""ServerPlatformDevelopment"[[email protected]~]#cdmysql-5.5.33[[email protected]]#yum-yinstallcmake[[email protected]]#cmake.-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/-DMYSQL_DATADIR=/mydata/data-DSYSCONFDIR=/etc/-DWITH_INNOBASE_STORAGE_ENGINE=1-DWITH_ARCHIVE_STORAGE_ENGINE=1/-DWITH_BLACKHOLE_STORAGE_ENGINE=1-DWITH_READLINE=1-DWITH_SSL=system/-DWITH_ZLIB=system-DWITH_LIBWRAP=0-DMYSQL_UNIX_ADDR=/tmp/mysql.sock/-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci[[email protected]]#make&&makeinstall#2)、建立配置文件和脚本文件[[email protected]]#cp/usr/local/mysql/support-files/my-large.cnf/etc/my.cnf[[email protected]]#cp/usr/local/mysql/support-files/mysql.server/etc/rc.d/init.d/mysqld[[email protected]]#cd/usr/local/mysql/[[email protected]]#useradd-r-u306mysql[[email protected]]#chown-Rroot:mysql./*#3)、关联系统识别的路径[[email protected]]#echo"PATH=/usr/local/mysql/bin:$PATH">/etc/profile.d/mysqld.sh[[email protected]]#source/etc/profile.d/mysqld.sh[[email protected]]#echo"/usr/local/mysql/lib">/etc/ld.so.conf.d/mysqld.conf[[email protected]]#ldconfig-v|grepmysql[[email protected]]#ln-sv/usr/local/mysql/include//usr/local/mysqld

先别初始化数据库,安装drbd把drbd挂载到目录下,然后初始化数据库把数据库的数据存放到drbd挂载的目录。


五、安装drbd


安装rpm包的drbd软件必须保证找相同内核版本的drbd-kmdl软件


1)、先划分一个分区,此分区做成drbd镜像(RHEL 6.x的重新格式化一个新的分区之后要重启系统)


#节点jie2.com的操作[[email protected]~]#fdisk/dev/sdaCommand(mforhelp):nCommandactioneextendedpprimarypartition(1-4)pPartitionnumber(1-4):3Firstcylinder(7859-15665,default7859):Usingdefaultvalue7859Lastcylinder,+cylindersor+size{K,M,G}(7859-15665,default15665):+5GCommand(mforhelp):w#节点jie3.com的操作[[email protected]~]#fdisk/dev/sdaCommand(mforhelp):nCommandactioneextendedpprimarypartition(1-4)pPartitionnumber(1-4):3Firstcylinder(7859-15665,default7859):Usingdefaultvalue7859Lastcylinder,+cylindersor+size{K,M,G}(7859-15665,default15665):+5GCommand(mforhelp):w

2)、安装drbd和修改配置文件


#1)、安装drbd#节点jie2.com的操作[[email protected]~]#rpm-ivhdrbd-kmdl-2.6.32-358.el6-8.4.3-33.el6.x86_64.rpmwarning:drbd-kmdl-2.6.32-358.el6-8.4.3-33.el6.x86_64.rpm:HeaderV4DSA/SHA1Signature,keyID66534c2b:NOKEYPreparing...#################################[100%][[email protected]~]#rpm-ivhdrbd-8.4.3-33.el6.x86_64.rpmwarning:drbd-8.4.3-33.el6.x86_64.rpm:HeaderV4DSA/SHA1Signature,keyID66534c2b:NOKEYPreparing...##################################[100%]#节点jie3.com的操作[[email protected]~]#rpm-ivhdrbd-kmdl-2.6.32-358.el6-8.4.3-33.el6.x86_64.rpmwarning:drbd-kmdl-2.6.32-358.el6-8.4.3-33.el6.x86_64.rpm:HeaderV4DSA/SHA1Signature,keyID66534c2b:NOKEYPreparing...#################################[100%][[email protected]~]#rpm-ivhdrbd-8.4.3-33.el6.x86_64.rpmwarning:drbd-8.4.3-33.el6.x86_64.rpm:HeaderV4DSA/SHA1Signature,keyID66534c2b:NOKEYPreparing...##################################[100%]#2)、修改drbd的配置文件#节点jie2.com的操作[[email protected]~]#cd/etc/drbd.d/[[email protected]]#catglobal_common.conf#全局配置文件global{usage-countno;#minor-countdialog-refreshdisable-ip-verification}common{protocolC;handlers{pri-on-incon-degr"/usr/lib/drbd/notify-pri-on-incon-degr.sh;/usr/lib/drbd/notify-emergency-reboot.sh;echob>/proc/sysrq-trigger;reboot-f";pri-lost-after-sb"/usr/lib/drbd/notify-pri-lost-after-sb.sh;/usr/lib/drbd/notify-emergency-reboot.sh;echob>/proc/sysrq-trigger;reboot-f";local-io-error"/usr/lib/drbd/notify-io-error.sh;/usr/lib/drbd/notify-emergency-shutdown.sh;echoo>/proc/sysrq-trigger;halt-f";#fence-peer"/usr/lib/drbd/crm-fence-peer.sh";#split-brain"/usr/lib/drbd/notify-split-brain.shroot";#out-of-sync"/usr/lib/drbd/notify-out-of-sync.shroot";#before-resync-target"/usr/lib/drbd/snapshot-resync-target-lvm.sh-p15---c16k";#after-resync-target/usr/lib/drbd/unsnapshot-resync-target-lvm.sh;}startup{#wfc-timeout120;#degr-wfc-timeout120;}disk{on-io-errordetach;#fencingresource-only;}net{cram-hmac-alg"sha1";shared-secret"mydrbdlab";}syncer{rate1000M;}}[[email protected]]#catmydata.res#资源配置文件resourcemydata{onjie2.com{device/dev/drbd0;disk/dev/sda3;address172.16.22.2:7789;meta-diskinternal;}onjie3.com{device/dev/drbd0;disk/dev/sda3;address172.16.22.3:7789;meta-diskinternal;}}#把配置文件copy到节点jie3.com上面[[email protected]]#scpglobal_common.confmydata.resjie3:/etc/drbd.d/

3)、初始化drbd的资源并启动


#节点jie2.com的操作#创建drbd的资源[[email protected]~]#drbdadmcreate-mddrbdWritingmetadata...initializingactivitylogNOTinitializingbitmaplk_bdev_save(/var/lib/drbd/drbd-minor-0.lkbd)failed:NosuchfileordirectoryNewdrbdmetadatablocksuccessfullycreated.#提示已经创建成功lk_bdev_save(/var/lib/drbd/drbd-minor-0.lkbd)failed:Nosuchfileordirectory#启动服务[[email protected]~]#servicedrbdstartStartingDRBDresources:[createres:drbdpreparedisk:drbdadjustdisk:drbdadjustnet:drbd]..........[ok]#节点jie3.com的操作#创建drbd的资源[[email protected]~]#drbdadmcreate-mddrbdWritingmetadata...initializingactivitylogNOTinitializingbitmaplk_bdev_save(/var/lib/drbd/drbd-minor-0.lkbd)failed:NosuchfileordirectoryNewdrbdmetadatablocksuccessfullycreated.#提示已经创建成功lk_bdev_save(/var/lib/drbd/drbd-minor-0.lkbd)failed:Nosuchfileordirectory#启动服务[[email protected]~]#servicedrbdstartStartingDRBDresources:[createres:drbdpreparedisk:drbdadjustdisk:drbdadjustnet:drbd]..........[ok]

4)、设置一个主节点,然后同步drbd的数据(此步骤只需在一个节点上操作)


#设置jie2.com为drbd的主节点[[email protected]~]#drbdadmprimary--forcemydata[[email protected]~]#cat/proc/drbd#查看同步进度version:8.4.3(api:1/proto:86-101)GIT-hash:[email protected],2013-05-2704:30:210:cs:SyncSourcero:Primary/Secondaryds:UpToDate/InconsistentCr---n-ns:1897624nr:0dw:0dr:1901216al:0bm:115lo:0pe:3ua:3ap:0ep:1wo:foos:207988[=================>..]sync'ed:90.3%(207988/2103412)Kfinish:0:00:07speed:26,792(27,076)K/sec[[email protected]~]#watch-n1'cat/proc/drbd'此命令可以动态的查看[[email protected]~]#cat/proc/drbdversion:8.4.3(api:1/proto:86-101)GIT-hash:[email protected],2013-05-2704:30:210:cs:Connectedro:Primary/Secondaryds:UpToDate/UpToDateCr-----ns:120nr:354dw:435dr:5805al:6bm:9lo:0pe:0ua:0ap:0ep:1wo:foos:0#当两边都为UpToDate时,表示两边已经同步

5)、格式化drdb分区(此步骤在主节点上操作)


[[email protected]~]#mke2fs-text4/dev/drbd0

六、mysql与drbd实现mysql数据的镜像


1)、在drbd的主节点上,挂载drbd的分区,然后初始化数据库


[[email protected]~]#mkdir/mydata#创建用于挂载drbd的目录[[email protected]~]#mount/dev/drbd0/mydata/[[email protected]~]#mkdir/mydata/data[[email protected]~]#chown-Rmysql.mysql/mydata#把文件的属主和属组改成mysql[[email protected]~]#vim/etc/my.cnf#修改mysql的配置文件
datadir=/mydata/data
innodb_file_per_table=1[[email protected]~]#/usr/local/mysql/scripts/mysql_install_db--user=mysql--datadir=/mydata/data/--basedir=/usr/local/mysql#初始化数据库[[email protected]~]#servicemysqldstartStartingMySQL.......[OK]

2)、验证drbd是否镜像


#节点jie2.com的操作#1)、先在drbd的主节点上面创建一个数据库[[email protected]~]#mysqlmysql>showdatabases;
+--------------------+
|Database|
+--------------------+
|information_schema|
|mysql|
|performance_schema|
|test|
+--------------------+4rowsinset(0.00sec)
mysql>createdatabasejie2;QueryOK,1rowaffected(0.01sec)
mysql>showdatabases;
+--------------------+
|Database|
+--------------------+
|information_schema|
|jie2|
|mysql|
|performance_schema|
|test|
+--------------------+5rowsinset(0.00sec)
mysql>/q#2)、停掉mysql服务,卸载drbd挂载的目录[[email protected]~]#servicemysqldstop[[email protected]~]#umount/dev/drbd0#卸载drbd的挂载点[[email protected]~]#drbdadmsecondarymydata#把此节点改为drbd的备用节点
#节点jie3.com的操作#3)、把jie3.com变为drbd的主节点[[email protected]~]#drbdadmprimarymydata#把此节点改为drbd的主节点[[email protected]~]#mkdir/mydata[[email protected]~]#chown-Rmysql.mysql/mydata[[email protected]~]#mount/dev/drdb0/mydata[[email protected]~]#vim/etc/my.cnf
datadir=/mydata/data
innodb_file_per_table=1[[email protected]~]#servicemysqldstart#此节点上不用初始化数据库,直接开启服务即可StartingMySQL.......[OK]
[[email protected]~]#mysqlmysql>showdatabases;#可以看见jie2数据库+--------------------+
|Database|
+--------------------+
|information_schema|
|jie2|
|mysql|
|performance_schema|
|test|
+--------------------+5rowsinset(0.00sec)

七、利用crmsh配置mysql的高可用


需要定义集群资源而mysql、drbd都是集群的资源,由集群管理的资源开机是一定不能够自行启动的。


1)、关闭drbd的服务和关闭mysql的服务


[[email protected]~]#servicemysqldstop[[email protected]~]#servicedrbdstop[[email protected]~]#servicemysqldstop[[email protected]~]#umount/dev/drbd0#之前drbd已经挂载到jie3.com节点上了[[email protected]~]#servicedrdbstop

2)、定义集群资源


定义drbd的资源(提供drbd的资源代理RA由OCF类别中的linbit提供)


[[email protected]~]#crmcrm(live)#configurecrm(live)configure#propertystonith-enabled=falsecrm(live)configure#propertyno-quorum-policy=ignorecrm(live)configure#primitivemysqldrbdocf:linbit:drbdparamsdrbd_resource=mydataopmonitorrole=Masterinterval=10timeout=20opmonitorrole=Slaveinterval=20timeout=20opstarttimeout=240opstoptimeout=100crm(live)configure#verify#可以检查语法

定义drbd的主从资源


crm(live)configure#msms_mysqldrbdmysqldrbdmetamaster-max=1master-node-max=1clone-max=2clone-node-max=1notify=truecrm(live)configure#verify

定义文件系统资源和约束关系


crm(live)configure#primitivemystoreocf:heartbeat:Filesystemparamsdevice="/dev/drbd0"directory="/mydata"fstype="ext4"opmonitorinterval=40timeout=40opstarttimeout=60opstoptimeout=60crm(live)configure#verifycrm(live)configure#colocationmystore_with_ms_mysqldrbdinf:mystorems_mysqldrbd:Mastercrm(live)configure#orderms_mysqldrbd_before_mystoremandatory:ms_mysqldrbd:promotemystore:startcrm(live)configure#verify

定义vip资源、mysql服务的资源约束关系


crm(live)configure#primitivemyvipocf:heartbeat:IPaddrparamsip="172.16.22.100"opmonitorinterval=20timeout=20on-fail=restartcrm(live)configure#primitivemyserverlsb:mysqldopmonitorinterval=20timeout=20on-fail=restartcrm(live)configure#verifycrm(live)configure#colocationmyserver_with_mystoreinf:myservermystorecrm(live)configure#ordermystore_before_myservermandatory:mystore:startmyserver:startcrm(live)configure#verifycrm(live)configure#colocationmyvip_with_myserverinf:myvipmyservercrm(live)configure#ordermyvip_before_myservermandatory:myvipmyservercrm(live)configure#verifycrm(live)configure#commit

查看所有定义资源的信息


crm(live)configure#shownodejie2.com/
attributesstandby="off"nodejie3.com/
attributesstandby="off"primitivemyserverlsb:mysqld/
opmonitorinterval="20"timeout="20"on-fail="restart"primitivemysqldrbdocf:linbit:drbd/
paramsdrbd_resource="mydata"/
opmonitorrole="Master"interval="10"timeout="20"/
opmonitorrole="Slave"interval="20"timeout="20"/
opstarttimeout="240"interval="0"/
opstoptimeout="100"interval="0"primitivemystoreocf:heartbeat:Filesystem/
paramsdevice="/dev/drbd0"directory="/mydata"fstype="ext4"/
opmonitorinterval="40"timeout="40"/
opstarttimeout="60"interval="0"/
opstoptimeout="60"interval="0"primitivemyvipocf:heartbeat:IPaddr/
paramsip="172.16.22.100"/
opmonitorinterval="20"timeout="20"on-fail="restart"/
metatarget-role="Started"msms_mysqldrbdmysqldrbd/
metamaster-max="1"master-node-max="1"clone-max="2"clone-node-max="1"notify="true"colocationmyserver_with_mystoreinf:myservermystore
colocationmystore_with_ms_mysqldrbdinf:mystorems_mysqldrbd:Master
colocationmyvip_with_myserverinf:myvipmyserverorderms_mysqldrbd_before_mystoreinf:ms_mysqldrbd:promotemystore:startordermystore_before_myserverinf:mystore:startmyserver:startordermyvip_before_myserverinf:myvipmyserver
property$id="cib-bootstrap-options"/
dc-version="1.1.8-7.el6-394e906"/
cluster-infrastructure="classicopenais(withplugin)"/
expected-quorum-votes="2"/
stonith-enabled="false"/no-quorum-policy="ignore"

查看资源运行的状态运行在jie3.com上


[[email protected]~]#crmstatusLastupdated:ThuAug817:55:302013Lastchange:SunSep116:41:182013viacrm_attributeonjie3.comStack:classicopenais(withplugin)CurrentDC:jie3.com-partitionwithquorumVersion:1.1.8-7.el6-394e9062Nodesconfigured,2expectedvotes5Resourcesconfigured.Online:[jie2.comjie3.com]Master/SlaveSet:ms_mysqldrbd[mysqldrbd]Masters:[jie3.com]Slaves:[jie2.com]
mystore(ocf::heartbeat:Filesystem):Startedjie3.com
myvip(ocf::heartbeat:IPaddr):Startedjie3.com
myserver(lsb:mysqld):Startedjie3.com

切换节点,看资源是否转移


[[email protected]~]#crmnodestandbyjie3.com#把此节点设置为备用节点[[email protected]~]#crmstatusLastupdated:MonSep201:45:072013Lastchange:MonSep201:44:592013viacrm_attributeonjie3.comStack:classicopenais(withplugin)CurrentDC:jie3.com-partitionwithquorumVersion:1.1.8-7.el6-394e9062Nodesconfigured,2expectedvotes5Resourcesconfigured.Nodejie3.com:standbyOnline:[jie2.com]Master/SlaveSet:ms_mysqldrbd[mysqldrbd]Masters:[jie2.com]#资源已然转到jie2.com上面
Stopped:[mysqldrbd:1]
mystore(ocf::heartbeat:Filesystem):Startedjie2.com
myvip(ocf::heartbeat:IPaddr):Startedjie2.com
myserver(lsb:mysqld):Startedjie2.com

由于定义了drbd的资源约束,Masters运行在那个节点,则此节点不可能成为drbd的辅助节点


[[email protected]~]#cat/proc/drbdversion:8.4.3(api:1/proto:86-101)
GIT-hash:[email protected],2013-05-2704:30:21
0:cs:Connectedro:Primary/Secondaryds:UpToDate/UpToDateCr-----
ns:426nr:354dw:741dr:6528al:8bm:9lo:0pe:0ua:0ap:0ep:1wo:foos:0[[email protected]~]#drbdadmsecondarymydata0:Statechangefailed:(-12)Deviceisheldopenbysomeone
Command'drbdsetupsecondary0'terminatedwithexitcode11

手动的停掉myvip资源还是会启动(因为定义资源是指定了on-fail=restart)


[[email protected]~]#ifconfig|grepeth0eth0Linkencap:EthernetHWaddr00:0C:29:1F:74:CF
inetaddr:172.16.22.2Bcast:172.16.255.255Mask:255.255.0.0
inet6addr:fe80::20c:29ff:fe1f:74cf/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
RXpackets:2165062errors:0dropped:0overruns:0frame:0
TXpackets:4109895errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
RXbytes:167895762(160.1MiB)TXbytes:5731508707(5.3GiB)eth0:0Linkencap:EthernetHWaddr00:0C:29:1F:74:CF
inetaddr:172.16.22.100Bcast:172.16.255.255Mask:255.255.0.0
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1[[email protected]~]#ifconfigeth0:0down[[email protected]~]#ifconfig|grepeth0eth0Linkencap:EthernetHWaddr00:0C:29:1F:74:CF
inetaddr:172.16.22.2Bcast:172.16.255.255Mask:255.255.0.0
inet6addr:fe80::20c:29ff:fe1f:74cf/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
RXpackets:2165242errors:0dropped:0overruns:0frame:0
TXpackets:4110094errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
RXbytes:167917669(160.1MiB)TXbytes:5731537035(5.3GiB)
[[email protected]~]#crmstatusLastupdated:ThuAug818:29:272013Lastchange:MonSep201:44:592013viacrm_attributeonjie3.comStack:classicopenais(withplugin)CurrentDC:jie3.com-partitionwithquorumVersion:1.1.8-7.el6-394e9062Nodesconfigured,2expectedvotes5Resourcesconfigured.Nodejie3.com:standbyOnline:[jie2.com]Master/SlaveSet:ms_mysqldrbd[mysqldrbd]Masters:[jie2.com]Stopped:[mysqldrbd:1]
mystore(ocf::heartbeat:Filesystem):Startedjie2.com
myvip(ocf::heartbeat:IPaddr):Startedjie2.com
myserver(lsb:mysqld):Startedjie2.comFailedactions:
myvip_monitor_20000(node=jie2.com,call=47,rc=7,status=complete):notrunning
myserver_monitor_20000(node=jie3.com,call=209,rc=7,status=complete):notrunning
[[email protected]~]#ifconfig|grepeth0eth0Linkencap:EthernetHWaddr00:0C:29:1F:74:CF
inetaddr:172.16.22.2Bcast:172.16.255.255Mask:255.255.0.0
inet6addr:fe80::20c:29ff:fe1f:74cf/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
RXpackets:2165681errors:0dropped:0overruns:0frame:0
TXpackets:4110535errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
RXbytes:168015864(160.2MiB)TXbytes:5731617112(5.3GiB)eth0:1Linkencap:EthernetHWaddr00:0C:29:1F:74:CF
inetaddr:172.16.22.100Bcast:172.16.255.255Mask:255.255.0.0
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1[[email protected]~]#

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台