MySQL NDB Cluster

来源:互联网 发布:淘宝图片包邮怎么设置 编辑:程序博客网 时间:2024/05/17 13:43

实验目的

一、英语阅读能力训练

二、文档阅读能力训练

三、扩展自己的知识面

准备工作

下载安装包

https://www.mysql.com/

 

http://mysqlhighavailability.com/mysql-cluster-7-3-auto-installer/

https://www.mysql.com/why-mysql/white-papers/guide-to-optimizing-performance-of-the-mysql-cluster/

这里选用7.4版本, 同mysql-5.6更兼容, 方便数据库迁移

https://cdn.mysql.com//Downloads/MySQL-Cluster-7.4/mysql-cluster-gpl-7.4.15-linux-glibc2.5-x86_64.tar.gz

https://cdn.mysql.com//Downloads/MySQL-Cluster-7.4/MySQL-Cluster-gpl-7.4.15-1.el6.x86_64.rpm-bundle.tar

 

查看压缩包

 

 背景色说明

蓝色背景是摘抄文档内容, 灰色背景为自己测试内容

 

服务器分配

各个节点需要安装的软件包

DataNode :

Although this installs all NDB Cluster binaries, only the programndbdorndbmtd(both in/usr/sbin) is actually needed to run an NDB Cluster data node. 

SQLNode:

This installs the MySQL server binary (mysqld) withNDBstorage engine support in the/usr/sbin
directory, as well as all needed MySQL Server support files. It also installs themysql.serverand
mysqld_safe startup scripts (in/usr/share/mysqland/usr/bin, respectively). The RPM
installer should take care of general configuration issues (such as creating themysqluser and group,if needed) automatically. 

 

从上面信息可以知道每个节点使用的软件:

Node

rpm

Use program

Data

MySQL-Cluster-server-gpl-7.4.15-1.el6.x86_64.rpm

ndbd, ndbmtd 

SQL

MySQL-Cluster-server-gpl-7.4.15-1.el6.x86_64.rpm

MySQL-Cluster-client-gpl-7.4.15-1.el6.x86_64.rpm

mysqld,

mysqld_safe

Management

MySQL-Cluster-server-gpl-7.4.15-1.el6.x86_64.rpm

ndb_mgmd,

ndb_mgm

 

 

 

 

根据文档介绍, 文档中使用架构

 

 

由于电脑配置有限, 这里准备三台虚拟机,服务器服务安装如下,虽然服务有重复,但是使用的组件不相同,应该可以同时安装。

Server

Host name

Node

66

Engine66

Management Node

65

Engine65

Data Node(nodeid3), SQL Node

64

Engine64

Data Node(nodeid2), SQL Node

 

 

 

 

 

 

Note

A number of RPMs used by NDB Cluster 7.1 were made obsolete and discontinued in NDB Cluster 7.3. These include the formerMySQL-Clusterclusterj,MySQL-Cluster-extra,MySQL-Cluster-management,MySQL-Cluster-storage,andNDB Cluster-toolsRPMs. The former contents of all of these packages are now included in the MySQL-Cluster-serverRPM. 

 

 

Installation

This section describes the basics for planning, installing, configuring, and running an NDB Cluster 

18.2.2 Installation of NDB Cluster on Linux 

 

卸载系统自带MySQL及相关文件

18.1.5 MySQL Server Using InnoDB Compared with NDB Cluster 

NDB Cluster完全独立于mysql, 避免冲突, 卸载MySQL

 

[root@engine64 ~]# yum -y remove mysql

[root@engine64 ~]# rpm -e --nodeps mysql-libs-5.1.73-7.el6.x86_64

删除配置文件, 启动脚本,环境变量, MySQL用户(在安装server的时候会自动创建)

[root@engine66 software]# rm -rf /etc/my.cnf.d/

[root@engine66 software]# rm -rf /etc/init.d/mysql

[root@engine66 software]# userdel -r mysql

