username88979

CIB pacemaker- postgres

Oct 15th, 2018
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.49 KB | None | 0 0
  1. #!/bin/bash
  2. #resources
  3. pcs resource create DBClusterIP ocf:heartbeat:IPaddr2 \
  4.     ip="10.10.10.104" cidr_netmask="32" nic="enp0s3" \
  5.     op monitor interval="10s" timeout="60s" \
  6.     op start interval="0" timeout="60s" \
  7.     op stop interval="0" timeout="60s" \
  8.     meta failure-timeout="2000s" target-role="Started"
  9. pcs resource create Postgresql9 ocf:heartbeat:pgsql \
  10.     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" \
  11.     op monitor interval="20s" role="Slave" timeout="100s" \
  12.     op monitor interval="10s" role="Master" timeout="100s" \
  13.     op start interval="0" timeout="250s" \
  14.     op promote interval="0" timeout="70s" \
  15.     op stop interval="0" timeout="70s" \
  16.     op demote interval="0" timeout="200s" \
  17.     op notify interval="0" timeout="200s" \
  18.     meta failure-timeout="2000s" \
  19.     meta migration-threshold="3"
  20. pcs resource create Ping ocf:pacemaker:ping \
  21.         dampen="40s" multiplier="1000" host_list="10.10.10.7" \
  22.         op stop interval="0" timeout="80s" \
  23.         op monitor interval="10s" timeout="60s"\
  24.         meta failure-timeout="40s"
  25.      
  26.  
  27.  
  28. #cloning
  29. 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"
  30. pcs resource clone Ping  globally-unique="false" target-role="Started"
  31.  
  32. #ping rules
  33. pcs constraint location DBClusterIP rule score=-INFINITY not_defined pingd or pingd eq 0
  34. pcs constraint location mspostgres rule score=-INFINITY not_defined pingd or pingd eq 0
  35.  
  36. #locations
  37. pcs constraint location mspostgres prefers DBHA=90
  38. pcs constraint location mspostgres prefers FAILOVERHA=80
  39.  
  40. #colocations
  41. pcs constraint colocation add DBClusterIP with Master mspostgres score=INFINITY
  42.  
  43. #ordering
  44.  
  45. pcs constraint order stop DBClusterIP  then demote mspostgres  kind=Optional symmetrical=false
  46.  
  47. #cluster-properties
  48. pcs property set cluster-recheck-interval=5min
  49. pcs property set stonith-enabled=false
  50. pcs property set no-quorum-policy=ignore
  51. pcs resource defaults migration-threshold=3
  52. pcs property set placement-strategy=balanced
  53. pcs property set stop-all-resources=false
  54. # default - options
  55. pcs resource defaults failure-timeout=2000
  56. pcs resource defaults resource-stickiness=100
  57. pcs resource op defaults on-fail=restart
Add Comment
Please, Sign In to add comment