Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #resources
- pcs resource create DBClusterIP ocf:heartbeat:IPaddr2 \
- ip="10.10.10.104" cidr_netmask="32" nic="enp0s3" \
- op monitor interval="10s" timeout="60s" \
- op start interval="0" timeout="60s" \
- op stop interval="0" timeout="60s" \
- meta failure-timeout="2000s" target-role="Started"
- pcs resource create Postgresql9 ocf:heartbeat:pgsql \
- pgctl="/usr/pgsql-9.3/bin/pg_ctl" psql="/usr/pgsql-9.3/bin/psql" pgdata="/var/lib/pgsql/9.3/data/" start_opt="-p 5432" rep_mode="async" node_list="DBHA FAILOVERHA" restore_command="" primary_conninfo_opt="keepalives_idle=60 keepalives_interval=5 keepalives_count=5" master_ip="10.10.10.104" restart_on_promote="true" \
- op monitor interval="20s" role="Slave" timeout="100s" \
- op monitor interval="10s" role="Master" timeout="100s" \
- op start interval="0" timeout="250s" \
- op promote interval="0" timeout="70s" \
- op stop interval="0" timeout="70s" \
- op demote interval="0" timeout="200s" \
- op notify interval="0" timeout="200s" \
- meta failure-timeout="2000s" \
- meta migration-threshold="3"
- pcs resource create Ping ocf:pacemaker:ping \
- dampen="40s" multiplier="1000" host_list="10.10.10.7" \
- op stop interval="0" timeout="80s" \
- op monitor interval="10s" timeout="60s"\
- meta failure-timeout="40s"
- #cloning
- pcs resource master mspostgres Postgresql9 master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true" migration-threshold="3" target-role="Started"
- pcs resource clone Ping globally-unique="false" target-role="Started"
- #ping rules
- pcs constraint location DBClusterIP rule score=-INFINITY not_defined pingd or pingd eq 0
- pcs constraint location mspostgres rule score=-INFINITY not_defined pingd or pingd eq 0
- #locations
- pcs constraint location mspostgres prefers DBHA=90
- pcs constraint location mspostgres prefers FAILOVERHA=80
- #colocations
- pcs constraint colocation add DBClusterIP with Master mspostgres score=INFINITY
- #ordering
- pcs constraint order stop DBClusterIP then demote mspostgres kind=Optional symmetrical=false
- #cluster-properties
- pcs property set cluster-recheck-interval=5min
- pcs property set stonith-enabled=false
- pcs property set no-quorum-policy=ignore
- pcs resource defaults migration-threshold=3
- pcs property set placement-strategy=balanced
- pcs property set stop-all-resources=false
- # default - options
- pcs resource defaults failure-timeout=2000
- pcs resource defaults resource-stickiness=100
- pcs resource op defaults on-fail=restart
Add Comment
Please, Sign In to add comment