Corosync部署MySQL+DRBD高可用服务(2)

由于在el6系统的CentOS/RHEL中官方己将crm交互式命令行界面去除了,所以我们需要去互联网上去下载crmsh软件包;

# yum install corosync pacemaker -y

# yum install crmsh -y


四、配置Corosync服务

# cp /etc/corosync/corosync.conf.example /etc/corosync/corosync.conf

# cat /etc/corosync/corosync.conf

compatibility: whitetank

totem {

version: 2

secauth: on

threads: 0

interface {

ringnumber: 0

bindnetaddr: 192.168.100.0

mcastaddr: 226.94.112.12

mcastport: 5405

ttl: 1

}

}

logging {

fileline: off

to_stderr: no

to_logfile: yes

to_syslog: no

logfile: /var/log/cluster/corosync.log

debug: off

timestamp: off

logger_subsys {

subsys: AMF

debug: off

}

}

amf {

mode: disabled

}

service {

ver: 0

name: pacemaker

}

# corosync-keygen

# scp -p /etc/corosync/{corosync.conf,authkey} server13:/etc/corosync/

# chkconfig --add corosync

# chkconfig corosync off

五、安装mysql

二进制源码安装

[root@server13 ~]# # tar xf mysql-5.6.13-linux-glibc2.5-x86_64.tar.gz -C /usr/local/

[root@server13 ~]# # groupadd -g 3306 -r mysql

[root@server13 ~]# # useradd -g mysql -r -d /mydata/data mysql

[root@server13 ~]# # mkdir /mydata

[root@server13 ~]# # ln -s /usr/local/mysql-5.6.13-linux-glibc2.5-x86_64 /usr/local/mysql

[root@server13 ~]# # cd /usr/local/mysql

[root@server13 mysql]# chown -R root.mysql .

[root@server13 mysql]# scripts/mysql_install_db --user=mysql --datadir=/mydata/data

[root@server13 mysql]# cat my.cnf

datadir = /mydata/data

server_id = 1

socket = /tmp/mysql.sock

log_bin = mysql.bin

innodb_file_per_table = on

[root@server13 mysql]# cp -p support-files/mysql.server /etc/init.d/mysqld

[root@server13 mysql]# chkconfig --add mysqld

[root@server13 mysql]# chkconfig mysqld off

[root@server13 mysql]# service mysqld start

[root@server13 mysql]# cat /etc/profile.d/mysql.sh

[root@server13 mysql]# . /etc/profile.d/mysql.sh

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/09739b7b7f2201e5942e4edbbc7af285.html