基于Ubuntu 14.04 Pacemaker+Corosync+Drbd+Mysql主备

本文详细介绍了如何在Ubuntu 14.04系统上搭建基于Pacemaker、Corosync和Drbd的MySQL主备高可用集群。首先,讲述了Drbd设备的安装过程;接着,介绍了Corosync心跳程序的安装和配置;然后,逐步讲解了Pacemaker的安装和配置,包括服务资源的设定;最后,提到了Pacemaker的维护操作和STONITH fencing机制的配置注意事项。
摘要由CSDN通过智能技术生成

1.Drbd设备安装

参见上一篇博客 http://blog.csdn.net/nnuljl/article/details/38266737

2.心跳程序Corosync

安装心跳程序,在两个节点均安装corosync

apt-get install -y --force-yes corosync

开启corosync。 可能遇到的问题server corosync start 无响应

root@controller1:~# vim /etc/default/corosync
# start corosync at boot [yes|no]
START=yes
~                                                                                                                                            
~     
将原来默认的no,修改为yes,否则service corosync start 无反应

3.配置Corosync

root@controller1:~# vim /etc/corosync/corosync.conf


配置文件如下

totem {
        version: 2

        # How long before declaring a token lost (ms)
        token: 3000

        # How many token retransmits before forming a new configuration
        token_retransmits_before_loss_const: 10
# Please read the openais.conf.5 manual page

totem {
        version: 2

        # How long before declaring a token lost (ms)
        token: 3000

        # How many token retransmits before forming a new configuration
        token_retransmits_before_loss_const: 10

        # How long to wait for join messages in the membership protocol (ms)
        join: 60

        # How long to wait for consensus to be achieved before starting a new round of membership configuration (ms)
        consensus: 3600

        # Turn off the virtual synchrony filter
        vsftype: none

        # Number of messages that may be sent by one processor on receipt of the token
        max_messages: 20

        # Limit generated nodeids to 31-bits (positive signed integers)
        clear_node_high_bit: yes

        # Disable encryption
        secauth: off

        # How many threads to use for encryption/decryption
        threads: 0

        # Optionally assign a fixed node id (integer)
        # nodeid: 1234

        # This specifies the mode of redundant ring, which may be none, active, or passive.
        rrp_mode: active

        interface {
                # The following values need to be set based on your environment 
                ringnumber: 0
                bindnetaddr: 192.168.2.11
                mcastaddr: 226.94.1.4
                mcastport: 5405
        }
        interface {
                ringnumber: 1
                bindnetaddr: 192.168.99.2
                mcastaddr: 226.94.1.4
                mcastport:5405
        }

}

amf {
        mode: disabled
}

quorum {
        # Quorum for the Pacemaker Cluster Resource Manager
        provider: corosync_votequorum
        expected_votes: 1
}

aisexec {
        user:   root
        group:  root
}

logging {
        fileline: off
        to_stderr: yes
        to_logfile: yes
        logfile: /var/log/corosync/corosync.log
        to_syslog: yes
        syslog_facility: daemon
        debug: off
        timestamp: on
        logger_subsys {
                subsys: AMF
                debug: off
                tags: enter|leave|trace1|trace2|trace3|trace4|trace6
        }
}
# Now this is just for test, add a comment
需要修改配置的地方为totem域内的interface

rrp_mode: active

        interface {
                # The following values need to be set based on your environment 
                ringnumber: 0
                bindnetaddr: 192.168.2.11
                mcastaddr: 226.94.1.4
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值