MySQL基于 amoeba.xml的读写分离
1、准备两台服务器 centos7
192.168.52.35
192.168.52.36
2、关闭防火墙
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce
3、两台都下载mysql
yum -y install mariadb mariadb-server
4、编辑MySQL配置文件
第一台:
[root@localhost ~]# vim /etc/my.cnf [mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd server-id= #添加
log-bin=mysql-bin #添加
relay-log=mysql-relay #添加
第二台:
[root@localhost ~]# vim /etc/my.cnf [mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd server-id= #添加
log-bin=mysql-bin #添加
relay-log=mysql-relay #添加
5、开启mysql服务
systemctl restart mariadb
6、进入第一台主的服务器
[root@localhost ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 5.5.-MariaDB MariaDB Server Copyright (c) , , Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> create user tom;
Query OK, rows affected (0.00 sec) MariaDB [(none)]> grant all on *.* to'tom'@'192.168.52.36' identified by '';
Query OK, rows affected (0.00 sec) MariaDB [(none)]> flush privileges;
Query OK, rows affected (0.00 sec) MariaDB [(none)]> show master status;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin. | | | |
+------------------+----------+--------------+------------------+
row in set (0.00 sec) MariaDB [(none)]>
打开第二台的mysql
[root@localhost ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 5.5.-MariaDB MariaDB Server Copyright (c) , , Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> stop slave;
Query OK, rows affected, warning (0.00 sec) MariaDB [(none)]> change master to
-> master_host='192.168.52.35',
-> master_password='',
-> master_user='tom',
-> master_log_file='mysql-bin.000003',
-> master_log_pos=;
Query OK, rows affected (0.01 sec) MariaDB [(none)]> flush privileges;
Query OK, rows affected (0.00 sec) MariaDB [(none)]> start slave;
Query OK, rows affected (0.00 sec)

Slave_IO_Running: Yes #这俩个要变成yes才算成功
Slave_SQL_Running: Yes
MySQL基于 amoeba.xml的读写分离的更多相关文章
- 从零开始:Mysql基于Amoeba的集群搭建
从零开始:Mysql基于Amoeba的集群搭建 准备环境 1.mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz 2.amoeba-mysql-binary-2.0. ...
- 分布式架构高可用架构篇_08_MyCat在MySQL主从复制基础上实现读写分离
参考: 龙果学院http://www.roncoo.com/share.html?hamc=hLPG8QsaaWVOl2Z76wpJHp3JBbZZF%2Bywm5vEfPp9LbLkAjAnB%2B ...
- 高可用架构篇--MyCat在MySQL主从复制基础上实现读写分离
实战操作可参考:http://www.roncoo.com/course/view/3117ffd4c74b4a51a998f9276740dcfb 一.环境 操作系统:CentOS-6.6-x86_ ...
- Mysql多实例安装+主从复制+读写分离 -学习笔记
Mysql多实例安装+主从复制+读写分离 -学习笔记 .embody{ padding:10px 10px 10px; margin:0 -20px; border-bottom:solid 1px ...
- Mysql主从配置,实现读写分离
大型网站为了软解大量的并发访问,除了在网站实现分布式负载均衡,远远不够.到了数据业务层.数据访问层,如果还是传统的数据结构,或者只是单单靠一台服务器扛,如此多的数据库连接操作,数据库必然会崩溃,数据丢 ...
- 黄聪:Mysql主从配置,实现读写分离
大型网站为了软解大量的并发访问,除了在网站实现分布式负载均衡,远远不够.到了数据业务层.数据访问层,如果还是传统的数据结构,或者只是单单靠一台服务器扛,如此多的数据库连接操作,数据库必然会崩溃,数据丢 ...
- Mysql 之主从复制,mysql-proxy读写分离
准备两台mysql服务器,master(192.168.43.64).slave(192.168.84.129) master配置: log-bin=mysql-bin binlog_format=m ...
- Mysql 基于 Amoeba 的 读写分离
首先说明一下amoeba 跟 MySQL proxy在读写分离的使用上面的区别: 在MySQL proxy 6.0版本 上面如果想要读写分离并且 读集群.写集群 机器比较多情况下,用mysql pro ...
- linux上使用amoeba实现MySql集群,以及读写分离,主从复制
一.由于是MySql集群,所以就不可能只有一个MySql,需要多个MySql,具体安装步骤,可以参考http://www.cnblogs.com/ywzq/p/4882140.html这个地址进行安装 ...
随机推荐
- python字符串各种颜色输出
\033[1;31;40m # 1是显示方式(可选),31是字体颜色,40m 是字体背景颜色: \033[0m # 恢复终端默认颜色,即取消颜色设置: #!/usr/bi ...
- 标签一致项(LC-KSVD)-全文解读
Learning A Discriminative Dictionary for Sparse Coding via Label Consistent K-SVD 1,同步学习判决字典和线性分类器 2 ...
- ES6高级技巧(四)
238 数字->二进制->补码->十进制 const bitwise = N => { if (N < 2) { return N == 0 ? 1 : 0 } /*转化 ...
- 【开源监控】Grafana介绍与安装
Grafana介绍与安装 Grafana介绍 场景:由于业务场景,有多个组织机构.需要在某个组织结构下,完成对本机构下的系统的实时监控以及可视化展示.底层已经用zabbix对监控指标做了数据的采集. ...
- Cookie,Session,Token and Oauth
Cookie 服务器端生成,发送给客户端,保存用户信息.下一次请求同一网站时会把该cookie发送给服务器. 应用:登录表单自动填充,同样 随着交互式Web应用的兴起,像在线购物网站,需要登录的网站等 ...
- BCryptPasswordEncoder 判断密码是否相同
加密 BCryptPasswordEncoder encode = new BCryptPasswordEncoder(); encode.encode(password); 比较 matches(C ...
- MySQL:实用 SQL 语句集合
写在前面的话 本文主要用于记录工作中不经常使用但是偶尔用到又非常有用的 SQL 语句,持续不断不定期更新. 数据库大小统计 1. 查看 MySQL 某个库的所有表大小,记录数,占用空间等. ,), ' ...
- 【问题记录】ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
一.问题描述 环境:MySQL 8.0 + Windows 由于密码错误或者其他原因导致无法连上MySQL服务,如下图: 二.解决方案 解决该问题的具体步骤如下: 1.关闭MySQL服务 以管理员权限 ...
- office2016下载安装
https://jingyan.baidu.com/article/359911f5acfa4357fe030631.html
- Delphi - TIdFTP 两个重要函数
TIdFTP 两个重要函数 项目开发过程中发现,直接对于服务器上的文件/路径进行处理,是很危险的事情,因为一旦文件/路径不存在,程序就会抛异常,影响客户体验.所以在对服务器上的文件/路径进行访问之前, ...