`

有关Mysql master/slave replication的应用

阅读更多
Mysql master/slave replication这个架构非常成熟。我们已经基于它做了3、4年开发了。既可以支持高可用性双机备份系统的建立,也可以支持通过读写分离提高数据库写入和读出性能。有文章说在主服务器上更新二进制日志的额外开销对性能有1%的影响,具体数字怎么得出来的没有考证。但我们系统的压力测试分别在单一Master和Master-Slave两种情况下运行,没有看到明显性能差异。

在实际运营的系统上,基于Mysql master/slave的中心数据库的系统处理每天500万次业务,可以保证7*24小时的服务。无论是系统在线升级,还是单点宕机冗余。且master/slave可以迅速的切换。当你需要slave作为master时,可以slave Mysql很快的变为master Mysql。Mysql master/slave replication是基于Mysql BinLog,因此如果使用这个feature,必须要打开Mysql BinLog。master把更新的内容写到binlog中,并维护了一个索引文件来记录当前binlog更新的位置。

详细内容请参看Mysql中文网(http://imysql.cn/2006_05_17_mysql_replication_1)。

master-slave构架可以有效的提高Mysql的读写效率,这在我的“构建高性能Java服务器”中有更详细的公式证明。

0
1
分享到:
评论

相关推荐

    mysql master/slave介绍及配置

    Master-Slave的数据库机构解决了很多问题,特别是read/write比较高的web2.0应用: 1、写操作全部在Master结点执行,并由Slave数据库结点定时(默认60s)读取Master的bin-log 2、将众多的用户读请求分散到更多的...

    mysql5.5 master-slave(Replication)配置方法

    mysql5.5 master-slave(Replication)配置方法,需要的朋友可以参考下。

    MySQL-Master_Slave_repl.txt

    mysql> grant replication slave on *.* to 'sree'@'%'   Refresh permissions mysql> flush privileges mysql> show master status; | File | Position | master-bin.000004 | 120   Slave configuration =...

    mysql5.5 master-slave(Replication)主从配置

    一主一从: Master: OS:centos release 5.6 DB:mysql 5.5.8 IP:192.168.1.2 Slave: OS:centos release 5.6 DB:mysql 5.5.8 IP:192.168.1.3 修改主机Master配置文件 (/etc/my.cnf) 代码如下: [mysqld] //至少要有...

    mysql镜像备份mysql镜像备份

    mysql建立镜像数据库- - Tag: mysql建立镜像数据库 ...grant replication slave,reload,super on *.* to 'slave_user'@'host' identified by 'slave_pass' 也可以用load data from master命令,建立从数据库。

    master and slave have equal MySQL server ids

    代码如下:Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the –replicate-same-...

    master and slave have equal MySQL server UUIDs 解决方法

    使用rsync配置了大量mysql,省去了大量编译和配置的时间,随逐个修改master和slave服务器的my.cnf,后,发现数据不能同步,在slave服务器show slave status: Fatal error: The slave I/O thread stops because ...

    MySQL5.6同步白皮书

    on how to install and configure a master/slave topology, as well as handle failover events . It demonstrates how to do this using Global Transaction Identifiers (GTIDs) as well as the extra steps ...

    MySQL-group-replication 配置步骤(推荐)

    它在master-slave 之间实现了强一致性, 但是就目前来说主要是性能不太好。 【1】确定当前的mysql数据库版本为5.7.17及以上 /usr/local/mysql/bin/mysqld --version /usr/local/mysql/bin/mysqld Ver 5.7.17 for ...

    mysql5.7 主从配置docker配置文件

    grant replication slave,replication client on *.* to 'user1'@'%' identified by '1'; flush privileges; show master status; 记录file和pos,用在slave中的master_log_file和master_log_pos中。 在slave...

    mysql读写分离实现.doc

    database集群采用mysql的master-slave的replication方案。 适合人群:对mysql有一定基础的朋友 使用场景及目标:当数据库访问并发量非常大,性能急剧下降时,先进行读写分离。通过本次案例实战,掌握mysql读写分离的...

    mysql binlog日志恢复【亲测有效,有例子实测】

    二进制日志(binnary log)以事件形式记录了...主从复制:mysql replication在master端开启binlog,master把它的二进制日志传递给slaves来达到master-slave数据一致的目的。 数据恢复:通过mysqlbinlog工具来恢复数据。

    MySQL进阶-高可用、分布式、主从复制原理、备份恢复

    主从复制 (Master-Slave Replication):一个主服务器处理写操作,一个或多个从服务器处理读操作。 集群解决方案:如MySQL Group Replication, MySQL NDB Cluster等。 自动故障转移:当主服务器宕机时,自动将一个从...

    mysql读写分离实现

    在本次实战中,应用程序client基于c3p0连接后端的database proxy。database proxy负责管理client实际访问database的路由策略,采用开源框架amoeba。database集群采用mysql的master-slave的replication方案。

    mysql-8-cookbook2018

    to chain replication and switching a slave from chain replication to master-slave is something that will interest the readers. Chapter 10, Table Maintenance, covers cloning tables. Managing big tables...

    Mysql主从同步备份策略

    mysql> grant replication slave on *.* to slave@192.168.0.2 identified by ‘111111′; # grant replication slave on *.* to ‘用户名’@'主机’ identified by ‘密码’; # 可在Slave上做连接测试: mysql -h ...

    MySQL Group Replication 搭建.docx

    本资源详细描述MySQL MGR搭建的过程,每一步都演示步骤及slave 或 master 宕机测试,及恢复后如何重新加入组,绝对一次成功

    基于MySQL数据库复制Master-Slave架构的分析

    为了应用系统的可伸缩性,往往需要对数据库进行scale out设计,scale out设计也就是通过增加数据库处理节点来提高系统整体的处理能力,即...MySQL的Replication技术就是数据库复制的实现手段之一。 关于MySQL的Repli

Global site tag (gtag.js) - Google Analytics