In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "how to build Heartbeat+DRBD+MySQL". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
DRBD is a software-implemented, non-shared storage replication solution that mirrors the content of block devices between servers.
The core function of DRBD is implemented through the kernel of Linux, which is closest to the IO stack of the system, but it cannot magically add upper-layer functions such as detecting the crash of the EXT3 file system.
DRBD is located below the file system, closer to the operating system kernel and IO stack than the file system.
DRBD is equivalent to making a network raid1 for the disk.
The working principle of heartbeat (Linux-HA): the core of heartbeat consists of two parts, heartbeat monitoring part and resource takeover part. Heartbeat monitoring can be carried out through network links and serial ports, and redundant links are supported. They send messages to each other to tell each other their current status. If the message sent by the other party is not received within a specified period of time, then the other party is considered invalid. At this point, you need to start the resource takeover module to take over the resources or services on the other host.
DRBD Protocol parameters:
Once Protocol A @ data is written to disk and sent to the network, the write operation is considered complete.
Protocol B @ is considered to have completed the write operation when it receives the receipt confirmation.
Protocol C @ is considered to have completed the write operation when it receives a write confirmation.
# # #
The dark purple text is log or command output, and the red part is the content of the file.
# # #
Vm1 10.0.0.11 Master
Vm2 10.0.0.12 from
VIP: 10.0.0.20
Vm1 vm2 should do all of the following:
1 Software installation:
Wget http://elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm
Ls
Rpm-ivh elrepo-release-6-6.el6.elrepo.noarch.rpm
Yum search drbd
Yum install drbd84 kmod-drbd84
Yum install heartbeat
2 create a partition
[root@vm1 ~] # fdisk-l
Disk / dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00076c33
Device Boot Start End Blocks Id System
/ dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/ dev/sda2 26 157 1048576 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/ dev/sda3 157 2611 19717120 83 Linux
Disk / dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9aa21f28
Device Boot Start End Blocks Id System
[root@vm1 ~] # fdisk / dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
Switch off the mode (command 'c') and change display units to
Sectors (command'u').
Command (m for help): n
Command action
E extended
P primary partition (1-4)
P
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder, + cylinders or + size {KMJ G} (1-130, default 130):
Using default value 130
Command (m for help): W
The partition table has been altered!
Calling ioctl () to re-read partition table.
Syncing disks.
[root@vm1 ~] # partprobe
Warning: WARNING: the kernel failed to re-read the partition table on / dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
[root@vm1 ~] #
3 create a DRBD profile
[root@vm1 ~] # cat / etc/drbd.conf
Global {usage-count yes;}
Common {syncer {rate 10m;}}
Resource db {
Protocol C
Net {
}
On vm1 {
Device / dev/drbd1
Disk / dev/sdb1
Address 10.0.0.11:7789
Meta-disk internal
}
On vm2 {
Device / dev/drbd1
Disk / dev/sdb1
Address 10.0.0.12:7789
Meta-disk internal
}
}
Vm1 vm2 should do all the above operations.
4 create a DBRD resource
[root@vm1 ~] # drbdadm create-md db # # db is the resource name in the DRBD configuration file
You want me to create a v08 style flexible-size internal meta data block.
There appears to be a v08 flexible-size internal meta data block
Already in place on / dev/sdb1 at byte offset 1069248512
Do you really want to overwrite the existing meta-data?
[need to type 'yes' to confirm] yes
Md_offset 1069248512
Al_offset 1069215744
Bm_offset 1069182976
Found ext3 filesystem
1044124 kB data area apparently used
1044124 kB left usable by current configuration
Even though it looks like this would place the new meta data into
Unused space, you still need to confirm, as this is only a guess.
Do you want to proceed?
[need to type 'yes' to confirm] yes
Initializing activity log
NOT initializing bitmap
Writing meta data...
New drbd meta data block successfully created.
[root@vm1 ~] # cat / proc/drbd
Version: 8.4.7-1 (api:1/proto:86-101)
GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11
[root@vm1 ~] #
[root@vm2 ~] # drbdadm create-md db
You want me to create a v08 style flexible-size internal meta data block.
There appears to be a v08 flexible-size internal meta data block
Already in place on / dev/sdb1 at byte offset 1069248512
Do you really want to overwrite the existing meta-data?
[need to type 'yes' to confirm] yes
Md_offset 1069248512
Al_offset 1069215744
Bm_offset 1069182976
Found ext3 filesystem
1044124 kB data area apparently used
1044124 kB left usable by current configuration
Even though it looks like this would place the new meta data into
Unused space, you still need to confirm, as this is only a guess.
Do you want to proceed?
[need to type 'yes' to confirm] yes
Initializing activity log
NOT initializing bitmap
Writing meta data...
New drbd meta data block successfully created.
[root@vm2 ~] # cat / proc/drbd
Version: 8.4.7-1 (api:1/proto:86-101)
GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11
[root@vm2 ~] #
5 start DRBD
[root@vm1 ~] # / etc/init.d/drbd start
Starting DRBD resources: [
Create res: db
Prepare disk: db
Adjust disk: db
Adjust net: db
]
.
* * *
DRBD's startup script waits for the peer node (s) to appear.
-If this node was already a degraded cluster before the
Reboot, the timeout is 0 seconds. [degr-wfc-timeout]
-If the peer was available before the reboot, the timeout
Is 0 seconds. [wfc-timeout]
(These values are for resource 'db'; 0 sec-> wait forever)
To abort waiting enter 'yes' [12]: yes
.
[root@vm1 ~] # ls / dev/drbd*
/ dev/drbd1
/ dev/drbd:
By-disk by-res
[root@vm1 ~] # cat / proc/drbd
Version: 8.4.7-1 (api:1/proto:86-101)
GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11
1: cs:WFConnection ro:Secondary/Unknown ds:Inconsistent/DUnknown CRUTHUTHUTHUMUR
Ns:0 nr:0 dw:0 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:1044124
[root@vm2 ~] # / etc/init.d/drbd start
Starting DRBD resources: [
Create res: db
Prepare disk: db
Adjust disk: db
Adjust net: db
]
.
[root@vm2 ~] # ls / dev/drbd*
/ dev/drbd1
/ dev/drbd:
By-disk by-res
[root@vm1 ~] # cat / proc/drbd
Version: 8.4.7-1 (api:1/proto:86-101)
GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11
1: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r-
Ns:105528 nr:0 dw:0 dr:106200 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:938596
[= >.] Sync'ed: 10.2% (938596 + 1044124) K.
Finish: 0:00:44 speed: 21104 (21104) K/sec
6 set vm1 to primary
[root@vm1 ~] # drbdsetup / dev/drbd1 primary-- force=yes
[root@vm1 ~] # cat / proc/drbd
Version: 8.4.7-1 (api:1/proto:86-101)
GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11
1: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r-
Ns:105528 nr:0 dw:0 dr:106200 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:938596
[= >.] Sync'ed: 10.2% (938596 + 1044124) K.
Finish: 0:00:44 speed: 21104 (21104) K/sec
[root@vm1 ~] # cat / proc/drbd
Version: 8.4.7-1 (api:1/proto:86-101)
GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11
1: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-
Ns:1044124 nr:0 dw:0 dr:1044796 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
7 set up the file system and mount it.
[root@vm1 ~] # mkfs.ext4 / dev/drbd1
Mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
65280 inodes, 261031 blocks
13051 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs-c or-i to override.
[root@vm1 ~] #
[root@vm1 ~] # mount / dev/drbd1 / drbd/
[root@vm1] # df-h
Filesystem Size Used Avail Use% Mounted on
/ dev/sda3 19G 9.7G 7.9G 56% /
Tmpfs 246m 0 246m 0% / dev/shm
/ dev/sda1 190M 53M 128m 30% / boot
/ dev/drbd1 988M 1.3M 936M1 / drbd
8 mount test
On vm1:
[root@vm1 ~] # cd / drbd/
[root@vm1 drbd] # touch aa
[root@vm1 drbd] # umount / drbd/
Umount: / drbd: device is busy.
(In some cases useful info about processes that use
The device is found by lsof (8) or fuser (1))
[root@vm1 drbd] # cd
[root@vm1 ~] # cd
[root@vm1 ~] # umount / drbd/
[root@vm1 ~] # drbdadm secondary db
[root@vm1 ~] # cat / proc/drbd
Version: 8.4.7-1 (api:1/proto:86-101)
GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11
1: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r-
Ns:1077352 nr:0 dw:33228 dr:1045509 al:10 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
[root@vm1 ~] #
Switch to vm2 to verify:
[root@vm2 dev] # drbdadm primary db
[root@vm2 dev] # cat / proc/drbd
Version: 8.4.7-1 (api:1/proto:86-101)
GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11
1: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-
Ns:0 nr:1077352 dw:1077352 dr:672 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
[root@vm2 dev] # mkdir / drbd
[root@vm2 dev] # mount / dev/drbd1 / drbd/
[root@vm2 dev] # cd / drbd/
[root@vm2 drbd] # ls
Aa lost+found
[root@vm2 drbd] #
9 switch back to vm1:
Switch and set vm1 to be primary:
[root@vm2 ~] # umount / drbd/
[root@vm2 ~] # drbdadm secondary db
[root@vm2 ~] # cat / proc/drbd
Version: 8.4.7-1 (api:1/proto:86-101)
GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11
1: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r-
Ns:36 nr:1077352 dw:1077388 dr:1025 al:10 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
[root@vm1 ~] # drbdadm primary db
[root@vm1 ~] # mount / dev/drbd1 / drbd/
[root@vm1 ~] # cat / proc/drbd
Version: 8.4.7-1 (api:1/proto:86-101)
GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11
1: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-
Ns:1077356 nr:36 dw:33268 dr:1046530 al:10 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
10 configure heartbeat.
[root@vm1 ~] # cp / usr/share/doc/heartbeat-2.1.3/haresources / etc/ha.d/
[root@vm1 ~] # cp / usr/share/doc/heartbeat-2.1.3/ha.cf / etc/ha.d/
[root@vm1 ~] # cp / usr/share/doc/heartbeat-2.1.3/authkeys / etc/ha.d/
[root@vm1 ~] # chmod 600 / etc/ha.d/authkeys
VIP 10.0.0.20
Set the communication key
[root@vm1 ~] # cat / etc/ha.d/authkeys | egrep-v "^ #"
Auth 3
3 md5 Hello!
Create a heartbeat profile
[root@vm1 ~] # grep-v "^ #" / etc/ha.d/ha.cf
Debugfile / var/log/ha-debug
Logfile / var/log/ha-log
Logfacility local0
Keepalive 2
Deadtime 5
Warntime 5
Initdead 120
Ucast eth0 10.0.0.12
Auto_failback off
Node vm1
Node vm2
Ping 10.0.0.1
Create mysql management scripts for simple illustration only
[root@vm1 ~] # cat / etc/ha.d/resource.d/manage_mysql
#! / bin/bash
Case $1 in
'start')
/ usr/local/mysql/bin/mysqld_safe-defaults-file=/drbd/mysql3307/my.cnf &
'stop')
If [[`ps-ef | grep mysqld | wc-l`
< 2 ]] ; then exit else mysqladmin -S /tmp/mysql3307.sock shutdown fi ;; *) ;; esac [root@vm1 ~]# chmod +x /etc/ha.d/resource.d/manage_mysql 定义heartbeat管理资源 [root@vm1 ~]# grep -v "^#" /etc/ha.d/haresources vm1 IPaddr::10.0.0.20 drbddisk::db Filesystem::/dev/drbd1::/drbd::ext4 manage_mysql [root@vm1 ~]# scp -r /etc/ha.d/ vm2:/etc 修改vm2的/etc/ha.d/ha.cf内容如下 [root@vm2 ha.d]# grep -v "^#" /etc/ha.d/ha.cf debugfile /var/log/ha-debug logfile /var/log/ha-log logfacility local0 keepalive 2 deadtime 5 warntime 5 initdead 120 ucast eth0 10.0.0.11 auto_failback off node vm1 node vm2 ping 10.0.0.1 11 启动验证 先启动DRBD [root@vm1 ~]# /etc/init.d/drbd start [root@vm1 ~]# cat /proc/drbd version: 8.4.7-1 (api:1/proto:86-101) GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11 1: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r----- ns:1452 nr:1148 dw:2600 dr:26342 al:9 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0 [root@vm2 resource.d]# /etc/init.d/drbd start [root@vm2 resource.d]# cat /proc/drbd version: 8.4.7-1 (api:1/proto:86-101) GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11 1: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r----- ns:1412 nr:6112 dw:7524 dr:24838 al:9 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0 启动heartbeat: [root@vm1 ~]# /etc/init.d/heartbeat start Starting High-Availability services: INFO: Resource is stopped Done. [root@vm2 ~]# /etc/init.d/heartbeat start Starting High-Availability services: INFO: Resource is stopped Done. 检查log [root@vm1 ~]# tail -20f /var/log/ha-log Apr 11 17:19:58 vm1 heartbeat: [7734]: info: Pacemaker support: false Apr 11 17:19:58 vm1 heartbeat: [7734]: WARN: Logging daemon is disabled --enabling logging daemon is recommended Apr 11 17:19:58 vm1 heartbeat: [7734]: info: ************************** Apr 11 17:19:58 vm1 heartbeat: [7734]: info: Configuration validated. Starting heartbeat 3.0.4 Apr 11 17:19:58 vm1 heartbeat: [7735]: info: heartbeat: version 3.0.4 Apr 11 17:19:58 vm1 heartbeat: [7735]: info: Heartbeat generation: 1460298765 Apr 11 17:19:58 vm1 heartbeat: [7735]: info: glib: ucast: write socket priority set to IPTOS_LOWDELAY on eth0 Apr 11 17:19:58 vm1 heartbeat: [7735]: info: glib: ucast: bound send socket to device: eth0 Apr 11 17:19:58 vm1 heartbeat: [7735]: info: glib: ucast: set SO_REUSEPORT(w) Apr 11 17:19:58 vm1 heartbeat: [7735]: info: glib: ucast: bound receive socket to device: eth0 Apr 11 17:19:58 vm1 heartbeat: [7735]: info: glib: ucast: set SO_REUSEPORT(w) Apr 11 17:19:58 vm1 heartbeat: [7735]: info: glib: ucast: started on port 694 interface eth0 to 10.0.0.12 Apr 11 17:19:58 vm1 heartbeat: [7735]: info: glib: ping heartbeat started. Apr 11 17:19:58 vm1 heartbeat: [7735]: info: G_main_add_TriggerHandler: Added signal manual handler Apr 11 17:19:58 vm1 heartbeat: [7735]: info: G_main_add_TriggerHandler: Added signal manual handler Apr 11 17:19:58 vm1 heartbeat: [7735]: info: G_main_add_SignalHandler: Added signal handler for signal 17 Apr 11 17:19:58 vm1 heartbeat: [7735]: info: Local status now set to: 'up' Apr 11 17:19:58 vm1 heartbeat: [7735]: info: Link 10.0.0.1:10.0.0.1 up. Apr 11 17:19:58 vm1 heartbeat: [7735]: info: Status update for node 10.0.0.1: status ping Apr 11 17:20:36 vm1 heartbeat: [7735]: info: Link vm2:eth0 up. Apr 11 17:20:36 vm1 heartbeat: [7735]: info: Status update for node vm2: status up harc(default)[7747]: 2016/04/11_17:20:36 info: Running /etc/ha.d//rc.d/status status Apr 11 17:20:37 vm1 heartbeat: [7735]: info: Comm_now_up(): updating status to active Apr 11 17:20:37 vm1 heartbeat: [7735]: info: Local status now set to: 'active' Apr 11 17:20:37 vm1 heartbeat: [7735]: info: Status update for node vm2: status active harc(default)[7768]: 2016/04/11_17:20:37 info: Running /etc/ha.d//rc.d/status status Apr 11 17:20:48 vm1 heartbeat: [7735]: info: remote resource transition completed. Apr 11 17:20:48 vm1 heartbeat: [7735]: info: remote resource transition completed. Apr 11 17:20:48 vm1 heartbeat: [7735]: info: Initial resource acquisition complete (T_RESOURCES(us)) /usr/lib/ocf/resource.d//heartbeat/IPaddr(IPaddr_10.0.0.20)[7821]: 2016/04/11_17:20:48 INFO: Resource is stopped Apr 11 17:20:48 vm1 heartbeat: [7785]: info: Local Resource acquisition completed. harc(default)[7887]: 2016/04/11_17:20:49 info: Running /etc/ha.d//rc.d/ip-request-resp ip-request-resp ip-request-resp(default)[7887]: 2016/04/11_17:20:49 received ip-request-resp IPaddr::10.0.0.20 OK yes ResourceManager(default)[7910]: 2016/04/11_17:20:49 info: Acquiring resource group: vm1 IPaddr::10.0.0.20 drbddisk::db Filesystem::/dev/drbd1::/drbd::ext4 manage_mysql /usr/lib/ocf/resource.d//heartbeat/IPaddr(IPaddr_10.0.0.20)[7938]: 2016/04/11_17:20:49 INFO: Resource is stopped ResourceManager(default)[7910]: 2016/04/11_17:20:49 info: Running /etc/ha.d/resource.d/IPaddr 10.0.0.20 start IPaddr(IPaddr_10.0.0.20)[8034]: 2016/04/11_17:20:49 INFO: Adding inet address 10.0.0.20/24 with broadcast address 10.0.0.255 to device eth0 IPaddr(IPaddr_10.0.0.20)[8034]: 2016/04/11_17:20:49 INFO: Bringing device eth0 up IPaddr(IPaddr_10.0.0.20)[8034]: 2016/04/11_17:20:49 INFO: /usr/libexec/heartbeat/send_arp -i 200 -r 5 -p /var/run/resource-agents/send_arp-10.0.0.20 eth0 10.0.0.20 auto not_used not_used /usr/lib/ocf/resource.d//heartbeat/IPaddr(IPaddr_10.0.0.20)[8020]: 2016/04/11_17:20:49 INFO: Success ResourceManager(default)[7910]: 2016/04/11_17:20:49 info: Running /etc/ha.d/resource.d/drbddisk db start /usr/lib/ocf/resource.d//heartbeat/Filesystem(Filesystem_/dev/drbd1)[8162]: 2016/04/11_17:20:49 INFO: Resource is stopped ResourceManager(default)[7910]: 2016/04/11_17:20:49 info: Running /etc/ha.d/resource.d/Filesystem /dev/drbd1 /drbd ext4 start Filesystem(Filesystem_/dev/drbd1)[8249]: 2016/04/11_17:20:49 INFO: Running start for /dev/drbd1 on /drbd /usr/lib/ocf/resource.d//heartbeat/Filesystem(Filesystem_/dev/drbd1)[8241]: 2016/04/11_17:20:49 INFO: Success ResourceManager(default)[7910]: 2016/04/11_17:20:49 info: Running /etc/ha.d/resource.d/manage_mysql start [root@vm2 ~]# tail -20f /var/log/ha-log Apr 11 17:20:36 vm2 heartbeat: [16250]: info: Pacemaker support: false Apr 11 17:20:36 vm2 heartbeat: [16250]: WARN: Logging daemon is disabled --enabling logging daemon is recommended Apr 11 17:20:36 vm2 heartbeat: [16250]: info: ************************** Apr 11 17:20:36 vm2 heartbeat: [16250]: info: Configuration validated. Starting heartbeat 3.0.4 Apr 11 17:20:36 vm2 heartbeat: [16251]: info: heartbeat: version 3.0.4 Apr 11 17:20:36 vm2 heartbeat: [16251]: info: Heartbeat generation: 1460351868 Apr 11 17:20:36 vm2 heartbeat: [16251]: info: glib: ucast: write socket priority set to IPTOS_LOWDELAY on eth0 Apr 11 17:20:36 vm2 heartbeat: [16251]: info: glib: ucast: bound send socket to device: eth0 Apr 11 17:20:36 vm2 heartbeat: [16251]: info: glib: ucast: set SO_REUSEPORT(w) Apr 11 17:20:36 vm2 heartbeat: [16251]: info: glib: ucast: bound receive socket to device: eth0 Apr 11 17:20:36 vm2 heartbeat: [16251]: info: glib: ucast: set SO_REUSEPORT(w) Apr 11 17:20:36 vm2 heartbeat: [16251]: info: glib: ucast: started on port 694 interface eth0 to 10.0.0.11 Apr 11 17:20:36 vm2 heartbeat: [16251]: info: glib: ping heartbeat started. Apr 11 17:20:36 vm2 heartbeat: [16251]: info: G_main_add_TriggerHandler: Added signal manual handler Apr 11 17:20:36 vm2 heartbeat: [16251]: info: G_main_add_TriggerHandler: Added signal manual handler Apr 11 17:20:36 vm2 heartbeat: [16251]: info: G_main_add_SignalHandler: Added signal handler for signal 17 Apr 11 17:20:36 vm2 heartbeat: [16251]: info: Local status now set to: 'up' Apr 11 17:20:36 vm2 heartbeat: [16251]: info: Link 10.0.0.1:10.0.0.1 up. Apr 11 17:20:36 vm2 heartbeat: [16251]: info: Status update for node 10.0.0.1: status ping Apr 11 17:20:36 vm2 heartbeat: [16251]: info: Link vm1:eth0 up. Apr 11 17:20:37 vm2 heartbeat: [16251]: info: Status update for node vm1: status active Apr 11 17:20:37 vm2 heartbeat: [16251]: info: Comm_now_up(): updating status to active Apr 11 17:20:37 vm2 heartbeat: [16251]: info: Local status now set to: 'active' harc(default)[16261]: 2016/04/11_17:20:37 info: Running /etc/ha.d//rc.d/status status Apr 11 17:20:48 vm2 heartbeat: [16251]: info: local resource transition completed. Apr 11 17:20:48 vm2 heartbeat: [16251]: info: Initial resource acquisition complete (T_RESOURCES(us)) Apr 11 17:20:48 vm2 heartbeat: [16280]: info: No local resources [/usr/share/heartbeat/ResourceManager listkeys vm2] to acquire. Apr 11 17:20:48 vm2 heartbeat: [16251]: info: remote resource transition completed. 检查drbd、磁盘挂载、mysql进程信息: vm1上: [root@vm1 ~]# cat /proc/drbd version: 8.4.7-1 (api:1/proto:86-101) GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11 1: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r----- ns:2004 nr:1148 dw:3152 dr:38227 al:10 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0 [root@vm1 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 19G 11G 7.5G 58% / tmpfs 246M 0 246M 0% /dev/shm /dev/sda1 190M 53M 128M 30% /boot /dev/drbd1 988M 178M 760M 19% /drbd [root@vm1 ~]# ps -ef | grep mysql root 8337 1 0 17:20 ? 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/drbd/mysql3307/my.cnf mysql 8599 8337 0 17:20 ? 00:00:00 /usr/local/mysql/bin/mysqld --defaults-file=/drbd/mysql3307/my.cnf --basedir=/usr/local/mysql --datadir=/drbd/mysql3307 --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/drbd/mysql3307/vm1.err --pid-file=/drbd/mysql3307/vm1.pid --socket=/tmp/mysql3307.sock --port=3307 root 8633 1874 0 17:24 pts/3 00:00:00 grep mysql [root@vm1 ~]# mysql -uroot -pmysql -h20.0.0.20 -P3307 Warning: Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.27-log Source distribution Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>Ctrl-C-exit!
Aborted
On vm2:
[root@vm2 resource.d] # cat / proc/drbd
Version: 8.4.7-1 (api:1/proto:86-101)
GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11
1: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-
Ns:1412 nr:6664 dw:8076 dr:24838 al:9 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
[root@vm2] # df-h
Filesystem Size Used Avail Use% Mounted on
/ dev/sda3 19G 11G 7.5G 58% /
Tmpfs 246m 0 246m 0% / dev/shm
/ dev/sda1 190M 53M 128m 30% / boot
[root@vm2 ~] # ps-ef | grep mysql
Root 16304 11810 0 17:24 pts/2 00:00:00 grep mysql
[root@vm2 resource.d] #
[root@vm2 resource.d] # mysql-uroot-pmysql-h20.0.0.20-P3307
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with; or\ g.
Your MySQL connection id is 2
Server version: 5.6.27-log Source distribution
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.
Mysql > Ctrl-C-- exit!
Aborted
[root@vm2 resource.d] #
Turn off vm1 and simulate the fault:
[root@vm1 ~] # init 0
[root@vm2] # tail-20f / var/log/ha-log
Apr 11 17:27:00 vm2 heartbeat: [16251]: info: Received shutdown notice from 'vm1'.
Apr 11 17:27:00 vm2 heartbeat: [16251]: info: Resources being acquired from vm1.
Apr 11 17:27:00 vm2 heartbeat: [16310]: info: acquire local HA resources (standby).
Apr 11 17:27:00 vm2 heartbeat: [16310]: info: local HA resource acquisition completed (standby).
Apr 11 17:27:00 vm2 heartbeat: [16251]: info: Standby resource acquisition done [all].
Apr 11 17:27:00 vm2 heartbeat: [16311]: info: No local resources [/ usr/share/heartbeat/ResourceManager listkeys vm2] to acquire.
Harc (default) [16336]: 2016 apprentice 04 Universe 11, 17 info 2700 info: Running / etc/ha.d//rc.d/status status
Mach_down (default) [16353]: 2016 apprentice 04 Universe 11, 17 info 2700 info: Taking over resource group IPaddr::10.0.0.20
ResourceManager (default) [16380]: 2016 apprentice 04 plump 11mm 17purl 2700 info: Acquiring resource group: vm1 IPaddr::10.0.0.20 drbddisk::db Filesystem::/dev/drbd1::/drbd::ext4 manage_mysql
/ usr/lib/ocf/resource.d//heartbeat/IPaddr (IPaddr_10.0.0.20) [16408]: 2016 Universe 04 Universe 11, 17 INFO 2700 INFO: Resource is stopped
ResourceManager (default) [16380]: 2016 apperance 04 Universe 11, 17 info 2700 info: Running / etc/ha.d/resource.d/IPaddr 10.0.0.20 start
IPaddr (IPaddr_10.0.0.20) [16504]: 2016 apperance 04 to device eth0 11,1715 2700 INFO: Adding inet address 10.0.0.20 to device eth0 24 with broadcast address 10.0.0.255
IPaddr (IPaddr_10.0.0.20) [16504]: 2016 apprentice 04 Universe 11, 17 purl 2700 INFO: Bringing device eth0 up
IPaddr (IPaddr_10.0.0.20) [16504]: 2016 INFO: / usr/libexec/heartbeat/send_arp-I 200-r 5-p / var/run/resource-agents/send_arp-10.0.0.20 eth0 10.0.0.20 auto not_used not_used
/ usr/lib/ocf/resource.d//heartbeat/IPaddr (IPaddr_10.0.0.20) [16490]: 2016 Universe 04 Universe 11, 17 INFO 2700 INFO: Success
ResourceManager (default) [16380]: 2016 apprentice 04 Universe 11, 17 info 2700 info: Running / etc/ha.d/resource.d/drbddisk db start
/ usr/lib/ocf/resource.d//heartbeat/Filesystem (Filesystem_/dev/drbd1) [16632]: 2016 INFO 04 INFO: Resource is stopped
ResourceManager (default) [16380]: 2016 etc/ha.d/resource.d/Filesystem / dev/drbd1 / drbd ext4 start
Filesystem (Filesystem_/dev/drbd1) [16719]: 2016 apperance 04 Universe 11, 17 INFO 27 INFO: Running start for / dev/drbd1 on / drbd
/ usr/lib/ocf/resource.d//heartbeat/Filesystem (Filesystem_/dev/drbd1) [16711]: 2016 INFO 04 INFO: Success
ResourceManager (default) [16380]: 2016 apprentice 04 Universe 11, 17 purl 27 info 01 info: Running / etc/ha.d/resource.d/manage_mysql start
Mach_down (default) [16353]: 2016 info: / usr/share/heartbeat/mach_down: nice_failback: foreign resources acquired
Mach_down (default) [16353]: 2016 apperance 04 Unip. 11, 17 info 27 info: mach_down takeover complete for node vm1.
Apr 11 17:27:01 vm2 heartbeat: [16251]: info: mach_down takeover complete.
Apr 11 17:27:07 vm2 heartbeat: [16251]: WARN: node vm1: is dead
Apr 11 17:27:07 vm2 heartbeat: [16251]: info: Dead node vm1 gave up resources.
Apr 11 17:27:07 vm2 heartbeat: [16251]: info: Link vm1:eth0 dead.
[root@vm2 ~] # ps-ef | grep mysql
Root 16808 1 0 17:27? 00:00:00 / bin/sh / usr/local/mysql/bin/mysqld_safe-- defaults-file=/drbd/mysql3307/my.cnf
Mysql 17085 16808 0 17:27 00:00:00 / usr/local/mysql/bin/mysqld-- defaults-file=/drbd/mysql3307/my.cnf-- basedir=/usr/local/mysql-- datadir=/drbd/mysql3307-- plugin-dir=/usr/local/mysql/lib/plugin-- user=mysql-- log-error=/drbd/mysql3307/vm2.err-- pid-file=/drbd/mysql3307/vm2.pid-- socket=/tmp/mysql3307.sock-- port=3307
Root 17112 11810 0 17:28 pts/2 00:00:00 grep mysql
[root@vm2 ~] # cat / proc/drbd
Version: 8.4.7-1 (api:1/proto:86-101)
GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11
1: cs:WFConnection ro:Primary/Unknown ds:UpToDate/DUnknown C r-
Ns:1820 nr:6856 dw:8760 dr:36747 al:10 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:84
[root@vm2] # df-h
Filesystem Size Used Avail Use% Mounted on
/ dev/sda3 19G 11G 7.5G 58% /
Tmpfs 246m 0 246m 0% / dev/shm
/ dev/sda1 190M 53M 128m 30% / boot
/ dev/drbd1 988M 178M 760M 19% / drbd
[root@vm2 ~] # ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN
Link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
Inet 127.0.0.1/8 scope host lo
Inet6:: 1/128 scope host
Valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000
Link/ether 08:00:27:9b:2c:f6 brd ff:ff:ff:ff:ff:ff
Inet 10.0.0.12/24 brd 10.0.0.255 scope global eth0
Inet 10.0.0.20/24 brd 10.0.0.255 scope global secondary eth0
Inet6 fe80::a00:27ff:fe9b:2cf6/64 scope link
Valid_lft forever preferred_lft forever
[root@vm2] # mysql-uroot-pmysql-h20.0.0.20-P3307
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with; or\ g.
Your MySQL connection id is 1
Server version: 5.6.27-log Source distribution
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.
Mysql >
VIP, disk resources, and mysql processes are all on vm2.
Finish it!
# #
Postscript
Resource file configuration explanation:
[root@vm1 ~] # grep-v "^ #" / etc/ha.d/haresources
Vm1 IPaddr::10.0.0.20 drbddisk::db Filesystem::/dev/drbd1::/drbd::ext4 manage_mysql
The hostname of the vm1 master server, followed by resources managed by heartbeat.
IPaddr::10.0.0.20 VIP
Drbddisk::db DRBD resource. Db is the name of resource in drbd.conf.
The file system, mount point, and file type that Filesystem::/dev/drbd1::/drbd::ext4 needs to mount
The manage_mysql system or self-defined resource management file needs to be able to match the start\ stop parameter. Generally located in / etc/init.d or / etc/ha.d/resource.d directory
I wrote this manage_mysql myself.
After the / etc/init.d/heartbeat start command is executed, the / var/log/ha-log content of the primary node is as follows:
ResourceManager (default) [2006]: 2016 apperance 04 Unip 11: 18 18 purl 05 purl 35 info: Acquiring resource group: vm1 IPaddr::10.0.0.20 drbddisk::db Filesystem::/dev/drbd1::/drbd::ext4 manage_mysql
/ usr/lib/ocf/resource.d//heartbeat/IPaddr (IPaddr_10.0.0.20) [2052]: 2016 Unip 04 Unip 11 18 purl 05 purl 35 INFO: Resource is stopped
/ usr/lib/ocf/resource.d//heartbeat/IPaddr (IPaddr_10.0.0.20) [2061]: 2016 Unip 04 Unip 11 18 purl 05 purl 35 INFO: Resource is stopped
Apr 11 18:05:35 vm1 heartbeat: [1980]: info: Local Resource acquisition completed.
ResourceManager (default) [2006]: 2016 apperance 04 Universe 11: 18 purl 05 purl 35 info: Running / etc/ha.d/resource.d/IPaddr 10.0.0.20 start
IPaddr (IPaddr_10.0.0.20) [2218]: 2016 with broadcast address 04 with broadcast address 11: 18 18 with broadcast address 05 purl 35 INFO: Adding inet address 10.0.0.20 to device eth0 24 Unip 10.0.0.255
IPaddr (IPaddr_10.0.0.20) [2218]: 2016 Unip 04 Unip 11 INFO: Bringing device eth0 up 18 purl 05 purl 35
IPaddr (IPaddr_10.0.0.20) [2218]: 2016 var/run/resource-agents/send_arp-10.0.0.20 eth0 04 Universe 11 18 INFO: / usr/libexec/heartbeat/send_arp-I 200-r 5-p / var/run/resource-agents/send_arp-10.0.0.20 eth0 10.0.0.20 auto not_used not_used
/ usr/lib/ocf/resource.d//heartbeat/IPaddr (IPaddr_10.0.0.20) [2204]: 2016 Unip 04 Unip 11 18 purl 05 purl 35 INFO: Success
ResourceManager (default) [2006]: 2016, Running / etc/ha.d/resource.d/drbddisk db start, 11, 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 18, 15, 18, 18, 15, 18, 18, 15, 18, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 18, 15, 18, 18, 15, 18, 18, 15, 18, 18, 15, 18, 18, 15, 18, 05, 15, 15, 15, 35, info: Running / etc/ha.d/resource.d/drbddisk db start.
/ usr/lib/ocf/resource.d//heartbeat/Filesystem (Filesystem_/dev/drbd1) [2348]: 2016 Unip 04 Unip 11 18 purl 05 purl 35 INFO: Resource is stopped
ResourceManager (default) [2006]: 2016 etc/ha.d/resource.d/Filesystem / etc/ha.d/resource.d/Filesystem / dev/drbd1 / drbd ext4 start
Filesystem (Filesystem_/dev/drbd1) [2434]: 2016, dev/drbd1 on / dev/drbd1 on, 2016, 11, 18, 18, 18, 05, 15, 15, 35, INFO: Running start for / dev/drbd1 on / drbd
/ usr/lib/ocf/resource.d//heartbeat/Filesystem (Filesystem_/dev/drbd1) [2426]: 2016 Unip 04 Unip 11 18 purl 05 purl 35 INFO: Success
ResourceManager (default) [2006]: 2016, Running / etc/ha.d/resource.d/manage_mysql start, 11, 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 18, 15, 18, 18, 15, 18, 18, 15, 18, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 18, 15, 18, 18, 15, 18, 18, 15, 18, 18, 15, 18, 18, 15, 18, 05, 15, 15, 15, 35, info: Running / etc/ha.d/resource.d/manage_mysql start.
Apr 11 18:05:35 vm1 heartbeat: [1979]: info: all HA resource acquisition completed (standby).
Apr 11 18:05:35 vm1 heartbeat: [1590]: info: Standby resource acquisition done [all].
Harc (default) [2523]: 2016, Running / etc/ha.d//rc.d/status status, 11, 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 18, 15, 18, 18, 15, 18, 18, 15, 18, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 15, 18, 18, 15, 18, 18, 15, 18, 18, 15, 18, 18, 15, 18, 18, 15, 18, 05, 15, 15, 15, 35, info: Running / etc/ha.d//rc.d/status status.
Mach_down (default) [2560]: 2016 nice_failback 04 nice_failback: 201618 18 purl 05 purl 35 info: / usr/share/heartbeat/mach_down:
Mach_down (default) [2560]: 2016 apprentice 04 Unip 11: 18 18 purl 05 purl 36 info: mach_down takeover complete for node vm2.
Apr 11 18:05:36 vm1 heartbeat: [1590]: info: mach_down takeover complete.
Harc (default) [2626]: 2016, Running / etc/ha.d//rc.d/ip-request-resp ip-request-resp, 11, 18, 18, 18, 05, 15, 15, 15, 15, 36, 14, 18, 18, 18, 18, 15, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 05, 36, info: Running / etc/ha.d//rc.d/ip-request-resp ip-request-resp
Ip-request-resp (default) [2626]: 2016 Apex 04 Unip 11 received ip-request-resp IPaddr::10.0.0.20 OK yes 18 purl 05 purl 36 received ip-request-resp IPaddr::10.0.0.20 OK yes
ResourceManager (default) [2680]: 2016 apperance 04 Unip 11 18 purl 05 purl 36 info: Acquiring resource group: vm1 IPaddr::10.0.0.20 drbddisk::db Filesystem::/dev/drbd1::/drbd::ext4 manage_mysql
/ usr/lib/ocf/resource.d//heartbeat/IPaddr (IPaddr_10.0.0.20) [2741]: 2016 INFO 04 INFO: Running OK
/ usr/lib/ocf/resource.d//heartbeat/Filesystem (Filesystem_/dev/drbd1) [2929]: 2016 INFO 04 INFO: Running OK
ResourceManager (default) [2680]: 2016, Running / etc/ha.d/resource.d/manage_mysql start, 11, 18, 18, 18, 05, 15, 15, 15, 15, 36, 14, 18, 18, 18, 18, 15, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 05, 36, info: Running / etc/ha.d/resource.d/manage_mysql start
Apr 11 18:05:41 vm1 heartbeat: [1590]: WARN: node vm2: is dead
Apr 11 18:05:41 vm1 heartbeat: [1590]: info: Dead node vm2 gave up resources.
Apr 11 18:05:41 vm1 heartbeat: [1590]: info: Link vm2:eth0 dead.
# # #
After the primary node executes the / etc/init.d/heartbeat stop command, the / var/log/ha-log content is as follows:
ResourceManager (default) [17275]: 2016, Running / etc/ha.d/resource.d/manage_mysql stop, 11, 18, 18, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 15, 18, 18, 18, 18, 18, 18, 18, 18, 31, info: Running / etc/ha.d/resource.d/manage_mysql stop.
ResourceManager (default) [17275]: 2016 etc/ha.d/resource.d/Filesystem / etc/ha.d/resource.d/Filesystem / dev/drbd1 / drbd ext4 stop
Filesystem (Filesystem_/dev/drbd1) [17343]: 2016 dev/drbd1 on / dev/drbd1 on / drbd
Filesystem (Filesystem_/dev/drbd1) [17343]: 2016, Trying to unmount / drbd, 11, 18, 18, 18, 05, 15, 15, 33, 15, 33, 18, 18, 33, 18, 18, 33, 33, Trying to unmount / drbd.
Filesystem (Filesystem_/dev/drbd1) [17343]: 2016, unmounted / drbd successfully, 11, 18, 18, 18, 05, 15, 15, 33, 15, 33, 18, 18, 33, 18, 18, 33, 33, unmounted / drbd successfully.
/ usr/lib/ocf/resource.d//heartbeat/Filesystem (Filesystem_/dev/drbd1) [17335]: 2016 INFO 04 INFO: Success
ResourceManager (default) [17275]: 2016, Running / etc/ha.d/resource.d/drbddisk db stop, 11, 18, 18, 18, 05, 15, 15, 33, 15, 33, 18, 18, 33, 18, 18, 33, 33, Running / etc/ha.d/resource.d/drbddisk db stop.
ResourceManager (default) [17275]: 2016 apperance 04 etc/ha.d/resource.d/IPaddr 11 018 info 05 Running / etc/ha.d/resource.d/IPaddr 10.0.0.20 stop
IPaddr (IPaddr_10.0.0.20) [17492]: 2016, ok, IP_CIP=, 2011, 18, 18, 18, 05, 15, 15, 34, INFO: IP status = ok, IP_CIP=.
/ usr/lib/ocf/resource.d//heartbeat/IPaddr (IPaddr_10.0.0.20) [17473]: 2016 INFO 04 Unip 11 18 purl 05 purl 34 INFO: Success
Apr 11 18:05:34 vm2 heartbeat: [17262]: info: All HA resources relinquished.
Apr 11 18:05:35 vm2 heartbeat: [16251]: WARN: 1 lost packet (s) for [vm1] [64:66]
Apr 11 18:05:35 vm2 heartbeat: [16251]: info: No pkts missing from vm1!
Apr 11 18:05:36 vm2 heartbeat: [16251]: info: killing HBFIFO process 16254 with signal 15
Apr 11 18:05:36 vm2 heartbeat: [16251]: info: killing HBWRITE process 16255 with signal 15
Apr 11 18:05:36 vm2 heartbeat: [16251]: info: killing HBREAD process 16256 with signal 15
Apr 11 18:05:36 vm2 heartbeat: [16251]: info: killing HBWRITE process 16257 with signal 15
Apr 11 18:05:36 vm2 heartbeat: [16251]: info: killing HBREAD process 16258 with signal 15
Apr 11 18:05:36 vm2 heartbeat: [16251]: info: Core process 16254 exited. 5 remaining
Apr 11 18:05:36 vm2 heartbeat: [16251]: info: Core process 16256 exited. 4 remaining
Apr 11 18:05:36 vm2 heartbeat: [16251]: info: Core process 16255 exited. 3 remaining
Apr 11 18:05:36 vm2 heartbeat: [16251]: info: Core process 16258 exited. 2 remaining
Apr 11 18:05:36 vm2 heartbeat: [16251]: info: Core process 16257 exited. 1 remaining
Apr 11 18:05:36 vm2 heartbeat: [16251]: info: vm2 Heartbeat shutdown complete.
You can see that at startup, the resources are executed from front to back in the order defined in the haresources file.
When closed, resources are released from back to front in the order defined in the haresources file.
This is the end of "how to build Heartbeat+DRBD+MySQL". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.