|
Added new hard disk and do partition on both nodes: fdisk /dev/sdbThen format partition: mkfs.ext4 /dev/sdb(Failed on node2, so removed it and added a new disk become /dev/sdc. Formated it.) Follow official guide to config the basic resource on both nodes: Created /etc/drbd.d/r0.res on both nodes: resource r0 { protocol C; on node1 { device /dev/drbd0; disk /dev/sdb; address 192.168.0.1:7789; meta-disk internal; } on node2 { device /dev/drbd0; disk /dev/sdc; address 192.168.0.2:7789; meta-disk internal; }}Edit iptables on both nodes: iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7788 -j ACCEPTiptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7799 -j ACCEPTservice iptables saveInitialize data on both nodes: drbdadm create-md r0All OK. Put the resource up on both nodes: drbdadm up r0 node1: Device '0' is configured!Command 'drbdmeta 0 v08 /dev/sdb internal apply-al' terminated with exit code 20node2: ??: Failure: (162) Invalid configuration requestadditional info from kernel:minor exists in different resourceCommand 'drbdsetup-84 new-minor r0 0 0' terminated with exit code 10Both of them happened issues. Run cat /proc/drbd on both nodes: node1: version: 8.4.9-1 (api:1/proto:86-101)GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by akemi@Build64R7, 2016-12-04 01:08:48 0: cs:WFConnection ro:Primary/Unknown ds:UpToDate/DUnknown C r----s ns:0 nr:0 dw:0 dr:912 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:2097052node2: version: 8.4.9-1 (api:1/proto:86-101)GIT-hash: 9976da086367a2476503ef7f6b13d4567327a280 build by akemi@Build64R7, 2016-12-04 01:08:48 0: cs:WFConnection ro:Secondary/Unknown ds:Diskless/DUnknown C r----s 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:0Primary and Secondary unknown. Run drbdadm connect all on node1: r0: Failure: (125) Device has a net-config (use disconnect first)Command 'drbdsetup-84 connect r0 ipv4:192.168.0.1:7789 ipv4:192.168.0.2:7789 --protocol=C' terminated with exit code 10Run drbdadm -- --discard-my-data connect all on node2: r0: Failure: (102) Local address(port) already in use.Command 'drbdsetup-84 connect r0 ipv4:192.168.0.1:7789 ipv4:192.168.0.2:7789 --protocol=C --discard-my-data' terminated with exit code 10What's wrong of using it? Edit 1After ran dd if=/dev/zero of=/dev/sdb(sdc) bs=1M oflag=direct status=progress on both nodes, they also can't ran drbdadm up r0 successfully: node1No valid meta data foundCommand 'drbdmeta 0 v08 /dev/sdb internal apply-al' terminated with exit code 255node2??: Failure: (162) Invalid configuration requestadditional info from kernel:minor exists in different resourceCommand 'drbdsetup-84 new-minor r0 0 0' terminated with exit code 10 Edit 2At this time, ran systemctl start brdb on both nodes, all of them got pending. Wait for a long time returned no result. And ran lsblk -a now: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 10G 0 disk├─sda1 8:1 0 1G 0 part /boot└─sda2 8:2 0 9G 0 part ├─cl-root 253:0 0 8G 0 lvm / └─cl-swap 253:1 0 1G 0 lvm [SWAP]sdb 8:32 0 16G 0 disksr0 11:0 1 1024M 0 romdrbd0 147:0 0 2G 0 disk$ U' x1 _0 I" l. @% P$ Z
|