MySQL集群核心概念(一)

2014-11-24 13:50:19 · 作者: · 浏览: 0

MySQL Cluster Core Concepts

NDBCLUSTER (also known as NDB) is an in-memory storage engine offering high-availability and data-persistence features.
NDBCLUSTER(也叫做NDB)是一种提供了高可用性和数据持久性特征的内存式存储引擎。
The NDBCLUSTER storage engine can be configured with a range of failover and load-balancing options, but it is easiest to start with the storage engine at the cluster level. MySQL Cluster's NDB storage engine contains a complete set of data, dependent only on other data within the cluster itself.
NDBCLUSTER存储引擎能够配置一系列的故障切换和负载均衡功能,然而它也是在集群级别下最容易入手的存储引擎。MySQL集群的NDB存储引擎包含一套完整的数据集,它仅依赖于在集群本身中的其他数据。
The “Cluster” portion of MySQL Cluster is configured independently of the MySQL servers. In a MySQL Cluster, each part of the cluster is considered to be a node.
MySQL集群的Cluster部分是独立配置在MySQL服务上面的。在MySQL集群中,集群的每个部分都被看做是一个节点(node)
Note
In many contexts, the term “node” is used to indicate a computer, but when discussing MySQL Cluster it means a process. It is possible to run multiple nodes on a single computer; for a computer on which one or more cluster nodes are being run we use the term cluster host.
注解:
在多数情况下,node这个术语用于表示一台计算机,但是当讨论MySQL集群时,则它意味着是一个进程。在一台单独的PC机上能够运行多个node节点;在PC机上正在运行的一个或多个集群节点,我们通常把他称为集群主机(cluster host)
There are three types of cluster nodes, and in a minimal MySQL Cluster configuration, there will be at least three nodes, one of each of these types:
集群的节点有三种类型,在最低限度的MySQL集群配置中,每一种类型的节点要有一个,至少要有三个节点:

Management node: The role of this type of node is to manage the other nodes within the MySQL Cluster, performing such functions as providing configuration data, starting and stopping nodes, running backup, and so forth. Because this node type manages the configuration of the other nodes, a node of this type should be started first, before any other node. An MGM node is started with the command ndb_mgmd.

管理节点(Management node):这种节点的任务主要是在MySQL集群中管理其他节点。执行诸如提供配置数据,打开节点,关闭节点,运行备份等等相应功能。由于这种类型的节点管理着其他节点的配置,因此该节点应先于其他节点启动。一个MGM节点是通过ndb_mgmd命令来启动的。

Data node: This type of node stores cluster data. There are as many data nodes as there are replicas, times the number of fragments (see Section 18.1.2, “MySQL Cluster Nodes, Node Groups, Replicas, and Partitions”). For example, with two replicas, each having two fragments, you need four data nodes. One replica is sufficient for data storage, but provides no redundancy; therefore, it is recommended to have 2 (or more) replicas to provide redundancy, and thus high availability. A data node is started with the command ndbd (see Section 18.4.1, “ndbd — The MySQL Cluster Data Node Daemon”) or ndbmtd (see Section 18.4.3, “ndbmtd — The MySQL Cluster Data Node Daemon (Multi-Threaded)”).

MySQL Cluster tables are normally stored completely in memory rather than on disk (this is why we refer to MySQL Cluster as an in-memory database). However, some MySQL Cluster data can be stored on disk; see Section 18.5.12, “MySQL Cluster Disk Data Tables”, for more information.

数据节点(Data node):这种类型的节点用于存储集群数据。很多的数据节点都有它们的副本,是该分段的一倍。例如,每两个分段就有两个副本,你就需要有四个数据节点。对于数据存储,一个副本是足够的,但是它不提供冗余。因此,我们推荐用两个(或更多)副本去提供冗余,从而实现高可用性。一个数据节点是通过ndbd或ndbmtd命令来启动的。

MySQL集群表通常是完整的存储在内存中的,而不是在硬盘上(这就是为什么我们把MySQL集群称为内存式数据库)。然而,有一些MySQL集群数据是可以存储在硬盘上的。

SQL node: This is a node that accesses the cluster data. In the case of MySQL Cluster, an SQL node is a traditional MySQL server that uses the NDBCLUSTER storage engine. An SQL node is a mysqld process started with the --ndbc