centos7下部署mariadb+galera数据库高可用集群
[root@node1 ~]# cat /etc/yum.repos.d/mariadb.repo
# MariaDB 10.1 CentOS repository list - created 2016-05-24 07:59 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
yum --enablerepo=mariadb -y install MariaDB-server galera
配置第一个节点:
[root@node1 ~]# cat /etc/my.cnf.d/server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#
# * Galera-related settings
#
[galera]
# Mandatory settings
wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://node1,node2,node3”"
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
bind-address=0.0.0.0
wsrep_cluster_name="MariaDB_Cluster"
wsrep_node_address="10.61.98.85"
wsrep_node_name=node1
wsrep_sst_method=rsync
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0
# this is only for embedded server
[embedded]
# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
# This group is only read by MariaDB-10.1 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.1]
[root@node1 ~]#
启动集群:/bin/galera_new_cluster
设置root用户密码:mysql_secure_installation
配置第二个节点:
[root@node2 ~]# cat /etc/my.cnf.d/server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#
# * Galera-related settings
#
[galera]
# Mandatory settings
wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://node1,node2,node3”"
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
bind-address=0.0.0.0
wsrep_cluster_name="MariaDB_Cluster"
wsrep_node_address="10.61.98.84"
wsrep_node_name=node2
wsrep_sst_method=rsync
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0
# this is only for embedded server
[embedded]
# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
# This group is only read by MariaDB-10.1 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.1]
[root@node2 ~]#
启动集群节点:systemctl start mariadb
配置第三个节点:
[root@node3 ~]# cat /etc/my.cnf.d/server.cnf
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#
# * Galera-related settings
#
[galera]
# Mandatory settings
wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://node1,node2,node3”"
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
bind-address=0.0.0.0
wsrep_cluster_name="MariaDB_Cluster"
wsrep_node_address="10.61.98.83"
wsrep_node_name=node3
wsrep_sst_method=rsync
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0
# this is only for embedded server
[embedded]
# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
# This group is only read by MariaDB-10.1 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.1]
[root@node3 ~]#
启动集群节点:systemctl start mariadb
注:当集群宕机时,运行了/bin/galera_new_cluster命令的节点先启动
centos7下部署mariadb+galera数据库高可用集群的更多相关文章
- [转帖]Breeze部署kubernetes1.13.2高可用集群
Breeze部署kubernetes1.13.2高可用集群 2019年07月23日 10:51:41 willblog 阅读数 673 标签: kubernetes 更多 个人分类: kubernet ...
- 使用Ansible部署etcd 3.2高可用集群
之前写过一篇手动搭建etcd 3.1集群的文章<etcd 3.1 高可用集群搭建>,最近要初始化一套新的环境,考虑用ansible自动化部署整套环境, 先从部署etcd 3.2集群开始. ...
- 部署kubernetes1.8.3高可用集群
Kubernetes作为容器应用的管理平台,通过对pod的运行状态进行监控,并且根据主机或容器失效的状态将新的pod调度到其他node上,实现了应用层的高可用. 针对kubernetes集群,高可用性 ...
- MySQL数据库高可用集群搭建-PXC集群部署
Percona XtraDB Cluster(下文简称PXC集群)提供了MySQL高可用的一种实现方法.集群是有节点组成的,推荐配置至少3个节点,但是也可以运行在2个节点上. PXC原理描述: 分布式 ...
- galera+mycat高可用集群部署
环境描述 10.30.162.29 client 环境描述 10.30.162.29 client 10.30.162.72 mysql1 10.30.162.73 mysql2 10.30.162 ...
- 七台机器部署Hadoop2.6.5高可用集群
1.HA架构注意事项 两个Namenode节点在某个时间只能有一个节点正常响应客户端请求,响应请求的节点状态必须是active standby状态要能够快速无缝切换成active状态,两个NN节点必须 ...
- 配置drbd高可用集群
前期准备: 同步时间 (两个节点) 节点一(172.16.21.6) [root@stu21 heartbeat2]# ntpdate 172.16.0.1 31 Dec 20:59:25 ntpda ...
- Centos7.5基于MySQL5.7的 InnoDB Cluster 多节点高可用集群环境部署记录
一. MySQL InnoDB Cluster 介绍MySQL的高可用架构无论是社区还是官方,一直在技术上进行探索,这么多年提出了多种解决方案,比如MMM, MHA, NDB Cluster, G ...
- Centos7.6部署k8s v1.16.4高可用集群(主备模式)
一.部署环境 主机列表: 主机名 Centos版本 ip docker version flannel version Keepalived version 主机配置 备注 master01 7.6. ...
随机推荐
- zabbix批量添加被监控windows客户端
由于公司大部分用的是windows服务器,大概有50多台.如果是一台一台添加的话很是麻烦,如果数量更多的话那工作量可想而知.所以网络管理员通常都是非常懒的. 环境:公司虽是域环境,但是除了几台域服务器 ...
- JSP学习1---创建一个简单的jsp程序
一.新建一个“Dynamic Web Project”动态Web项目 1.1输入项目名称 Project1,在Dynamic Web module version(动态Web模块版本),选择3.0(注 ...
- MongoDB解压报错gzip: stdin: not in gzip format的解决方法
MongoDB解压报错gzip: stdin: not in gzip format的解决方法 在安装MongoDB时出现如下报错: [root@vm172--- mongodb]# tar -zxv ...
- Gradle的使用及下载
1在官网下载Gradle 基本学这个的都有JDK和JVM所以只需要在环境变量中配置即可 点击hettp://start.spring.io/即可使用
- MVC4 5分页控件,支持Ajax AjaxOption支持
MVC4 5分页控件,支持Ajax AjaxOption支持 /// <summary> /// MVC4 5分页控件,支持Ajax AjaxOption支持 beta 1.0 /// 用 ...
- vivado源文件和仿真文件的建立
目的:做一个3输入,1输出模块:其中只要有2个输入为1则输出为1: 1.打开vivado创建一个工程 2.选择保存路径和名称 3.选择创建rtl文件且勾选下面的选项 4.选择芯片如xc7a35tift ...
- Ubuntu上的MySQL可以远程访问
1. 3306端口是不是没有打开? 使用nestat命令查看3306端口状态: ~# netstat -an | grep 3306 tcp 0 0 127.0.0.1:330 ...
- uWSGI的配置与发布
参考: https://www.cnblogs.com/pyyu/p/9481344.html 一.什么是wsgi, uwsgi, uWSGI wsgi 全称web server gateway ...
- springmvc简单的流程说明及源码分析
框架流程图 springmvc的核心类org.springframework.web.servlet.DispatcherServlet,是一个servlet,间接继承了httpservlet;重写了 ...
- Java中的static修饰int值做全局变量与static修饰词初始化顺序
先看一道题 public class HasStatic{ private static int x=100; public static void main(String args[]){ HasS ...