corosync+pacemaker+RA实现MySQL高可用(3)
日期:2020-10-12 栏目:程序人生 浏览:次
4.2 corosync的配置文件
node1: # cd /etc/corosync/corosync.conf.example /etc/corosync/corosync.conf #vim /etc/corosync.conf 修改内容如下: secauth: on bindnetaddr: 172.16.0.0 mcastaddr: 226.99.1.1 to_logfile: yes to_syslog: no 接着编辑添加如下内容: service { ver: 0 name: pacemaker use_mgmtd: yes } aisexec { user: root group: root } 生成节点间通信时用到的认证密钥文件: # corosync-keygen //会自动的在/etc/corosync目录下生成一个key文件,是二进制格式的,权限为400 将corosync和authkey复制至node2: # scp -p authkey corosync.conf node2:/etc/corosync/ 分别为两个节点创建corosync生成的日志所在的目录: # mkdir /var/log/cluster # ssh node2 'mkdir /var/log/cluster' 启动服务 # service corosync start # ssh node2 '/etc/init.d/corosync start' 查看工作状态 # crm status ============ Last updated: Tue Aug 21 09:07:33 2012 Stack: openais Current DC: node1 - partition with quorum Version: 1.1.5-1.1.el5-01e86afaaa6d4a8c4836f68df80ababd6ca3902f 2 Nodes configured, 2 expected votes 0 Resources configured. ============ Online: [ node1 node2 ] 