jy166102 发表于 2018-7-31 06:28:54

ansible+corosync+pacemaker实现对web服务高可用

# vim /etc/corosync/corosync.conf  
# corosync-keygen
  
Corosync Cluster Engine Authentication key generator.
  
Gathering 1024 bits for key from /dev/random.
  
Press keys on your keyboard to generate entropy.
  
Writing corosync key to /etc/corosync/authkey.
  
# ansible webservice -m copy -a "src=/etc/corosync/authkey dest=/etc/corosync"
  
node1.corosync.com | success >> {"changed": true, "dest": "/etc/corosync/authkey", "gid": 0, "group": "root", "md5sum": "b8db2726121363c4695615d8cc8ce1ff", "mode": "0644", "owner": "root", "size": 128, "src": "/root/.ansible/tmp/ansible-tmp-1398234483.99-122742266566782/source", "state": "file", "uid": 0
  
}
  

  
node2.corosync.com | success >> {"changed": true, "dest": "/etc/corosync/authkey", "gid": 0, "group": "root", "md5sum": "b8db2726121363c4695615d8cc8ce1ff", "mode": "0644", "owner": "root", "size": 128, "src": "/root/.ansible/tmp/ansible-tmp-1398234484.2-198090798386440/source", "state": "file", "uid": 0
  
}
  

  
# ansible webservice -m copy -a "src=/etc/corosync/corosync.conf dest=/etc/corosync"
  
node1.corosync.com | success >> {"changed": true, "dest": "/etc/corosync/corosync.conf", "gid": 0, "group": "root", "md5sum": "906edcbefac607609795d78c0da57be3", "mode": "0644", "owner": "root", "size": 519, "src": "/root/.ansible/tmp/ansible-tmp-1398234502.27-114754154513206/source", "state": "file", "uid": 0
  
}
  

  
node2.corosync.com | success >> {"changed": true, "dest": "/etc/corosync/corosync.conf", "gid": 0, "group": "root", "md5sum": "906edcbefac607609795d78c0da57be3", "mode": "0644", "owner": "root", "size": 519, "src": "/root/.ansible/tmp/ansible-tmp-1398234502.61-246106036244835/source", "state": "file", "uid": 0
  
}
页: [1]
查看完整版本: ansible+corosync+pacemaker实现对web服务高可用