corosync+pacemaker实现高可用的MariaDB
corosync+pacemaker实现高可用的MariaDB
【摘要】一、准备工作承接上文:corosync+pacemaker使用crmsh构建高可用集群二、MariaDB server配置(基于nfs)nfs server准备1、在nfs server准备LVM存储空间 [root@node3 ~]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, S...
一、准备工作
承接上文:corosync+pacemaker使用crmsh构建高可用集群
二、MariaDB server配置(基于nfs)
nfs server准备
1、在nfs server准备LVM存储空间
[root@node3 ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x61284c6a.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
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): 3
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305): +10G
Value out of range.
Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305): +5G Command (m for help): t
Selected partition 3
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@node3 ~]# partx -a /dev/sdb
[root@node3 ~]# pvcreate /dev/sdb3
Physical volume "/dev/sdb3" successfully created
[root@node3 ~]# vgcreate myvg /dev/sdb3
Volume group "myvg" successfully created
[root@node3 ~]# lvcreate -L 5G -n mydata myvg
Logical volume "mydata" created.
[root@node3 ~]# mke2fs -t ext4 /dev/myvg/mydata
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
327680 inodes, 1310720 blocks
65536 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200