[root@engine66 software]# vim /etc/profile

[root@engine66 software]# source /etc/profile

 

不知道什么原因, 卸载的时候没有卸载干净,就会出现下面的冲突。

file /usr/share/mysql/mysql_system_tables.sql from install of MySQL-Cluster-server-gpl-7.4.15-1.el6.x86_64 conflicts with file from package MySQL-server-5.6.35-1.el6.x86_64

 

[root@engine66 software]# rm -rf /usr/share/mysql/

[root@engine66 software]# rm -rf /usr/bin/mysql*

[root@engine66 software]# rm -rf /usr/local/mysql*

挨着把显示冲突的文件都删了, 还是不行。最后还是重新克隆一个虚拟机(这台虚拟机和其他两台不同的区别就是这台是用作mysql-proxy, 其他两台互为主从)。

 

 

 

Installing from RPM

18.2.2.2 Installing NDB Cluster from RPM 

Install Data Node

6465两台机器上分别安装server

[root@engine65 ~]# rpm -ivh MySQL-Cluster-server-gpl-7.4.15-1.el6.x86_64.rpm

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !

You will find that password in '/root/.mysql_secret'.

 

You must change that password on your first connect,

no other statement but 'SET PASSWORD' will be accepted.

See the manual for the semantics of the 'password expired' flag.

 

Also, the account for the anonymous user has been removed.

 

In addition, you can run:

 

  /usr/bin/mysql_secure_installation

 

which will also give you the option of removing the test database.

This is strongly recommended for production servers.

 

See the manual for more instructions.

 

Please report any problems at http://bugs.mysql.com/

 

The latest information about MySQL is available on the web at

 

  http://www.mysql.com

 

Support MySQL by buying support/licenses at http://shop.mysql.com

 

New default config file was created as /usr/my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

 

Install SQL Node

6465两台机器上分别安装serverclient

由于之前应经安装过server, 因此这里只需安装client即可。  

[root@engine65 ~]# rpm -ivh MySQL-Cluster-client-gpl-7.4.15-1.el6.x86_64.rpm  

 

Install Management Node

 

[root@engine66 ~]# rpm -ivh \

MySQL-Cluster-server-gpl-7.4.15-1.el6.x86_64.rpm

 

Although this RPM installs many other files, only the management server binaryndb_mgmd(in the /usr/sbindirectory) is actually required for running a management node. TheserverRPM also installsndb_mgm, theNDBmanagement client. 

 

[root@engine65 ~]# netstat -tlunp|grep mysql

tcp        0      0 :::3306                     :::*                        LISTEN      1584/mysqld         

[root@engine65 ~]# rpm -qa|grep mysql

[root@engine65 ~]# chkconfig --list|grep mysql

mysql           0:off 1:off 2:on 3:on 4:on 5:on 6:off

[root@engine65 ~]#

 

[root@engine64 ~]# rpm -qa|grep mysql

[root@engine64 ~]# netstat -tlunp|grep mysql

tcp        0      0 :::3306                     :::*                        LISTEN      1599/mysqld         

[root@engine64 ~]# chkconfig --list|grep mysql

mysql           0:off 1:off 2:on 3:on 4:on 5:on 6:off

[root@engine64 ~]#


 

修改密码

[root@engine64 ~]# cat .mysql_secret

# The random password set for the root user at Sun Mar 19 22:44:45 2017 (local time): Jtf7bQ9QYHXURrhA

 

[root@engine64 ~]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.6.36-ndb-7.4.15-cluster-gpl

mysql> SET PASSWORD=PASSWORD("123456");

Query OK, 0 rows affected (0.25 sec)

 

mysql>

 

同理, 修改65的mysql Root密码

BUG

I find some bugs after install server.

1、安装好之后无法通过rpm -qa|grep mysql进行查看, 但是已经启动

 

2、some file missing

can not find default configure file   /usr/my.cnf

 

Besides, install the client without any error message, but I can not ensure whether I had successfully install these!

