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 (7675-15665, default 7675):
Using default value 7675
Last cylinder, +cylinders or +size{K,M,G} (7675-15665, default 15665): +5G
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
#重新读取内核分区
# partx -a /dev/sda
# cat /proc/partitions
major minor #blocks name
Manages a DRBD device as a Master/Slave resource (ocf:linbit:drbd)
This resource agent manages a DRBD resource as a master/slave resource.
DRBD is a shared-nothing replicated storage device.
Note that you should configure resource level fencing in DRBD,
this cannot be done from this resource agent.
See the DRBD User's Guide for more information. http://www.drbd.org/docs/applications/
Parameters (* denotes required, [] the default):
drbd_resource* (string): drbd resource name
The name of the drbd resource from the drbd.conf file.
drbdconf (string, [/etc/drbd.conf]): Path to drbd.conf
Full path to the drbd.conf file.
stop_outdates_secondary (boolean, [false]): outdate a secondary on stop
Recommended setting: until pacemaker is fixed, leave at default (disabled).
Note that this feature depends on the passed in information in
OCF_RESKEY_CRM_meta_notify_master_uname to be correct, which unfortunately is
not reliable for pacemaker versions up to at least 1.0.10 / 1.1.4.
If a Secondary is stopped (unconfigured), it may be marked as outdated in the
drbd meta data, if we know there is still a Primary running in the cluster.
Note that this does not affect fencing policies set in drbd config,
but is an additional safety feature of this resource agent only.
You can enable this behaviour by setting the parameter to true.
If this feature seems to not do what you expect, make sure you have defined
fencing policies in the drbd configuration as well.
# crm configure
crm(live)configure# primitive mysqlstore ocf:linbit:drbd params drbd_resource=mystore op monitor role=Master interval=30s timeout=30s op monitor role=Slave interval=60s timeout=20s op start timeout=240s op stop timeout=100s
crm(live)configure# verify
crm(live)configure# master ms_mysqlstore mysqlstore meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify="true"
crm(live)configure# verify
crm(live)configure# commit
--查询配置
# crm configure show
node node1.samlee.com
node node2.samlee.com
primitive mysqlstore ocf:linbit:drbd \
params drbd_resource="mystore" \
op monitor role="Master" interval="30s" timeout="30s" \
op monitor role="Slave" interval="60s" timeout="20s" \
op start timeout="240s" interval="0" \
op stop timeout="100s" interval="0"
ms ms_mysqlstore mysqlstore \
meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"
property $id="cib-bootstrap-options" \
dc-version="1.1.10-14.el6-368c726" \
cluster-infrastructure="classic openais (with plugin)" \
expected-quorum-votes="2" \
stonith-enabled="false" \
no-quorum-policy="ignore"
rsc_defaults $id="rsc-options" \
resource-stickiness="100"
查询当前集群运行状态:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
crm(live)# status
Last updated: Thu Aug 18 12:26:47 2016
Last change: Thu Aug 18 12:24:02 2016 via cibadmin on node1.samlee.com
Stack: classic openais (with plugin)
Current DC: node1.samlee.com - partition with quorum
Version: 1.1.10-14.el6-368c726
2 Nodes configured, 2 expected votes
2 Resources configured
crm(live)configure# primitive mysqlfs ocf:heartbeat:Filesystem params device=/dev/drbd0 directory=/mydata fstype=ext4 op monitor interval=30s timeout=40s op start timeout=60s op stop timeout=60s on-fail=restart
crm(live)configure# verify
crm(live)configure# colocation mysqlfs_with_ms_mysqlstore_master inf: mysqlfs ms_mysqlstore:Master
crm(live)configure# verify
crm(live)configure# order mysqlfs_after_ms_mysqlstore_master mandatory: ms_mysqlstore:promote mysqlfs:start
crm(live)configure# verify
crm(live)configure# show
node node1.samlee.com
node node2.samlee.com
primitive mysqlfs ocf:heartbeat:Filesystem \
params device="/dev/drbd0" directory="/mydata" fstype="ext4" \
op monitor interval="30s" timeout="40s" \
op start timeout="60s" interval="0" \
op stop timeout="60s" on-fail="restart" interval="0"
primitive mysqlstore ocf:linbit:drbd \
params drbd_resource="mystore" \
op monitor role="Master" interval="30s" timeout="30s" \
op monitor role="Slave" interval="60s" timeout="20s" \
op start timeout="240s" interval="0" \
op stop timeout="100s" interval="0"
ms ms_mysqlstore mysqlstore \
meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"
colocation mysqlfs_with_ms_mysqlstore_master inf: mysqlfs ms_mysqlstore:Master
order mysqlfs_after_ms_mysqlstore_master inf: ms_mysqlstore:promote mysqlfs:start
property $id="cib-bootstrap-options" \
dc-version="1.1.10-14.el6-368c726" \
cluster-infrastructure="classic openais (with plugin)" \
expected-quorum-votes="2" \
stonith-enabled="false" \
no-quorum-policy="ignore"
rsc_defaults $id="rsc-options" \
resource-stickiness="100"
--提交配置
crm(live)configure# commit
查询集群状态如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
crm(live)# status
Last updated: Thu Aug 18 13:27:28 2016
Last change: Thu Aug 18 13:25:31 2016 via cibadmin on node1.samlee.com
Stack: classic openais (with plugin)
Current DC: node1.samlee.com - partition with quorum
Version: 1.1.10-14.el6-368c726
2 Nodes configured, 2 expected votes
3 Resources configured