程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> MYSQL數據庫 >> MySQL綜合教程 >> MySQL集群核心概念

MySQL集群核心概念

編輯:MySQL綜合教程

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 --ndbcluster and --ndb-connectstring options, which are explained elsewhere in this chapter, possibly with additional MySQL server options as well.

An SQL node is actually just a specialized type of API node, which designates any application which accesses MySQL Cluster data. Another example of an API node is the ndb_restore utility that is used to restore a cluster backup. It is possible to write such applications using the NDB API. For basic information about the NDB API, see Getting Started with the NDB API.

SQL節點(SQL node):這種節點是用於訪問集群數據的。對於MySQL集群來講,一個SQL節點是一個傳統的MySQL服務,它使用NDBCLUSTER存儲引擎。一個SQL節點是通過mysqld命令的--ndbcluster和--ndb-connectstring參數來啟動的進程,該選項在本章的其他地方會解釋到,用其他的MySQL服務選項也可以做到。

一個SQL節點實際上只是API node的一種專用類型,該類型的節點指定了任何可以訪問MySQL集群數據的應用程序。API node的另外一個例子是node_restore功能,它能夠被用來恢復一個集群備份。用NDB API去寫應用程序是有可能做到的,有關於NDB API的基本信息,請見Getting Started with the NDB API.

Important The Memcache API for MySQL Cluster, implemented as the loadable ndbmemcache storage engine for memcached version 1.6 and later, can be used to provide a persistent MySQL Cluster data store, accessed using the memcache protocol. The standard memcached caching engine is included in the MySQL Cluster NDB 7.3 distribution. Each memcached server has direct access to data stored in MySQL Cluster, but is also able to cache data locally and to serve (some) requests from this local cache. For more information, see ndbmemcache—Memcache API for MySQL Cluster.  Management clients. These clients connect to the management server and provide commands for starting and stopping nodes gracefully, starting and stopping message tracing (debug versions only), showing node versions and status, starting and stopping backups, and so on. An example of this type of program is the ndb_mgm management client supplied with MySQL Cluster (see Section 18.4.5, “ndb_mgm — The MySQL Cluster Management Client”). Such applications can be written using the MGM API, a C-language API that communicates directly with one or more MySQL Cluster management servers. For more information, see The MGM API.

Cluster log: Keeps a record of all desired reportable events for the cluster as a whole.

Node log: A separate log which is also kept for each individual node.

事件日志:MySQL集群通過種類(啟動,關機,錯誤,檢查點等等),優先級和嚴重性的事件產生日志。一個有關完整的報告性事件的監聽,可以在Section 18.5.6,“Event Reports Generated in MySQL Cluster”文章中找到。事件日志在這裡有兩種類型:

l 集群日志:針對於集群,以保存一份期望的可報告性的事件記錄作為一個整體。

l 節點日志:一個單獨的日志維護著每一個單一的節點。

Note

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved