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

MySql集群FAQ----mysql主从配置与集群区别、集群中需要多少台计算机呢?为什么? 等

时间:2016-02-15 18:11:28      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:

抽取一部分显示在这里,如下,

What‘s the difference in using Cluster
vs using replication?

在复制系统中,一个MySQL主服务器会更新一个或多个从服务器.事务是顺序地提交的,因此一个慢事务就可能导致从服务器比主服务器落后一段时间.这也意 味着,如果主服务器出错失败了,那么从服务器可能会缺少记录最后的那一小部分事务日志.如果使用的是事务安全存储引擎的话,例如InnoDB, 那么事务日志则会完全记录到从服务器上去或者完全不记录,但是复制不能保证主和从服务器上的数据总是保持一致性.在MySQL集群中,所有的数据总是保持 同步,在任何数据节点上提交的事务都同步到所有其他的数据节点上了.如果有一个数据节点失败了,其他正常的数据节点照样能保持数据的一致性.

In a replication setup, a master MySQL server updates one or
more slaves. Transactions are committed sequentially, and a
slow transaction can cause the slave to lag behind the
master. This means that if the master fails, it is possible
that the slave might not have recorded the last few
transactions. If a transaction-safe engine such as
InnoDB is being used, a transaction will
either be complete on the slave or not applied at all, but
replication does not guarantee that all data on the master
and the slave will be consistent at all times. In MySQL
Cluster, all data nodes are kept in synchrony, and a
transaction committed by any one data node is committed for
all data nodes. In the event of a data node failure, all
remaining data nodes remain in a consistent state.

In short, whereas standard MySQL replication is
asynchronous, MySQL Cluster is synchronous.

We have implemented (asynchronous) replication for Cluster
in MySQL 5.1. This includes the capability to replicate both
between two clusters, and from a MySQL cluster to a
non-Cluster MySQL server. However, we do not plan to
backport this functionality to MySQL 5.0.

How many computers do I need to run a cluster, and why?

集群最少要求有3台计算机.不过我们建议最好是4台;有2台分别运行管理节点和SQL节点,另外2台作为数据节点.采取2台数据节点的目的是提高数据的冗余度,管理节点放在一个独立的主机上是为了能够保证在万一有一台数据节点失败的情况下提供仲裁服务.

A minimum of three computers is required to run a viable
cluster. However, the minimum
recommended number of
computers in a MySQL Cluster is four: one each to run the
management and SQL nodes, and two computers to serve as data
nodes. The purpose of the two data nodes is to provide
redundancy; the management node must run on a separate
machine to guarantee continued arbitration services in the
event that one of the data nodes fails.

To provide increased throughput and high availability, you
should use multiple SQL nodes (MySQL Servers connected to
the cluster). It is also possible (although not strictly
necessary) to run multiple management servers.

参考:A.10. MySQL 5.0 FAQ — 集群

A.10 MySQL 5.6 FAQ: MySQL Cluster

MySql集群FAQ----mysql主从配置与集群区别、集群中需要多少台计算机呢?为什么? 等

标签:

原文地址:http://www.cnblogs.com/langtianya/p/5190793.html

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