Advertisement
Guest User

Untitled

a guest
May 6th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. # create temp config file in order to have atomic commit of config
  2. pcs cluster cib ha_cfg
  3.  
  4. # define DRBD resources
  5. pcs -f ha_cfg resource create dvl_drbd ocf:linbit:drbd drbd_resource=dvlstorage op monitor interval=30s
  6.  
  7. # define DRBD master/slave sets
  8. pcs -f ha_cfg resource master dvl_drbdms dvl_drbd master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
  9.  
  10. # define iSCSI targets
  11. pcs -f ha_cfg resource create dvl_tgt ocf:heartbeat:iSCSITarget \
  12. params implementation="tgt" iqn="iqn.2016-04.net.customer:dvlstorage" tid=1 \
  13. op start interval="0" timeout="60" op stop interval="0" timeout="60" op monitor interval="30" timeout="60"
  14.  
  15. # define iSCSI luns
  16. pcs -f ha_cfg resource create dvl_tgtlun ocf:heartbeat:iSCSILogicalUnit \
  17. params implementation="tgt" target_iqn="iqn.2016-04.net.customer:dvlstorage" lun=1 path=/dev/drbd/dvl \
  18. op start interval="0" timeout="60" op stop interval="0" timeout="60" op monitor interval="30" timeout="60"
  19.  
  20. # define floating IPs
  21. pcs -f ha_cfg resource create dvl_floatip ocf:heartbeat:IPaddr2 ip=10.177.4.105 cidr_netmask=32 op monitor interval=30s
  22.  
  23. # define resource groups and order/constraints
  24. pcs -f ha_cfg resource group add dvl_resources dvl_tgt dvl_tgtlun dvl_floatip
  25. pcs -f ha_cfg constraint colocation add started dvl_resources with master dvl_drbdms INFINITY
  26. pcs -f ha_cfg constraint order promote dvl_drbdms then start dvl_resources
  27.  
  28. # merge
  29. pcs cluster cib-push ha_cfg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement