用DRBD和OCFS2实现数据同步和共享(5)

────────────────────────────────────────────────────────────────────────────────
Initial and Syncing the nodes (performed on only one node)
────────────────────────────────────────────────────────────────────────────────
Now DRBD has successfully allocated both disk and network resources is ready for
operation. What it does not know yet is which nodes should be used as the source
of the initial device synchronization.

Start the initial full synchronization:

[root@centos6-ocfs2-1]# drbdadm -- --overwrite-data-of-peer primary ocfs2;
--------------------------------------------------------------------------------
DRBD module version: 8.3.11
   userland version: 8.3.13
preferably kernel and userland versions should match.
--------------------------------------------------------------------------------
Note: This command must be performed on only one node, only on initial resource
configuration,  and only on the node you selected as the synchronization source.


# /etc/init.d/drbd status
--------------------------------------------------------------------------------
drbd driver loaded OK; device status:
version: 8.3.11 (api:88/proto:86-96)
srcversion: DA5A13F16DE6553FC7CE9B2
m:res    cs         ro                 ds                 p  mounted  fstype
0:ocfs2  Connected  Primary/Secondary  UpToDate/UpToDate  C
--------------------------------------------------------------------------------
Note: Both nodes's status change to Primary/Secondary and UpToDate/UpToDate now.

────────────────────────────────────────────────────────────────────────────────
Start drbd and ocfs2, building OCFS2 filesystem (performed on only one node)
────────────────────────────────────────────────────────────────────────────────
[root@centos6-ocfs2-1]# /etc/init.d/o2cb load
[root@centos6-ocfs2-1]# /etc/init.d/o2cb online
[root@centos6-ocfs2-2]# /etc/init.d/o2cb load
[root@centos6-ocfs2-2]# /etc/init.d/o2cb online

# /etc/init.d/o2cb status
--------------------------------------------------------------------------------
Driver for "configfs": Loaded
Filesystem "configfs": Mounted
Stack glue driver: Loaded
Stack plugin "o2cb": Loaded
Driver for "ocfs2_dlmfs": Loaded
Filesystem "ocfs2_dlmfs": Mounted
Checking O2CB cluster "ocfs2": Online
  Heartbeat dead threshold: 31
  Network idle timeout: 30000
  Network keepalive delay: 2000
  Network reconnect delay: 2000
  Heartbeat mode: Local
Checking O2CB heartbeat: Not active
--------------------------------------------------------------------------------
Note: Both nodes should be loaded and onlined  with the  O2CB  control script,
but do not active the heartbeat before we formate the OCFS2 filesystem.


[root@centos6-ocfs2-1]# mkfs.ocfs2 -N 2 -L ocfs2 /dev/drbd0
--------------------------------------------------------------------------------
mkfs.ocfs2 1.8.0
Cluster stack: classic o2cb
Overwriting existing ocfs2 partition.
Proceed (y/N): y
Label: ocfs2
Features: sparse extended-slotmap backup-super unwritten inline-data
          strict-journal-super xattr indexed-dirs refcount discontig-bg
Block size: 2048 (11 bits)
Cluster size: 4096 (12 bits)
Volume size: 1069182976 (261031 clusters) (522062 blocks)
Cluster groups: 17 (tail covers 7079 clusters, rest cover 15872 clusters)
Extent allocator size: 4194304 (1 groups)
Journal size: 33554432
Node slots: 2
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Writing backup superblock: 0 block(s)
Formatting Journals: done
Growing extent allocator: done
Formatting slot map: done
Formatting quota files: done
Writing lost+found: done
mkfs.ocfs2 successful
--------------------------------------------------------------------------------
Note: This command must be done on the Primary node only. The filesystem will be
created on the drdb device which is active and will replicate to the other nodes.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/629ebe60a358b37b031eb21782d36a2c.html