[iyunv@node1 corosync]# 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 0x35afce5b.
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): 1
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305): +5G
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
通知内核更新分区表
1
2
[iyunv@node1 ~]# partx -a /dev/sdb
[iyunv@node2 ~]# partx -a /dev/sdb
vim /etc/drbd.d/global_common.conf
##global:全局属性,定义drbd自己的工作特性
global {
##收集用户信息
usage-count no;
# minor-count dialog-refresh disable-ip-verification
}
##common:通用属性,定义多组drbd设备通用特性
common {
protocol C;
##处理器,定义集群脑裂的处理方法
handlers {
# These are EXAMPLE handlers only.
# They may have severe implications,
# like hard resetting the node under certain circumstances.
# Be careful when chosing your poison.
[iyunv@node1 ~]# drbdadm create-md mystore
Writing meta data...
initializing activity log
NOT initialized bitmap
New drbd meta data block successfully created.
node2
1
2
3
4
5
[iyunv@node2 ~]# drbdadm create-md mystore
Writing meta data...
initializing activity log
NOT initialized bitmap
New drbd meta data block successfully created.
node1和node2同时启动drbd
1
2
[iyunv@node1 ~]# service drbd start
[iyunv@node2 ~]# service drbd start
[iyunv@node1 ~]# mke2fs -t ext4 /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
328656 inodes, 1313255 blocks
65662 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1346371584
41 block groups
32768 blocks per group, 32768 fragments per group
8016 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736