码迷,mamicode.com
首页 > 数据库 > 详细

Galera MariaDB 搭建

时间:2014-09-24 19:27:08      阅读:456      评论:0      收藏:0      [点我收藏+]

标签:galera mariadb

1.安装服务包组:

yum -y install mariadb-galera mariadb-galera-server xtrabackup

2.修改配置文件

vim /etc/my.cnf.d/galera.cnf

修改如下参数:

wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://"
wsrep_node_address=172.16.0.11
wsrep_sst_auth=
sst:sstpass123
wsrep_sst_method=xtrabackup

注:wsrep_cluster_address="gcomm://"

3. 在/etc/my.cnf中加入如下行:

!includedir /etc/my.cnf.d/

 

4. 设置开机启动MariaDB

chkconfig mysqld on

5. 确认MariaDB已正确安装并处于运行状态

service mysqld start
mysql -uroot -p
Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 14Server version: 5.5.36-MariaDB-wsrep MariaDB Server, wsrep_25.9.r3961Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

如果有wsrep字样输出,则说明安装正常。

6. 设置MariaDB的root密码,并做安全加固

/usr/bin/mysql_secure_installation

7. 在mysql中新建sst用户

mysql -u root -p
mysql> GRANT USAGE ON *.* to sst@‘%‘ IDENTIFIED BY ‘sstpass123‘;
mysql> GRANT ALL PRIVILEGES on *.* to sst@‘%‘;
mysql> GRANT USAGE ON *.* to sst@‘localhost‘ IDENTIFIED BY ‘sstpass123‘;
mysql> GRANT ALL PRIVILEGES on *.* to sst@‘localhost‘;
mysql> FLUSH PRIVILEGES;
mysql> quit

8.新增节点参见步骤1-4。


Galera MariaDB 搭建

标签:galera mariadb

原文地址:http://shine009.blog.51cto.com/2548914/1557779

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!