In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Heartbeat 3.0.4-drbd 8.9-MySQL 5.6Synergy: first of all, heartbeat, as a highly available control role, is responsible for mounting the drbd storage service directory. (here, the startup of drbd is automatically started with the host.
Started, its function is to synchronize a local disk of the primary node with a disk of the standby node at the opposite end, and to ensure that the data in the data disk related to the host drbd on both sides are completely the same), and the storage directory of drbd is only mounted and read on the master node.
Write, while the standby remains unavailable; when heartbeat finishes mounting the drbd storage directory, start the mysql database, and heartbeat is responsible for checking the status of drbd storage and mysql service. When the service is abnormal, the resource is transferred through the timeout mechanism.
Start in the standby machine, so as to achieve the purpose of high availability of mutual backup between mysql computers.
Prerequisites:
Complete the installation and configuration of linux-ha heartbeat according to the blog post on the highly available installation configuration of heartbeat (http service is highly available)
Follow the blog post MySQL 5.6 for REHL 6.4 to compile and install mysql to complete the installation and configuration.
Heartbeat installation reference log: linux-ha heartbeat high availability-http service-based installation configuration mysql compilation installation reference log: MySQL installation method-MySQL compilation installation 1. Installation and configuration of DRBD software
Host name
Mymongo1
Arbiter
Manage IP
Eth0:192.168.199.131
Eth0:192.168.199.134
DRBD Management name
/ data
/ data
DRBD logic device
/ dev/drbd0
/ dev/drbd0
DRBD docking IP
Eth2:192.168.144.132
Eth2:192.168.144.111
DRBD storage device
/ dev/sdb1
/ dev/sdb1
DRBD META equipment
/ dev/sdb2 [0]
/ dev/sdb2 [0]
Virtual IP
Eth2:192.168.144.122
Eth2:192.168.144.122
1. Two vmware linux virtual machines arbiter and mymongo1 (two hosts need to add a new virtual hard disk sdb), basic information mymongo1 [root@mymongo1 ~] # hostname mymongo1 [root@mymongo1 ~] # uname-a Linux mymongo1 2.6.32-642.el6.x86_64 # 1 SMP Tue May 10 17:27:01 UTC 2016 x86 "64 GNU/Linux [root@mymongo1 ~] # fdisk-l
Disk / dev/sdb: 2147 MB, 2147483648 bytes 255heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I logical/physical O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
Disk / dev/sda: 21.5GB, 21474836480 bytes 255heads, 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: 0x00061eae
Device Boot Start End Blocks Id System / dev/sda1 * 1 39 307200 83 Linux Partition 1 does not end on cylinder boundary. / dev/sda2 39 2350 18566144 83 Linux / dev/sda3 2350 2611 2097152 82 Linux swap / Solaris [root@mymongo1] # cat / etc/redhat-release CentOS release 6.8 (Final) [root@mymongo1] #
Arbiter [root@arbiter ~] # uname-a Linux arbiter 2.6.32-358.el6.x86_64 # 1 SMP Tue Jan 29 11:47:41 EST 2013 x 86 "64 GNU/Linux [root@arbiter ~] # hostname arbiter [root@arbiter ~] # cat / etc/redhat-release Red Hat Enterprise Linux Server release 6.4 (Santiago) [root@arbiter ~] # fdisk-l
Disk / dev/sda: 21.5GB, 21474836480 bytes 255heads, 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: 0x00078b06
Device Boot Start End Blocks Id System / dev/sda1 * 1 39 307200 83 Linux Partition 1 does not end on cylinder boundary. / dev/sda2 39 549 4096000 82 Linux swap / Solaris Partition 2 does not end on cylinder boundary. / dev/sda3 549 2611 16567296 83 Linux
Disk / dev/sdb: 2147 MB, 2147483648 bytes 255heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I logical/physical O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
[root@arbiter ~] #
2. Adjust the partition table of sdb virtual disk of 2 virtual machines [root@arbiter ~] # parted / dev/sdb mklabel gpt Information: You may need to update / etc/fstab. [root@arbiter ~] #
[root@mymongo1] # parted / dev/sdb mklabel gpt Information: You may need to update / etc/fstab. [root@mymongo1 ~] #
3. 2 virtual machines sdb (2 G in total) are partitioned into 2 partitions, one partition is G [root@mymongo1 ~] # parted / dev/sdb mkpart primary 0 1024 Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? Ignore Information: You may need to update / etc/fstab. [root@mymongo1] # [root@mymongo1] # parted / dev/sdb mkpart primary 1025 2146 Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? Ignore Information: You may need to update / etc/fstab. [root@mymongo1 ~] # parted / dev/sdb p Model: VMware, VMware Virtual S (scsi) Disk / dev/sdb: 2147MB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 17.4kB 1024MB 1024MB primary 2 1025MB 2146MB 1121MB primary [root@mymongo1 ~] #
[root@arbiter ~] # parted / dev/sdb mkpart primary 0 1024 Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? Ignore Information: You may need to update / etc/fstab. [root@arbiter ~] # parted / dev/sdb mkpart primary 1025 2146 Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? Ignore Information: You may need to update / etc/fstab. [root@arbiter ~] # parted / dev/sdb p Model: VMware, VMware Virtual S (scsi) Disk / dev/sdb: 2147MB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 17.4kB 1024MB 1024MB primary 2 1025MB 2146MB 1121MB primary [root@arbiter ~] #
4, 2 virtual machines install drbd, install through network yum Ensure that the two hosts can be connected to the Internet [root@arbiter] # wget ftp.scientificlinux.org/linux/scientific/6.9/x86_64/os/Packages/elrepo-release-6-6.el6.elrepo.noarch.rpm-- 2017-08-23 23 wget ftp.scientificlinux.org/linux/scientific/6.9/x86_64/os/Packages/elrepo-release-6 1415 54muri-http://ftp.scientificlinux.org/linux/scientific/6.9/x86_64/os/Packages/elrepo-release-6-6.el6.elrepo.noarch.rpm Resolving ftp.scientificlinux.org... 131.225.105.11 Connecting to ftp.scientificlinux.org | 131.225.105.11 |: 80. Connected. HTTP request sent, awaiting response... 200 OK Length: 7464 (7.3K) [application/x-rpm] Saving to:? .lrepo-release-6-6.el6.elrepo.noarch.rpm?
100% [= = >] 7464 -.-K in s 0.01s
2017-08-23 23:14:56 (544 KB/s)-.lrepo-release-6-6.el6.elrepo.noarch.rpm?.saved [7464 Accord 7464]
[root@arbiter] # ls anaconda-ks.cfg Documents heartbeat mysql-5.6.36 Public test cmake-2.8.10.2 Downloads install.log mysql-5.6.36.tar rpms Videos cmake-2.8.10.2.tar elrepo-release-6-6.el6.elrepo.noarch.rpm install.log.syslog Pictures select Desktop epel-release-6-8.noarch.rpm Music pkg Templates [root@arbiter] # rpm-ivh elrepo-release-6-6.el6.elrepo.noarch. Rpm warning: elrepo-release-6-6.el6.elrepo.noarch.rpm: Header V4 DSA/SHA1 Signature Key ID 192a7d7d: NOKEY Preparing... # [100%] 1:elrepo-release # [root@arbiter] # [root@arbiter ~] # ls anaconda- Ks.cfg Downloads install.log mysql-5.6.36.tar select cmake-2.8.10.2 drbd84-utils-8.9.8-1.el6.elrepo.x86_64.rpm install.log.syslog Pictures Templates cmake-2.8.10.2.tar elrepo-release-6-6.el6.elrepo.noarch.rpm kmod-drbd84-8.4.9-1.el6.elrepo.x86_64.rpm pkg test Desktop epel-release-6-8.noarch.rpm Music Public Videos Documents heartbeat Mysql-5.6.36 rpms [root@arbiter ~] # rpm-ivh drbd84-utils-8.9.8-1.el6.elrepo.x86_64.rpm warning: drbd84-utils-8.9.8-1.el6.elrepo.x86_64.rpm: Header V4 DSA/SHA1 Signature Key ID baadae52: NOKEY Preparing... # [100%] 1:drbd84-utils # [100%] [root@arbiter] # [root@arbiter yum.repos.d] # ls elrepo.repo epel-testing.repo local.repo [root@arbiter yum.repos.d] # [root@arbiter yum.repos.d] # cat local.repo [local] name = local baseurl= file:///mnt/ enabled = 1 gpgcheck = 0 gpgkey = file://mnt/RPM-GPG-KEY-CentOS-6 [root@arbiter yum.repos.d] # [root@arbiter ~] # yum install-y kmod-drbd84-8.4.9-1.el6.elrepo.x86_64.rpm Loaded plugins: product-id Refresh-packagekit, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Elrepo | 2.92.9 kB 00:00 elrepo/primary_db | 692kB 00:12 Setting up Install Process Examining kmod-drbd84-8.4.9-1.el6.elrepo.x86_64.rpm: kmod-drbd84-8.4.9-1.el6.elrepo.x86_64 Marking kmod-drbd84-8.4.9-1.el6.elrepo.x86_64.rpm to be installed Resolving Dependencies-- > Running transaction check-- > Package kmod-drbd84.x86_64 0elrepo/primary_db 8.4.9-1 .el6.elrepo will be installed-- > Processing Dependency: kernel (_ dynamic_dev_dbg) = 0x4b1a6158 for package: kmod-drbd84-8.4.9-1.el6.elrepo.x86_64-- > Processing Dependency: kernel (dev_printk) = 0xabd7b07b for package: kmod-drbd84-8.4.9-1.el6.elrepo.x86_64-- > Finished Dependency Resolution Error: Package: kmod-drbd84-8.4.9-1.el6.elrepo.x86_64 (/ kmod-drbd84-8. 4.9-1.el6.elrepo.x86_64) Requires: kernel (_ dynamic_dev_dbg) = 0x4b1a6158 Error: Package: kmod-drbd84-8.4.9-1.el6.elrepo.x86_64 (/ kmod-drbd84-8.4.9-1.el6.elrepo.x86_64) Requires: kernel (dev_printk) = 0xabd7b07b You could try using-- skip-broken to work around the problem * * Found 3 pre-existing rpmdb problem (s) 'yum check' output follows: 2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of libmysqlclient.so.16 () (64bit) 2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of libmysqlclient.so.16 (libmysqlclient_16) (64bit) 2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of mysql-libs [root@arbiter ~] # rpm-qa | grep kmod -drbd84 [root@arbiter ~] # yum install-y kmod-drbd84-8.4.9-1.el6.elrepo.x86_64.rpm Loaded plugins: product-id Refresh-packagekit, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Elrepo | 2.9 kB 00:00 elrepo/primary_db | 692kB 00:10 local | 4.0 kB 00:00. Local/primary_db | 4.7 MB 00:00... Setting up Install Process Examining kmod-drbd84-8.4.9-1.el6.elrepo.x86_64.rpm: kmod-drbd84-8.4.9-1.el6.elrepo.x86_64 Marking kmod-drbd84-8.4.9-1.el6.elrepo.x86_64.rpm to be installed Resolving Dependencies-- > Running transaction check-- > Package kmod-drbd84.x86_64 0pur8.4.9-1.el6.elrepo will be installed-- > Processing Dependency: kernel (_ _ dynamic_dev) _ dbg) = 0x4b1a6158 for package: kmod-drbd84-8.4.9-1.el6.elrepo.x86_64-- > Processing Dependency: kernel (dev_printk) = 0xabd7b07b for package: kmod-drbd84-8.4.9-1.el6.elrepo.x86_64-- > Running transaction check-- > Package kernel.x86_64 0pur2.6.32-642.el6 will be installed-> Processing Dependency: kernel-firmware > = 2.6.32-642.el6 for package: kernel-2.6 .32-642.el6.x86_64-- > Processing Dependency: dracut-kernel > = 004-388.el6 for package: kernel-2.6.32-642.el6.x86_64-- > Running transaction check-- > Package dracut-kernel.noarch 0VOV 004-303.el6 will be updated-> Package dracut-kernel.noarch 0RV 004-409.el6 will be an update-> Processing Dependency: dracut = 004-409.el6 for package: dracut-kernel-004-409.el6.noarch > Package kernel-firmware.noarch 0Package kernel-firmware.noarch 2.6.32-358.el6 will be updated-> Package kernel-firmware.noarch 0Package kernel-firmware.noarch 2.6.32-- 642.el6 will be an update-- > Running transaction check-> Package dracut.noarch 0buret 004-303.el6 will be updated-> Package dracut.noarch 0rig 004-409.el6 will be an update-- > Processing Conflict: kernel-2.6.32-642.el6.x86_64 conflicts bfa-firmware
< 3.2.21.1-2 -->Restarting Dependency Resolution with new changes. -- > Running transaction check-- > Package bfa-firmware.noarch 0VOR 3.0.3.1-1.el6 will be updated-> Package bfa-firmware.noarch 0RV 3.2.23.0-2.el6 will be an update-- > Finished Dependency Resolution
Dependencies Resolved
= Package Arch Version Repository Size = Installing: kmod-drbd84 x86 * 64 8.4.9-1.el6.elrepo / kmod-drbd84-8.4.9-1.el6.elrepo.x86_64 696k Updating: bfa-firmware noarch 3.2.23.0-2.el6 local 3.2 M Installing for dependencies: kernel x86 * 64 2.6.32-642.el6 local 32 M Updating for dependencies: dracut noarch 004-409.el6 local 127k dracut-kernel noarch 004-409.el6 local 28k kernel-firmware noarch 2.6.32-642.el6 local 28m
Transaction Summary = Install 2 Package (s) Upgrade 4 Package (s)
Total size: 64 M Total download size: 63 M Downloading Packages:- -- Total 93 MB/s | 63 MB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. * * Found 3 pre-existing rpmdb problem (s) 'yum check' output follows: 2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of libmysqlclient.so.16 () (64bit) 2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of libmysqlclient.so.16 (libmysqlclient_16) (64bit) 2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of mysql-libs Updating: kernel-firmware-2.6.32 -642.el6.noarch 1 642.el6.x86_64 10 Updating: dracut-004-409.el6.noarch 2 642.el6.x86_64 10 Updating: dracut-kernel-004-409.el6.noarch 3 642.el6.x86_64 10 Installing: kernel-2.6.32-642.el6.x86_64 4 Installing: kmod-drbd84-8.4.9-1.el6.elrepo.x86_64 5 642.el6.x86_64 10 Working. This may take some time... Done. Updating: bfa-firmware-3.2.23.0-2.el6.noarch 6 Cleanup 10 Cleanup: dracut-kernel-004-303.el6.noarch 7 Cleanup 10 Cleanup: dracut-004-303.el6.noarch 8 Cleanup: kernel-firmware-2.6.32-358.el6.noarch 9 Cleanup 10 Cleanup: bfa-firmware-3.0.3.1-1.el6.noarch 10 Verifying: dracut-kernel-004-409.el6.noarch 1 shock 10 Verifying: dracut-004-409.el6. Noarch 2 642.el6.noarch 10 Verifying: kmod-drbd84-8.4.9-1.el6.elrepo.x86_64 3 642.el6.noarch 10 Verifying: bfa-firmware-3.2.23.0-2.el6.noarch 4 642.el6.noarch 10 Verifying: kernel-firmware-2.6.32-642.el6.noarch 5 642.el6.noarch 10 Verifying: kernel-2.6.32-642.el6.x86_64 6 642.el6.noarch 10 Verifying: dracut-kernel-004-303.el6.noarch 7 642.el6.noarch 10 Verifying: dracut-004-303.el6.noarch 8 10 Verifying: kernel-firmware-2.6.32-358.el6.noarch 9 Compact 10 Verifying: bfa-firmware-3.0.3.1-1.el6.noarch 10 Universe 10
Installed: kmod-drbd84.x86_64 0virtual 8.4.9-1.el6.elrepo
Dependency Installed: kernel.x86_64 0virtual 2.6.32-642.el6
Updated: bfa-firmware.noarch 0virtual 3.2.23.0-2.el6
Dependency Updated: dracut.noarch 0VOU004-409.el6 dracut-kernel.noarch 0VOUL004-409.el6 kernel-firmware.noarch 0ROR 2.6.32-642.el6
Complete! [root@arbiter ~] #
[root@mymongo1 drbd] # wget ftp.scientificlinux.org/linux/scientific/6.9/x86_64/os/Packages/elrepo-release-6-6.el6.elrepo.noarch.rpm-- 2017-08-23 2315 http://ftp.scientificlinux.org/linux/scientific/6.9/x86_64/os/Packages/elrepo-release-6-6.el6.elrepo.noarch.rpm Resolving ftp.scientificlinux.org... 131.225.105.11 Connecting to ftp.scientificlinux.org | 131.225.105.11 |: 80. Connected. HTTP request sent, awaiting response... 200 OK Length: 7464 (7.3K) [application/x-rpm] Saving to:? .lrepo-release-6-6.el6.elrepo.noarch.rpm?
100% [= = >] 7464 -.-K in s 0s
2017-08-23 23:15:16 (223 MB/s)-.lrepo-release-6-6.el6.elrepo.noarch.rpm?.saved [7464 MB/s]-- installation of mymongo1 node drbd [root@mymongo1 drbd] # ls elrepo-release-6-6.el6.elrepo.noarch.rpm [root@mymongo1 drbd] # rpm-ivh elrepo-release-6-6.el6.elrepo.noarch.rpm warning: elrepo-release-6-6.el6.elrepo.noarch.rpm: Header V4 DSA/SHA1 Signature Key ID 192a7d7d: NOKEY Preparing... # [100%] 1:elrepo-release # [root@mymongo1 drbd] # [root@mymongo1 drbd] # rpm-ivh Elrepo-release-6-6.el6.elrepo.noarch.rpm warning: elrepo-release-6-6.el6.elrepo.noarch.rpm: Header V4 DSA/SHA1 Signature Key ID 192a7d7d: NOKEY Preparing... # [100%] 1:elrepo-release # [root@mymongo1 drbd] # yum install drbd kmod-drbd84-y Loaded plugins: fastestmirror, refresh-packagekit Security Setting up Install Process Loading mirror speeds from cached hostfile epel/metalink | 4.6 kB 00:00 * base: mirrors.cn99.com * elrepo: mirrors.tuna.tsinghua.edu.cn * epel: mirror.premi.st * extras: mirrors.tuna.tsinghua.edu.cn * updates: mirrors.tuna.tsinghua.edu.cn base | 3.7 kB 00:00 elrepo | 2.9 kB 00:00 elrepo/primary_db | 692kB 00:27 epel | 4.3kB 00:00 epel/primary_db | 5. 9 MB 03:04 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 http://mirrors.tuna.tsinghua.edu.cn/centos/6.9/updates/x86_64/repodata/2b0cc62da054bcf7c883b783de2de48c2372b9e502074246f7e0b046336f123d-primary.sqlite.bz2: [Errno 12] Timeout on http://mirrors.tuna.tsinghua.edu.cn/centos/6.9/updates/x86_64/repodata/2b0cc62da054bcf7c883b783de2de48c2372b9e502074246f7e0b046336f123d-primary.sqlite.bz2: (28 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds') Trying other mirror. Updates/primary_db | 3.1MB 00:00 Resolving Dependencies-- > Running transaction check-> Package drbd84-utils.x86_64 0updates/primary_db 8.9.8-1.el6.elrepo will be installed-- > Package kmod-drbd84.x86_64 0VR 8.4.9-1.el6.elrepo will be installed-- > Finished Dependency Resolution
Dependencies Resolved
= Package Arch Version Repository Size = Installing: drbd84-utils x86'64 8.9.8-1.el6.elrepo elrepo 392k kmod-drbd84 x86'64 8.4.9-1.el6.elrepo elrepo 198k
Transaction Summary = Install 2 Package (s)
Total download size: 590 k Installed size: 1.7 M Downloading Packages: (1 M Downloading Packages 2): drbd84-utils-8.9.8-1.el6.elrepo.x86_64.rpm | 392 kB 00:11 (2 kB 2): kmod-drbd84-8.4.9-1.el6.elrepo.x86_64.rpm | 198 kB 00:18-- -Total 19 kB/s | 590 kB 00:31 warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature Key ID baadae52: NOKEY Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org Importing GPG key 0xBAADAE52: Userid: elrepo.org (RPM Signing Key for elrepo.org) Package: elrepo-release-6-6.el6.elrepo.noarch (installed) From: / etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. * * Found 3 pre-existing rpmdb problem (s) 'yum check' output follows: 2:postfix-2.6.6-6.el6_7.1.x86_64 has missing requires of libmysqlclient.so.16 () (64bit) 2:postfix-2.6.6-6.el6_7.1.x86_64 has missing requires of libmysqlclient.so.16 (libmysqlclient_16) (64bit) 2:postfix-2.6.6-6.el6_7.1.x86_64 has missing requires of mysql-libs Installing: drbd84-utils-8.9.8 -1.el6.elrepo.x86_64 1 Installing 2 Installing: kmod-drbd84-8.4.9-1.el6.elrepo.x86_64 2 Working. This may take some time... Done. Verifying: drbd84-utils-8.9.8-1.el6.elrepo.x86_64 1 1.el6.elrepo.x86_64 2 Verifying: kmod-drbd84-8.4.9-1.el6.elrepo.x86_64 2
Installed: drbd84-utils.x86_64 0rig 8.9.8-1.el6.elrepo kmod-drbd84.x86_64 0vir 8.4.9-1.el6.elrepo
Complete! [root@mymongo1 drbd] #
[root@arbiter ~] # rpm-qa | grep drbd kmod-drbd84-8.4.9-1.el6.elrepo.x86_64 drbd84-utils-8.9.8-1.el6.elrepo.x86_64 [root@arbiter ~] # [root@mymongo1 ~] # rpm-qa | grep drbd drbd84-utils-8.9.8-1.el6.elrepo.x86_64 kmod-drbd84-8.4.9-1.el6.elrepo.x86_64 [root@mymongo1 ~] #
5. Add drbd to the kernel and set drbd boot [root@arbiter ~] # lsmod | grep drbd [root@arbiter ~] # modprobe drbd [root@arbiter ~] # lsmod | grep drbd drbd 374888 0 libcrc32c 1246 1 drbd [root@arbiter ~] # echo "modprobe drbd > / dev/null 2 > & 1" > / etc/sysconfig/modules/drbd.modules [root@arbiter ~] #
[root@mymongo1 ~] # lsmod | grep drbd [root@mymongo1 ~] # modprobe drbd [root@mymongo1 ~] # lsmod | grep drbd drbd 374888 0 libcrc32c 1246 1 drbd [root@mymongo1 ~] # echo "modprobe drbd > / dev/null 2 > & 1" > / etc/sysconfig/modules/drbd.modules [root@mymongo1 ~] #
6. Edit the drbd control file [root@mymongo1 ~] # drbdadm create-md data initializing activity log NOT initializing bitmap Writing meta data... of 2 nodes New drbd meta data block successfully created. [root@mymongo1 ~] # cat / etc/drbd.conf global {# minor-count 64; # dialog-refresh 5; # 5 seconds # disable-ip-verification; usage-count no;}
Common {protocol C; disk {on-io-error detach; no-disk-flushes; no-md-flushes;} net {sndbuf-size 512k; # timout 60; # 60 seconds # connect-int 10; # 10seconds # ping-int 10; # 10seconds # ping-timeout 5; # 500 ms max-buffers 8000; unplug-watermark 1024; max-epoch-size 8000; # ko-count 4; # allow-two-primaries; cram-hmac-alg "sha1"; shared-secret "hdhwXes23sYEhart8t"; after-sb-0pri disconnect After-sb-1pri disconnect; after-sb-2pri disconnect; rr-conflict disconnect; # data-integrity-alg "md5"; # no-tcp-cork;} syncer {rate 330M; al-extents 517;}} resource data {on arbiter {device / dev/drbd0; disk / dev/sdb1; address 192.168.144.111 dev/sdb1; address 7788; meta-disk / dev/sdb2 [0];} on mymongo1 {device / dev/drbd0; disk / dev/sdb1; address 192.168.144.132 Meta-disk / dev/sdb2 [0];}}
[root@mymongo1] # [root@mymongo1] # scp / etc/drbd.conf arbiter:/etc/ root@arbiter's password: drbd.conf 100% 994 1.0KB/s 00:00 [root@mymongo1 ~] #
7. Initialize two nodes drbd source data [root@mymongo1 ~] # drbdadm create-md data initializing activity log NOT initializing bitmap Writing meta data... New drbd meta data block successfully created. [root@mymongo1 ~] # [root@arbiter ~] # drbdadm create-md data initializing activity log NOT initializing bitmap Writing meta data... New drbd meta data block successfully created. [root@arbiter ~] #
8. Launch and view drbd [root@mymongo1 ~] # drbdadm up data [root@mymongo1 ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 0-12-13 18:38:15: cs:WFConnection ro:Secondary/Unknown ds:Inconsistent/DUnknown Murray: ns:0 nr:0 dw:0 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:999984 [root@mymongo1] # [root@arbiter] # drbdadm up data [root@arbiter] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent C r-ns:0 nr:0 dw:0 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:999984 [root@arbiter] #
[root@mymongo1] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6, 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent C r-ns:0 nr:0 dw:0 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:999984 [root@mymongo1] #
9. Set the drbd role Here set the mymongo1 master node [root@mymongo1 ~] # drbdadm-overwrite-data-of-peer primary data [root@mymongo1 ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent Crmurmuri n-ns:334220 nr:0 dw:0 dr:339075 al:8 bm:0 lo:0 pe:2 ua:5 ap:0 ep:1 wo:d oos:667184 [= >.] Sync'ed: 33.9% (667184 + 999984) K finish: 0:00:06 speed: 110932 (110932) K/sec [root@mymongo1 ~] # [root@arbiter ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:SyncTarget ro:Secondary/Primary ds:Inconsistent/UpToDate C r-ns:0 nr:896000 dw:894976 dr:0 al:8 bm:0 lo:2 pe:5 ua:1 ap:0 ep:1 wo:d oos:105008 [= >...] Sync'ed: 89.8% (105008amp 999984) K finish: 0:00:00 speed: 99440 (99440) want: 102400 K/sec [root@arbiter ~] #
Complete synchronization [root@arbiter ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-ns:0 nr:999983 dw:999983 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter ~] # [root@mymongo1 ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:999983 nr:0 dw:0 dr:1000662 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1] #
10 and 2-end machines create the same mount point [root@mymongo1 /] # mkdir data [root@mymongo1 /] #
[root@arbiter /] # mkdir data [root@arbiter /] #
11. Format drbd0 devices (only on the primary node) [root@mymongo1 /] # mkfs.ext4-b 4096 / dev/drbd0 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 62592 inodes, 249995 blocks 12499 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=260046848 8 block groups 32768 blocks per group, 32768 fragments per group 7824 inodes per group Superblock backups stored on blocks: 3276898304,163840229376
Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 39 mounts or 180 days, whichever comes first. Use tune2fs-c or-i to override. [root@mymongo1 /] # [root@mymongo1 /] # mount / dev/drbd0 / data [root@mymongo1 /] # pwd / [root@mymongo1 /] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda2 18G 6.6G 9.9G 40% / tmpfs 935M 72K 935M 1% / dev/shm / dev/sda1 283M 39M 229M 15% / boot / dev/drbd0 946M 1.3M 896M 1% / data [root@mymongo1 /] #
12. Data synchronization on the test side 2 [root@mymongo1] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:1032457 nr:0 dw:32474 dr:1001355 al:19 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1 ~] # [root@arbiter ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-ns:0 nr:1032457 dw:1032457 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter] #
Test [root@mymongo1 ~] # cp glib-2.22.5.tar / data/ [root@mymongo1 ~] # [root@mymongo1 ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:1032457 nr:0 dw:32474 dr:1001355 al:19 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:1032457 nr:0 dw:32474 dr:1001363 al:19 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:1032457 nr:0 dw:32474 dr:1001363 al:19 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:1032485 nr:0 dw:32502 dr:1001363 al:19 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:1072313 nr:0 dw:72330 dr:1001371 al:22 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1 ~] # [root@mymongo1 ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:1072325 nr:0 dw:72342 dr:1001371 al:22 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1] #
[root@arbiter] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-ns:0 nr:1032457 dw:1032457 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-ns:0 nr:1032485 dw:1032485 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-ns:0 nr:1032485 dw:1032485 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-ns:0 nr:1072325 dw:1072325 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter] #
The slave node views [root@arbiter ~] # drbdadm down data [root@arbiter ~] # mount / dev/sdb1 / mnt [root@arbiter ~] # cd / mnt [root@arbiter mnt] # ll total 39816-rw-r--r--. 1 root root 40755200 Aug 24 01:53 glib-2.22.5.tar drwx- 2 root root 16384 Aug 24 01:50 lost+found [root@arbiter mnt] #
Standby node recovery [root@arbiter ~] # drbdadm up data [root@arbiter ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter] #
2. Heartbeat takes over drbd service resources. 1. Modify the haresource configuration file of heartbeat. The two nodes are the same [root@mymongo1 ~] # cat / etc/ha.d/haresources arbiter IPaddr::192.168.144.121/24/eth2 httpd.
Mymongo1 IPaddr::192.168.144.122/24/eth2 drbddisk::data Filesystem::/dev/drbd0::/data::ext4
# mysql master # arbiter IPaddr::192.168.144.11/24/eth2 mysqld
# mysql salve # mymongo1 IPaddr::192.168.144.12/24/eth2 [root@mymongo1 ~] # 2. Restart the heartbeat service [root@mymongo1 ~] # / etc/init.d/heartbeat stop Stopping High-Availability services: Done.
[root@mymongo1] # / etc/init.d/heartbeat start Starting High-Availability services: INFO: Resource is stopped INFO: Resource is stopped Done. -- View vip [root@mymongo1 ~] # ip add of heartbeat | grep 192.168.144.122 inet 192.168.144.122 scope global secondary eth2 24 brd 192.168.144.255 scope global secondary eth2 [root@mymongo1 ~] #-- View drbd status [root@mymongo1 ~] # ip add | grep 192.168.144.122 inet 192.168.144.122 Mody 24 brd 192.168.144.255 scope global secondary eth2 [root@mymongo1 ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:1072437 nr:8 dw:72462 dr:1002067 al:22 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1 ~] #-check whether drbd automatically mounts [root@mymongo1 ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda2 18G 6.6g 9.9g 40% / tmpfs 935M 72K 935M 1% / dev/shm / dev/sda1 283M 39M 229M 15% / boot / dev/drbd0 946M 1.3M 896M 1% / data [root@mymongo1 ~] #
The arbiter node processes [root@arbiter ~] # / etc/init.d/heartbeat stop Stopping High-Availability services: Done. [root@arbiter] # / etc/init.d/heartbeat start Starting High-Availability services: INFO: Resource is stopped INFO: Resource is stopped Done. [root@arbiter ~] # ip add | grep 192.168.144.122 [root@arbiter ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-ns:8 nr:112 dw:120 dr:696 al:1 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda3 16G 8.3G 6.4G 57% / tmpfs 935M 72K 935m 1% / dev/shm / dev/sda1 283m 59m 210m 22% / boot [root@arbiter ~] #
3. Heartbeat takes over the testing of drbd resources-- stop the heartbeat simulation failure of mymongo1 [root@mymongo1 ~] # / etc/init.d/heartbeat stop Stopping High-Availability services: Done.
[root@mymongo1 ~] #-View the takeover of the drbd service directory of the standby node [root@arbiter ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-ns:8 nr:112 dw:120 dr:696 al:1 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda3 16G 8.3G 6.4G 57% / tmpfs 935M 72K 935m 1% / dev/shm / dev/sda1 283m 59m 210m 22% / boot [root@arbiter] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:12 nr:116 dw:128 dr:1392 al:1 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter ~] # ip add | grep 192.168.144.122 inet 192.168.144.122 scope global secondary eth2 24 brd 192.168.144.255 scope global secondary eth2 [root@arbiter ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda3 16G 8.3G 6.4G 57% / tmpfs 935M 72K 935M 1% / dev/shm / dev/sda1 283M 59M 210M 22% / boot / dev/drbd0 946M 1.3M 896M 1% / data [root@arbiter ~] #-View the release of drbd service directory resources in the primary node [root@mymongo1] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate CR-ns:1072441 nr:12 dw:72470 dr:1002067 al:22 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1 ~] # [root@mymongo1 ~] # ip add | grep 192.168.144.122 [root@mymongo1 ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda2 18G 6. 6G 9.9G 40% / tmpfs 935M 72K 935M 1% / dev/shm / dev/sda1 283M 39M 229M 15% / boot [root@mymongo1] #-- Experimental results show that when the master node fails Heartbeat can automatically take over drbd resources-adjust drbd and heartbeat not to boot and start automatically to prevent data destruction or data inconsistency in production. First, manual processing note that 2 nodes had better not automatically start [root@arbiter ~] # chkconfig heartbeat off [root@arbiter ~] # chkconfig drbd off for drbd and heartbeat.
[root@mymongo1 ~] # chkconfig heartbeat off [root@mymongo1 ~] # chkconfig drbd off
-- drbd reconnect data drbdadm connect data
The configuration of heartbeat takeover drbdadm is complete
Initialize the mysql database on the primary node of drbd (currently mymongo1). Install permission host for mysql database modification / data/mysql5.6 in drbd data partition [root@mymongo1 scripts] # chown-R mysql:mysql / data/mysql5.6/ [root@mymongo1 scripts] # chmod 775 / data/mysql5.6/ [root@mymongo1 scripts] # cd / application/mysql-5.6.36 [root@mymongo1 scripts] # pwd / application/mysql/scripts [root@mymongo1 scripts] #. / mysql_install_db-- basedir=/application/mysql /-- datadir=/data/mysql5.6/data-- user=mysql 2 Modify the mysql startup control file [root@mymongo1 scripts] # cat / etc/my.cnf [client] port = 3306 socket = / data/mysql5.6/tmp/mysql.sock
[mysql] no-auto-rehash
[mysqld] datadir=/data/mysql5.6/data socket=/data/mysql5.6/tmp/mysql.sock user=mysql port=3306 # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 log-bin=/data/mysql5.6/mysql-bin open_files_limit = 1024 back_log = 600max_connections = 800max_connect_errors = 3000 # table_cache = 614external-locking = FALSE thread_stack = 192 k # transaction_isolation=READ-COMMITTED tmp_table_size = 2m max_heap_table_size=2M long_query_time=1 pid-file = / data/mysql5.6/run/mysqld/mysql_mysqld.pid relay-log = / data/mysql5.6/relay-bin relay-log-info-file = / data/mysql5.6/relay-log.info binlog_cache_size=1M max_binlog_cache_size=1M max_binlog_size=2M expire_logs_days=7 key_buffer_size=16M read_buffer_size = 1m read_rnd_buffer_size=1M bulk_insert_buffer_size=1M lower_case_table_names=1 skip-name-resolve slave-skip-errors=1031,1062 replicate-ignore-db=mysql server-id=1 innodb_additional_mem_pool_size=4M
[mysqld_safe] log-error=/data/mysql5.6/log/mysql.log pid-file=/data/mysql5.6/run/mysqld/mysqld.pid [root@mymongo1 scripts] #
3. Install database [root@mymongo1 scripts] #. / mysql_install_db-- basedir=/application/mysql-- datadir=/data/mysql5.6/data-- user=mysql Installing MySQL system tables...2017-08-24 23:14:36 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details). 2017-08-24 23:14:36 0 [Note] Ignoring-- secure-file-priv value as server is running with-- bootstrap. 2017-08-24 23:14:36 0 [Note] / application/mysql/bin/mysqld (mysqld 5.6.36-log) starting as process 26813... 2017-08-24 23:14:36 7fbd0d5fd720 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. 2017-08-24 23:14:36 26813 [Note] InnoDB: Using atomics to ref count buffer pool pages 2017-08-24 23:14:36 26813 [Note] InnoDB: The InnoDB memory heap is disabled 2017-08-24 23:14:36 26813 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-08-24 23:14:36 26813 [Note] InnoDB: Memory barrier is not used 23:14:36 26813 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-08 -24 23:14:36 26813 [Note] InnoDB: Using CPU crc32 instructions 2017-08-24 23:14:36 26813 [Note] InnoDB: Initializing buffer pool Size = 128.0m 2017-08-24 23:14:36 26813 [Note] InnoDB: Completed initialization of buffer pool 2017-08-24 23:14:36 26813 [Note] InnoDB: The first specified data file. / ibdata1 did not exist: a new database to be created! 2017-08-24 23:14:36 26813 [Note] InnoDB: Setting file. / ibdata1 size to 12 MB 2017-08-24 23:14:36 26813 [Note] InnoDB: Database physically writes the file full: wait... 2017-08-24 23:14:36 26813 [Note] InnoDB: Setting logfile. / ib_logfile101 size to 48 MB 2017-08-24 23:14:36 26813 [Note] InnoDB: Setting logfile. / ib_logfile1 size to 48 MB 2017-08-24 23:14:36 26813 [Note] InnoDB: Renaming logfile. / ib_logfile101 to. / ib_logfile0 2017-08-24 23:14:36 26813 [Warning] InnoDB: New log files created LSN=45781 2017-08-24 23:14:36 26813 [Note] InnoDB: Doublewrite buffer not found: creating new 2017-08-24 23:14:36 26813 [Note] InnoDB: Doublewrite buffer created 2017-08-24 23:14:36 26813 [Note] InnoDB: 128rollback segment (s) are active. 2017-08-24 23:14:36 26813 [Warning] InnoDB: Creating foreign key constraint system tables. 2017-08-24 23:14:36 26813 [Note] InnoDB: Foreign key constraint system tables created 2017-08-24 23:14:36 26813 [Note] InnoDB: Creating tablespace and datafile system tables. 2017-08-24 23:14:36 26813 [Note] InnoDB: Tablespace and datafile system tables created. 2017-08-24 23:14:36 26813 [Note] InnoDB: Waiting for purge to start 2017-08-24 23:14:36 26813 [Note] InnoDB: 5.6.36 started; log sequence number 0 2017-08-24 23:14:37 26813 [Note] Binlog end 2017-08-24 23:14:37 26813 [Note] InnoDB: FTS optimize thread exiting. 2017-08-24 23:14:37 26813 [Note] InnoDB: Starting shutdown... 2017-08-24 23:14:38 26813 [Note] InnoDB: Shutdown completed; log sequence number 1625977 OK
Filling help tables...2017-08-24 23:14:38 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details). 2017-08-24 23:14:38 0 [Note] Ignoring-- secure-file-priv value as server is running with-- bootstrap. 2017-08-24 23:14:38 0 [Note] / application/mysql/bin/mysqld (mysqld 5.6.36-log) starting as process 26835... 2017-08-24 23:14:38 7f5a5b3cd720 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. 2017-08-24 23:14:38 26835 [Note] InnoDB: Using atomics to ref count buffer pool pages 2017-08-24 23:14:38 26835 [Note] InnoDB: The InnoDB memory heap is disabled 2017-08-24 23:14:38 26835 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-08-24 23:14:38 26835 [Note] InnoDB: Memory barrier is not used 23:14:38 26835 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-08 -24 23:14:38 26835 [Note] InnoDB: Using CPU crc32 instructions 2017-08-24 23:14:38 26835 [Note] InnoDB: Initializing buffer pool Size = 128.0m 2017-08-24 23:14:38 26835 [Note] InnoDB: Completed initialization of buffer pool 2017-08-24 23:14:38 26835 [Note] InnoDB: Highest supported file format is Barracuda. 2017-08-24 23:14:38 26835 [Note] InnoDB: 128rollback segment (s) are active. 2017-08-24 23:14:38 26835 [Note] InnoDB: Waiting for purge to start 2017-08-24 23:14:38 26835 [Note] InnoDB: 5.6.36 started; log sequence number 1625977 2017-08-24 23:14:38 26835 [Note] Binlog end 08-24 23:14:38 26835 [Note] InnoDB: FTS optimize thread exiting. 2017-08-24 23:14:38 26835 [Note] InnoDB: Starting shutdown... 2017-08-24 23:14:39 26835 [Note] InnoDB: Shutdown completed; log sequence number 1625987 OK
To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER! To do so, start the server, then issue the following commands:
/ application/mysql/bin/mysqladmin-u root password' new-password' / application/mysql/bin/mysqladmin-u root-h 192.168.144.132 password' new-password'
Alternatively you can run:
/ application/mysql/bin/mysql_secure_installation
Which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
Cd. ; / application/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
Cd mysql-test; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/
The latest information about MySQL is available on the web at
Http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
WARNING: Found existing config file / application/mysql/my.cnf on the system. Because this file might be in use, it was not replaced, but was used in bootstrap (unless you used-- defaults-file) and when you later start the server. The new default config file was created as / application/mysql/my-new.cnf, please compare it with your file and take the changes you need.
WARNING: Default config file / etc/my.cnf exists on the system This file will be read by default by the MySQL server If you do not want to use this, either remove it, or use the-- defaults-file argument to mysqld_safe when starting the server [root@mymongo1 scripts] #
4 、 Launch database [root@mymongo1 log] # mkdir-p / data/mysql5.6/run/mysqld [root@mymongo1 log] # chown-R mysql:mysql / data/mysql5.6/run/mysqld [root@mymongo1 scripts] # mkdir / data/mysql5.6/tmp-p [root@mymongo1 log] # chmod 755 / data/mysql5.6/run/mysqld [root@mymongo1 scripts] # chown-R mysql:mysql / data/mysql5.6/tmp [root@mymongo1 scripts] # mkdir-p / data/ Mysql5.6/log/ [root@mymongo1 scripts] # chown mysql:mysql / data/mysql5.6/log/ [root@mymongo1 scripts] # chmod 775 / data/mysql5.6/log/-R [root@mymongo1 scripts] # touch / data/mysql5.6/log/mysql.log [root@mymongo1 log] # chown mysql:mysql / data/mysql5.6/log/mysql.log [root@mymongo1 scripts] # ps-ef | grep mysql root 26877 20324 0 23:18 pts/2 grep mysql [root@mymongo1 scripts] # cd. [root@mymongo1 log] # / etc/init.d/mysqld start Starting MySQL. SUCCESS! [root@mymongo1 log] # mysql Welcome to the MySQL monitor. Commands end with; or\ g. Your MySQL connection id is 1 Server version: 5.6.36-log Source distribution
Copyright (c) 2000, 2017, 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 > quit Bye [root@mymongo1 log] #-- stop mysql on the primary node and start mysql [root@arbiter ~] # / etc/init.d/mysqld start Starting MySQL.. on the standby node SUCCESS! [root@arbiter] # ps-ef | grep mysql root 5344 10 01:13 pts/2 00:00:00 / bin/sh / application/mysql-5.6/bin/mysqld_safe-- datadir=/data/mysql5.6/data-- pid-file=/data/mysql5.6/run/mysqld/mysql_mysqld.pid mysql 5860 5344 8 01:13 pts/2 00:00:01 / application/mysql-5.6/bin/mysqld-- basedir=/application/mysql-5.6-- datadir=/data/ Mysql5.6/data-- plugin-dir=/application/mysql-5.6/lib/plugin-- user=mysql-- log-error=/data/mysql5.6/log/mysql.log-- open-files-limit=1024-- pid-file=/data/mysql5.6/run/mysqld/mysql_mysqld.pid-- socket=/data/mysql5.6/tmp/mysql.sock-- port=3306 root 5893 4987 0 01:13 pts/2 00:00:00 grep mysql [root@arbiter ~] # netstat-antup | grep 33 tcp 00: :: 3306:: * LISTEN 5860/mysqld tcp 0: 11733: * LISTEN 1983/rpc.statd [root@arbiter ~] # mysql Welcome to the MySQL monitor. Commands end with; or\ g. Your MySQL connection id is 1 Server version: 5.6.36-log Source distribution
Copyright (c) 2000, 2017, 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 > quit Bye [root@arbiter ~] #
5. Modify the resource configuration file haresources [root@mymongo1 ~] # cat / etc/ha.d/haresources arbiter IPaddr::192.168.144.121/24/eth2 httpd of heartbeat with 2 nodes
Mymongo1 IPaddr::192.168.144.122/24/eth2 drbddisk::data Filesystem::/dev/drbd0::/data::ext4 mysqld
# mysql master # arbiter IPaddr::192.168.144.11/24/eth2 mysqld
# mysql salve # mymongo1 IPaddr::192.168.144.12/24/eth2 [root@mymongo1 ~] #
6. Start heartbeat [root@mymongo1 ~] # / etc/init.d/heartbeat start Starting High-Availability services: INFO: Resource is stopped INFO: Resource is stopped Done. [root@mymongo1 ~] #
[root@arbiter] # / etc/init.d/heartbeat start Starting High-Availability services: INFO: Resource is stopped INFO: Resource is stopped Done. [root@arbiter ~] #
7. View status-- synchronization status of drbd [root@mymongo1] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:2333919 nr:0 dw:1333936 dr:1011915 al:190 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1 ~] #-- Storage mount of drbd [root@mymongo1] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda2 18G 9.8G 6.8G 60% / tmpfs 935M 72K 935M 1% / dev/shm / dev/sda1 283M 39M 229M 15% / boot / dev/drbd0 946M 113M 784M 13% / data [root@mymongo1 ~] #-- status of heartbeat highly available virtual IP [root@mymongo1 ~] # ip add | grep 192.168.144.122 inet 192.168.144.122 inet 192.168.144.122 Universe 24 brd 192.168.144.255 scope global secondary eth2-status of port 3306 of mysql [root@mymongo1 ~] # ss-antup | grep tcp LISTEN 33 0 128 127.0.0.1 6013 *: * users: ("sshd" 3306Magne23) tcp LISTEN 0128:: 1tcp LISTEN 6013: * users: (("sshd", 3306Magne20)) tcp LISTEN 0128: 3306:: * users: ("mysqld", 26363)) tcp LISTEN 0128 127.0.1 tcp LISTEN 6010 *: * users: ("sshd", 3306prime8) tcp LISTEN 0128: ("sshd", 3306 pencil 7) tcp LISTEN 0128 127.0.1) tcp LISTEN 6011 *: ("sshd") (3306 tcp LISTEN 13)) tcp LISTEN 0 128: 1 users: (("sshd", 3306 Magi 10)) tcp LISTEN 0 128 127.0.1 tcp LISTEN 6012 *: * users: ("sshd", 3306 Power18) tcp LISTEN 0 128:: 1 tcp ESTAB 0 192.168.144.132 22 192.168.144.132 users: ("sshd") 3306 (3))-- mysql login test-main node [root@mymongo1 ~] # mysql Welcome to the MySQL monitor. Commands end with; or\ g. Your MySQL connection id is 1 Server version: 5.6.36-log Source distribution
Copyright (c) 2000, 2017, 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 > [root@mymongo1 ~] #-- peer node arbir [root@arbiter ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda3 16G 9.3G 5.4G 64% / tmpfs 935M 72K 935M 1% / dev/shm / dev/sda1 283M 59M 210M 22% / boot [root@arbiter ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-ns:0 nr:464 dw:464 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter ~] # ip add | grep 192.168.144.122 [root@arbiter ~] # ss-antup | grep 3306 [root@arbiter ~] #
8. Heartbeat resource switching takeover test-the current master node stops heartbeart [root@mymongo1 ~] # / etc/init.d/heartbeat stop Stopping High-Availability services: Done.
[root@mymongo1 ~] # [root@mymongo1 ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda2 18G 9.8G 6.8G 60% / tmpfs 935M 72K 935M 1% / dev/shm / dev/sda1 283M 39M 229M 15% / boot [root@mymongo1 ~] # ip add | grep 192.168.144.122 [root@mymongo1 ~] # ps-ef | grep mysql root 27156 3962 0 01:28 pts/2 00:00:00 grep mysql [root@mymongo1 ~] #-- there is a process How strange [root@mymongo1 ~] # netstat-antup | grep 3306 tcp 0 0127.0.0.1antup 6013 0.0.0.0antup * LISTEN 3306/sshd tcp 00127.0.0.1antup 6010 0.0.0.0antup * LISTEN 3306/sshd tcp 00127.0.0.1antup 6011 0.0.0.0antup * LISTEN 3306/sshd tcp 0127.0.0.1v 6012 0.0.0.1v * LISTEN 3306/sshd tcp 052 192. 168.144.132 ESTABLISHED 3306/sshd tcp 22 192.168.144.1 LISTEN 3306/sshd tcp 49249 LISTEN 3306/sshd tcp 0 0:: 1 LISTEN 3306/sshd tcp 6013: * LISTEN 3306/sshd tcp 0 0:: 1 LISTEN 3306/sshd tcp 6010: * LISTEN 3306/sshd tcp 0 0:: 1 LISTEN 3306/sshd tcp 6011: * LISTEN 3306/sshd [root@mymongo1] #-- the slave node views the drbd service directory, Takeover of mysql service [root@arbiter] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:456 nr:656 dw:1112 dr:7028 al:6 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda3 16G 9.3G 5.4G 64% / tmpfs 935M 72K 935m 1% / dev/shm / dev/sda1 283m 59m 210M 22% / boot / dev/drbd0 946M 113M 784M 13% / data [root@arbiter ~] # ss-antup | grep 3306 tcp LISTEN 0 128: 3306:: * users: ("mysqld" 8356 (17)) [root@arbiter] # [root@arbiter] # mysql Welcome to the MySQL monitor. Commands end with; or\ g. Your MySQL connection id is 1 Server version: 5.6.36-log Source distribution
Copyright (c) 2000, 2017, 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 > quit Bye [root@arbiter ~] #
-- testing mysql data synchronization [root@arbiter ~] # mysql Welcome to the MySQL monitor with heartbeat-drbd-mysql. Commands end with; or\ g. Your MySQL connection id is 2 Server version: 5.6.36-log Source distribution Copyright (c) 2000, 2017, 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 > create database zhulei; Query OK, 1 row affected (0.00 sec) mysql > use zhulei Database changed mysql > create table tt (id int,name varchar (15)), Query OK, 0 rows affected (0.06 sec) mysql > insert into tt values; Query OK, 1 row affected (0.01 sec) mysql > select * from tt +-+-+ | id | name | +-+-+ | 1 | zhulei | +-+-+ 1 row in set (0.01sec) mysql > quit Bye [root@arbiter ~] #-- launch heartbeat [root@mymongo1 ~] # / etc/init.d/heartbeat start Starting High-Availability services: INFO: Resource is stopped INFO: Resource is stopped Done in mymongo1. [root@mymongo1 ~] #-View the resource status of mymongo1 [root@mymongo1 ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-ns:2334487 nr:2032 dw:1336536 dr:1019079 al:190 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1 ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda2 18G 9.8G 6.8G 60% / tmpfs 935M 72K 935m 1% / dev/shm / dev/sda1 283m 39m 229M 15% / boot / dev/drbd0 946M 114M 784M 13% / data [root@mymongo1 ~] # ip add | grep 192.168.144.122 inet 192.168.144.122 brd 192.168.144.255 scope global secondary eth2 [root@mymongo1 ~] # ss-antup | grep 3306 tcp LISTEN 0128 127.0.0.1 ss 6013 *: * users: ("sshd" 3306Magne23) tcp LISTEN 0128:: 1tcp LISTEN 6013: * users: ("sshd", 3306Magne20)) tcp LISTEN 0128: 3306:: * users: ("mysqld", 28610)) tcp LISTEN 0128 127.0.1 sshd 6010 *: * users: ("sshd", 3306helium 8) tcp LISTEN 0128: ("sshd", 3306Mag8) tcp LISTEN 0128: (("sshd", 3306) tcp LISTEN 0128 127.0.1) tcp LISTEN 6011: * users: ("sshd") (3306 tcp LISTEN 13)) tcp LISTEN 0 128: 1 users: (("sshd", 3306 Magi 10)) tcp LISTEN 0 128 127.0.1 tcp LISTEN 6012 *: * users: ("sshd", 3306 Power18) tcp LISTEN 0 128:: 1 tcp ESTAB 0 128: * users: ("sshd", 3306, 15)) tcp ESTAB 0 120 192.168.144.132 22 192.168.144.1 49249 users: ("sshd") 3306 ps 3) [root@mymongo1 ~] # ps-ef | grep mysql root 28093 10 01:33? 00:00:00 / bin/sh / application/mysql-5.6/bin/mysqld_safe-- datadir=/data/mysql5.6/data-- pid-file=/data/mysql5.6/run/mysqld/mysql_mysqld.pid mysql 28610 28093 1 01:33? 00:00:00 / application/mysql-5.6/bin/mysqld-- basedir=/application/mysql-5.6-- datadir=/data/ Mysql5.6/data-- plugin-dir=/application/mysql-5.6/lib/plugin-- user=mysql-- log-error=/data/mysql5.6/log/mysql.log-- open-files-limit=1024-- pid-file=/data/mysql5.6/run/mysqld/mysql_mysqld.pid-- socket=/data/mysql5.6/tmp/mysql.sock-- port=3306 root 28672 5393 0 01:34 pts/3 00:00:00 grep mysql [root@mymongo1] # mysql Welcome to the MySQL monitor. Commands end with; or\ g. Your MySQL connection id is 1 Server version: 5.6.36-log Source distribution
Copyright (c) 2000, 2017, 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 > show databases; +-+ | Database | +-+ | information_schema | | mysql | | performance_schema | | test | | zhulei | +-+ 5 rows in set (0.01 sec)
Mysql > use zhulei; Database changed mysql > show tables; +-+ | Tables_in_zhulei | +-+ | tt | +-+ 1 row in set (0.00 sec)
Mysql > select * from tt; +-+ | id | name | +-+-+ | 1 | zhulei | +-+-+ 1 row in set (0.02 sec)
Mysql > quit Bye [root@mymongo1 ~] #
-- Resource release of node arbiter [root@arbiter ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-ns:2032 nr:1180 dw:3212 dr:7220 al:9 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda3 16G 9.3G 5.4G 64% / tmpfs 935M 72K 935m 1% / dev/shm / dev/sda1 283m 59m 210M 22% / boot [root@arbiter ~] # ip add | grep 192.168.144.122 [root@arbiter ~] # ps-ef | grep mysql root 9105 4987 0 01:36 pts/2 00:00:00 grep mysql [root@arbiter ~] # ss-antup | grep 3306 [root@arbiter ~] # netstat-antup | grep 3306 [root@arbiter ~] # so far The experiment is complete!
Appendix: stop Mysql-drbd-hearbeart normally without resource node first stop heartbeat [root@arbiter ~] # / etc/init.d/heartbeat stop Stopping High-Availability services: Done. [root@arbiter] # [root@arbiter] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-ns:2032 nr:1180 dw:3212 dr:7220 al:9 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda3 16G 9.3G 5.4G 64% / tmpfs 935M 72K 935m 1% / dev/shm / dev/sda1 283m 59m 210m 22% / boot [root@arbiter ~] # ip add | grep 192.168.144.122 [root@arbiter ~] # ps-ef | grep mysql root 9105 4987 0 01:36 pts/2 00:00:00 grep mysql [root@arbiter ~] # ss-antup | grep 3306 [root@arbiter ~] # netstat-antup | grep 3306 [root@arbiter ~] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r-ns:2032 nr:1388 dw:3420 dr:7220 al:9 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@arbiter ~] # ss-antup | grep 3306 [root@arbiter ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda3 16G 9.3G 5.4G 64% / tmpfs 935M 72K 935M1 % / dev/shm / dev/sda1 283M 59M 210M 22% / boot [root@arbiter ~] # Resource node stops heartbeat [root@mymongo1 ~] # / etc/init.d/heartbeat stop Stopping High-Availability services: Done. [root@mymongo1] # [root@mymongo1] # cat / proc/drbd version: 8.4.9-1 (api:1/proto:86-101) GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by mockbuild@Build64R6 2016-12-13 18:38:15 0: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r-ns:2334859 nr:2032 dw:1336908 dr:1019395 al:190 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 [root@mymongo1 ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/sda2 18G 9.8G 6.8G 60% / tmpfs 935M 72K 935m 1% / dev/shm / dev/sda1 283m 39m 229M 15% / boot [root@mymongo1 ~] # ip add | grep 192.168.144.122 [root@mymongo1 ~] # ss-antup | grep 3306 tcp LISTEN 0 128 127.0.1 ip add 6013 *: * users: ("sshd" 3306Magne23) tcp LISTEN 0 128: 1tcp LISTEN 0128: * users: (("sshd", 3306 Magi 20)) tcp LISTEN 0 128 127.0.1 tcp LISTEN 6010 *: * users: ("sshd", 3306 Magne8) tcp LISTEN 0 128: 1 tcp LISTEN 0 128: * users: ("sshd", 3306, 7) tcp LISTEN 0 128 127.0.1 tcp LISTEN 6011 *: * users: ("sshd", 3306 13) tcp LISTEN 0 128: 1Rh 6011:: * users: ("sshd") 3306Magne10) tcp LISTEN 0128 127.0.0.1 tcp LISTEN 6012 *: * users: ("sshd", 3306 Magne18)) tcp LISTEN 0 128: 1 tcp LISTEN 6012: * users: ("sshd", 3306 Magne15)) tcp ESTAB 052 192.168.144.132 tcp LISTEN 22 192.168.144.1 sshd 49249 users: (("sshd", 3306)) [root@mymongo1 ~] # [root@mymongo1 ~] # / etc/init.d/drbd stop Stopping all DRBD resources:. [root@mymongo1 ~] #
[root@arbiter] # / etc/init.d/drbd stop Stopping all DRBD resources:. [root@arbiter ~] #
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.