Does my installation successful?

Maybe I should continue next step to find the answer!

 

18.2.4 Initial Configuration of NDB Cluster

 

Each data node or SQL node requires amy.cnffile that provides two pieces of information: a
connection stringthat tells the node where to find the management node, and a line telling the MySQL server on this host (the machine hosting the data node) to enable the NDBCLUSTERstorage engine.
For more information on connection strings, seeSection 18.3.3.3, “NDB Cluster Connection Strings”.
The management node needs aconfig.inifile telling it how many replicas to maintain, how much memory to allocate for data and indexes on each data node, where to find the data nodes, where to save data to disk on each data node, and where to find any SQL nodes. 

 

Configure Data Node and SQL Node

Create my.cnf and edit it like this:

[root@engine65 ~]# cat /etc/my.cnf

[mysqld]

#ptions for mysqld process:

ndbcluster # run NDB storage engine

[mysql_cluster]

# Options for NDB Cluster processes:

ndb-connectstring=192.168.1.66 # location of management server

 

Note&Import

Once you have started amysqldprocess with thendbclusterandndbconnectstringparameters in the[mysqld]and[mysql_cluster]
sections of the my.cnffile as shown previously, you cannot execute any
CREATE TABLE orALTER TABLEstatements without having actually started
the cluster. Otherwise, these statements will fail with an error. This is by design. 

 

这里忘记测试了, 如果先使用create table 语句会有什么样的现象?

 

Configure Management Node

one [ndbd] section per data node

[root@engine66 ~]# mkdir /var/lib/mysql-cluster

[root@engine66 mysql-cluster]# touch config.ini

[root@engine66 mysql-cluster]# vim config.ini

[ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=2 # Number of replicas
DataMemory=50M # How much memory to allocate for data storage ,80M
IndexMemory=10M # How much memory to allocate for index storage, 18M
# For DataMemory and IndexMemory, we have used the
# default values. Since the "world" database takes up
# only about 500KB, this should be more than enough for
# this example Cluster setup.
ServerPort=2202 # This the default value; however, you can use any
# port that is free for all the hosts in the cluster
# Note1: It is recommended that you do not specify the port
# number at all and simply allow the default value to be used instead
# Note2: The port was formerly specified using the PortNumber
# TCP parameter; this parameter is no longer available in NDB
# Cluster 7.5.
[ndb_mgmd]
# Management process options:
HostName=192.168.1.66 # Hostname or IP address of MGM node
DataDir=/var/lib/mysql-cluster # Directory for MGM node log files


[ndbd]
# Options for data node "A":
# (one [ndbd] section per data node)
HostName=192.168.1.64 # Hostname or IP address
NodeId=2 # Node ID for this data node
DataDir=/var/lib/mysql/data # Directory for this data node's data files


[ndbd]
# Options for data node "B":
HostName=192.168.1.65 # Hostname or IP address
NodeId=3 # Node ID for this data node
DataDir=/var/lib/mysql/data # Directory for this data node's data files


[mysqld]
HostName=192.168.1.64 # Hostname or IP address

[mysqld]
HostName=192.168.1.65 # Hostname or IP address
# (additional mysqld connections can be specified for this node for various
# purposes such as running ndb_restore) 

 

Note

The default port for Cluster management nodes is 1186; the default port for data
nodes is 2202. However, the cluster can automatically allocate ports for data
nodes from those that are already free. 

 

18.2.5 Initial Startup of NDB Cluster

Initial sequence, the management node start first, followed by the data node, finally by any SQL node.

 

停止MySQL服务

[root@engine65 mysql]# service mysql stop

Shutting down MySQL... SUCCESS!

[root@engine65 mysql]#

 

[root@engine64 ~]# service mysql stop

Shutting down MySQL.. SUCCESS!

[root@engine64 ~]#

 

启动Management Node

On the management host, issue the following command from the system shell to start the
management node process:
shell> ndb_mgmd -f /var/lib/mysql-cluster/config.ini 

Start with configuration file use -for--config-file.

[root@engine66 mysql-cluster]# ndb_mgmd

-f /var/lib/mysql-cluster/config.ini

MySQL Cluster Management Server mysql-5.6.36 ndb-7.4.15

[root@engine66 mysql-cluster]#

查看是否启动成功

[root@engine66 mysql-cluster]# netstat -tlunp|grep mysql

[root@engine66 mysql-cluster]# netstat -tlunp|grep ndb

tcp        0      0 0.0.0.0:1186                0.0.0.0:*                   LISTEN      15014/ndb_mgmd      

 

启动Data Node

On each of the data node hosts, run this command to start thendbdprocess: 

shell> ndbd 

启动Node3

[root@engine65 mysql]# ndbd

2017-03-20 13:57:57 [ndbd] INFO     -- Angel connected to '192.168.1.66:1186'

2017-03-20 13:57:57 [ndbd] INFO     -- Angel allocated nodeid: 3

2017-03-20 13:57:57 [ndbd] WARNING  -- Cannot change directory to '/var/lib/mysql/data', error: 2

2017-03-20 13:57:57 [ndbd] ERROR    -- Couldn't start as daemon, error: 'Failed to open logfile '/var/lib/mysql/data/ndb_3_out.log' for write, errno: 2'

[root@engine65 mysql]# mkdir /var/lib/mysql/data

[root@engine65 mysql]# ndbd

2017-03-20 13:58:46 [ndbd] INFO     -- Angel connected to '192.168.1.66:1186'

2017-03-20 13:58:46 [ndbd] INFO     -- Angel allocated nodeid: 3

[root@engine65 mysql]#

查看启动状态

[root@engine65 mysql]# netstat -tlunp|grep ndb

tcp        0      0 192.168.1.65:2202           0.0.0.0:*                   LISTEN      14882/ndbd          

[root@engine65 mysql]#

 

启动Node2

[root@engine64 ~]# mkdir /var/lib/mysql/data

[root@engine64 ~]# ndbd

2017-03-20 13:41:06 [ndbd] INFO     -- Angel connected to '192.168.1.66:1186'

2017-03-20 13:41:06 [ndbd] INFO     -- Angel allocated nodeid: 2

[root@engine64 ~]# netstat -tlunp|grep ndb

tcp        0      0 192.168.1.64:2202           0.0.0.0:*                   LISTEN      2622/ndbd           

[root@engine64 ~]#

 

启动SQL Node

If you used RPM files to install MySQL on the cluster host where the SQL node is to reside, you can (and should) use the supplied startup script to start the MySQL server process on the SQL node. 

[root@engine65 mysql]# service mysql start

Starting MySQL..................... SUCCESS!

 

[root@engine64 ~]# service mysql start

Starting MySQL.................. SUCCESS!

 

查看当前系统状态

 

 

查看Management Node Status

Invoke ndb_mgm on management node client.

[root@engine66 mysql-cluster]# ndb_mgm

-- NDB Cluster -- Management Client --

ndb_mgm> SHOW

Connected to Management Server at: localhost:1186

Cluster Configuration

---------------------

[ndbd(NDB)] 2 node(s)

id=2 @192.168.1.64  (mysql-5.6.36 ndb-7.4.15, Nodegroup: 0, *)

id=3 @192.168.1.65  (mysql-5.6.36 ndb-7.4.15, Nodegroup: 0)

 

[ndb_mgmd(MGM)] 1 node(s)

id=1 @192.168.1.66  (mysql-5.6.36 ndb-7.4.15)

 

[mysqld(API)] 2 node(s)

id=4 @192.168.1.64  (mysql-5.6.36 ndb-7.4.15)

id=5 @192.168.1.65  (mysql-5.6.36 ndb-7.4.15)

 

ndb_mgm>

 

Note

1The SQL node is referenced here as[mysqld(API)], which reflects the fact that themysqld process is acting as an NDB Cluster API node. 

 

2The IP address shown for a given NDB Cluster SQL or other API node in the output ofSHOWis the address used by the SQL or API node to connect to the cluster data nodes, and not to any management node. 

 

3、I did not define node id for SQL Node, Management Node auto distribute a node id for each SQL Node and it’s self.

 

You should now be ready to work with databases, tables, and data in NDB Cluster. SeeSection 18.2.6,
“NDB Cluster Example with Tables and Data”, for a brief discussion. 

 

18.2.6 NDB Cluster Example with Tables and Data

 

Two key points keep in mind:

1、Each table must use NDBCLUSTER storage engine like ENGINE=NDBCLUSTER or ENGINE=NDB.

2、Every table has a primary key, If no primary key was defined by the user when the table is created, the BDBCLUSTER automatically generated a hidden one.(this would like mongoDB)

 

Test In command-line

This operation should be done on the SQL Node of the cluster.

Operation on 192.168.1.65 (SQL Node)

mysql> create database world;

Query OK, 1 row affected (0.30 sec)

 

mysql> use world;

Database changed

mysql> CREATE TABLE `City` (

    -> `ID` int(11) NOT NULL auto_increment,

    -> `Name` char(35) NOT NULL default '',

    -> PRIMARY KEY (`ID`)

    -> ) ENGINE=NDBCLUSTER DEFAULT CHARSET=utf8;

Query OK, 0 rows affected (0.77 sec)

 

mysql> INSERT INTO `City` VALUES (1,'chongqing');

Query OK, 1 row affected (0.13 sec)

 

mysql> INSERT INTO `City` VALUES (2,'chengdu');

Query OK, 1 row affected (0.03 sec)

 

Operation on 192.168.1.64 (SQL Node)

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| data               |

| mysql              |

| ndbinfo            |

| performance_schema |

| test               |

| world              |

+--------------------+

7 rows in set (0.08 sec)

 

mysql> use world;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Database changed

mysql> show tables;

+-----------------+

| Tables_in_world |

+-----------------+

| City            |

+-----------------+

1 row in set (0.00 sec)

 

mysql> select * from City;

+----+-----------+

| ID | Name      |

+----+-----------+

|  1 | chongqing |

|  2 | chengdu   |

+----+-----------+

2 rows in set (0.03 sec)

 

mysql> INSERT INTO `City` VALUES (null,'shanghai');

Query OK, 1 row affected (0.06 sec)

 

mysql>

 

 

Operation on 192.168.1.65 (SQL Node)

mysql> select * from City;

+----+-----------+

| ID | Name      |

+----+-----------+

|  1 | chongqing |

|  2 | chengdu   |

|  3 | shanghai  |

+----+-----------+

3 rows in set (0.05 sec)

 

mysql>

 

Summary

1、文档上面的测试方式是通过导入的方式操作, 修改存储引擎(一种是导入数据后再修改, 另一种是修改存储引擎后再导入), 有点像一个数据库迁移的操作。

2、可以看到65和64互为主从。对比主从复制, 需要配置账户才能访问, 这里可以直接访问, 印证了概述里面说的,各个节点间通信是没有加密的, 必须要保证网络的安全性。

 

Test in application

Application can access NDB tables on SQL Node with stand API, and it must be SQL Node, not the Management Node or Data Node.

 

Configure SQL Node

Modify the mysql access privileges of 192.168.1.65.

mysql> grant all on world.* to root@"192.168.1.%" identified by '123456';

Query OK, 0 rows affected (0.18 sec)

 

mysql> flush privileges;

Query OK, 0 rows affected (0.03 sec)

 

File:mysql.cluster.ini.php

<?php

$servername = "192.168.1.65";

$username = "root";

$password = "123456";

$database = 'world';

 

 

File: mysql-cluster.php

<?php

require_once 'mysql.cluster.ini.php';

// 创建连接

$conn = new mysqli($servername, $username, $password, $database);

// 检测连接

if ($conn->connect_error) {

    die("连接失败: " . $conn->connect_error);

} else{

$result = $conn->query("insert into City values(null, 'beijing')");

var_dump($result);

$sql = "select * from City";

$result = $conn->query($sql);

if ($result->num_rows > 0) {

while($row = $result->fetch_assoc()) {

echo "<br> id: ". $row["ID"]. " - City: ". $row["Name"];

}

} else {

var_dump("0 个结果");

}

}

 

浏览器访问:

D:\Workspace-PHP\myproject\webroot\test\mysql-cluster.php:10:boolean true

192.168.1.65 via TCP/IP
id: 3 - City: shanghai
id: 2 - City: chengdu
id: 4 - City: beijing

 

Operation on 192.168.1.64 (SQL Node)

mysql> select * from City;

+----+----------+

| ID | Name     |

+----+----------+

|  3 | shanghai |

|  2 | chengdu  |

|  4 | beijing  |

+----+----------+

3 rows in set (0.01 sec)

 

mysql>

 

这里少了一条数据, 是由于测试了删除,没有记录在文档里面。

 

18.2.7 Safe Shutdown and Restart of NDB Cluster

Shutdown

The way to stop NDB Cluster gracefully.

[root@engine66 mysql-cluster]# ndb_mgm -e shutdown

Connected to Management Server at: localhost:1186

3 NDB Cluster node(s) have shutdown.

Disconnecting to allow management server to shutdown.

[root@engine66 mysql-cluster]#

 

Test on SQL Node

mysql> select * from City;

ERROR 1296 (HY000): Got error 4009 'Cluster Failure' from NDBCLUSTER

[root@engine65 ~]# netstat -tlunp|grep ndb

[root@engine65 ~]# netstat -tlunp|grep ndb

[root@engine65 ~]# netstat -tlunp|grep mysql

tcp        0      0 :::3306                     :::*                        LISTEN      15069/mysqld        

[root@engine65 ~]#

 

The -eoption here is used to pass a command to thendb_mgmclient from the shell. (See
Section 18.4.28, “Options Common to NDB Cluster Programs — Options Common to NDB Cluster Programs”, for more information about this option.) The command causes the ndb_mgm,ndb_mgmd, and anyndbd or ndbmtd processes to terminate gracefully.

 

Startup

Starting sequencethe same as initial startup in chapter 18.2.5.

 

There is a different , operator on SQL Node:

shell> mysqld_safe & 

[root@engine65 ~]# mysqld_safe &

[1] 15359

[root@engine65 ~]# 170320 17:25:25 mysqld_safe Logging to '/var/lib/mysql/engine65.err'.

170320 17:25:25 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

^C

[root@engine65 ~]#

 

 

 

Configuration of NDB Cluster

 

NDB Cluster Programs

These programs include the NDB Cluster data, management, and SQL node processes (ndbd,
ndbmtd, ndb_mgmd, and mysqld) and the management client (ndb_mgm). 

 

Management of NDB Cluster

Two ways to manage a running NDB Cluster:

One, Commands in management client.

cluster status can be checked, log levels changed, backups started and stopped, and nodes stopped and started. 

Second, check the log.

 

 

 

Question

1SQL Node startup

In chapter 18.2.7, use mysql_safe to startup. but in initial startup, according to the documentation, it just tell me to use the startup script to start the MySQL. What’s the difference between each other?

2High Availability

In application , we must use the ip address of SQL Node, if we want to realize a high availability application, we need to listen the status of the SQL Node which will to connect. Is there any tools can be used?

3MySQL Cluster Evaluation Guide

Download the Evaluation Guide to learn the fundamentals of how to design and select the proper components for building a successful Proof-of-Concept with MySQL Cluster evaluation. The Guide works through basic functional testing and evaluation best-practices.

https://www.mysql.com/why-mysql/white-papers/mysql-cluster-evaluation-guide/

 

OverView

18.1.1 NDB Cluster Core Concepts

NDBCLUSTER (also known asNDB) is an in-memory storage engine offering high-availability and datapersistence features.

 

There are three types of cluster nodes, and in a minimal NDB Cluster configuration, there will be at least three nodes.

SQL Node, Data Node, Management node.
Important

It is not realistic to expect to employ a three-node setup in a production environment. Such a configuration provides no redundancy; to benefit from NDB Cluster's high-availability features, you must use multiple data and SQL nodes. The use of multiple management nodes is also highly recommended.

 

Configuration of a cluster involves configuring each individual node in the cluster and setting up individual communication links between nodes.NDB Cluster is currently designed with the intention that data nodes are homogeneous in terms of processor power, memory space, and bandwidth. In addition, to provide a single point of configuration, all configuration data for the cluster as a whole is located in one configuration file.


The management server manages the cluster configuration file and the cluster log. Each node in the cluster retrieves the configuration data from the management server, and so requires a way to determine where the management server resides. When interesting events occur in the data nodes, the nodes transfer information about these events to the management server, which then writes the information to the cluster log.

 

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.

Event logs

NDB Cluster logs events by category (startup, shutdown, errors, checkpoints, and so
on), priority, and severity. A complete listing of all reportable events may be found inSection 18.5.6,
“Event Reports Generated in NDB Cluster”. Event logs are of the two types listed here:
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.

Note
Under normal circumstances, it is necessary and sufficient to keep and examine only the cluster log. The node logs need be consulted only for application development and debugging purposes. 

 

Checkpoint

Generally speaking, when data is saved to disk, it is said that acheckpointhas been
reached.

 

 

18.1.2 NDB Cluster Nodes, Node Groups, Replicas, and Partitions

 

NDB Cluster is a technology that enables clustering of in-memory databases in a shared-nothing system.

 

NDB Cluster is designed not to have any single point of failure.In a shared-nothing system, each component is expected to have its own memory and disk, and the use of shared storage mechanisms such as network shares, network file systems, and SANs is not recommended or supported. 

 

 

NDB Cluster Nodes, Node Groups, Replicas, and Partitions 

Data node. Anndbdorndbmtdprocess, which stores one or morereplicas—that is, copies of the partitions(discussed later in this section) assigned to the node group of which the node is a member. 

Each data node should be located on a separate computer. While it is also possible to host multiple data node processes on a single computer, such a configuration is not usually recommended. 

 

Node group. A node group consists of one or more nodes, and stores partitions, or sets ofreplicas (see next item). 

 

What this means regarding the continued operation of an NDB Cluster is this: so long as each node group participating in the cluster has at least one node operating, the cluster has a complete copy of all data and remains viable. 

 

18.1.3 NDB Cluster Hardware, Software, and Networking Requirements

 

Security

Communications between NDB Cluster nodes are not encrypted or shielded in any
way. The only means of protecting transmissions within an NDB Cluster is to run your NDB Cluster on a protected network. If you intend to use NDB Cluster for Web applications, the cluster should definitely reside behind your firewall and not in your network's De-Militarized Zone (DMZ) or elsewhere. 

Efficiency

Setting up an NDB Cluster on a private or protected network enables the cluster
to make exclusive use of bandwidth between cluster hosts.

Network communication and latency

to maintain consistency and service despite the silent failure of nodes, NDB Cluster uses heartbeating and timeout mechanisms which treat an extended loss of communication from a node as node failure.

Recall that, to maintain data consistency, an NDB Cluster shuts down when the last node in a node group fails. Thus, to avoid increasing the risk of a forced shutdown, breaks in communication between nodes should be avoided wherever possible. 

 

If heartbeat generation is sufficiently delayed, other nodes treat the node that is slow to respond as failed. 

 

SCI support

It is also possible to use the high-speed Scalable Coherent Interface (SCI) with NDB
Cluster, but this is not a requirement.


 

 

 

 

0 0
原创粉丝点击