How To Set Up A Load-Balanced MySQL Cluster - Part 4

How To Set Up A Load-Balanced MySQL Cluster - Part 4 - 应用软件 - 电脑教程网

How To Set Up A Load-Balanced MySQL Cluster - Part 4

日期:2006-12-09   荐:
·图形化管理MySQL更轻松·mysql 时间函数用法 集合·MySQL常见问题解答及技巧·Mysql学习点滴·MySQL 5.0 新特性教程 存储过程:第三讲·远程连接mysql资料·在Linux 环境下安装 Mysql·MySQL 常用命令·如何安装mysql 5.0·Mysql使用基础知识 5 How To Restart The Cluster

Now let's asume you want to restart the MySQL cluster, for example because you have changed /var/lib/mysql-cluster/config.ini on loadb1.example.com or for some other reason. To do this, you use the ndb_mgm cluster management client on loadb1.example.com:

loadb1.example.com:

ndb_mgm

On the ndb_mgm console, you type

shutdown;

You will then see something like this:

ndb_mgm> shutdown;Node 3: Cluster shutdown initiatedNode 2: Node shutdown completed.2 NDB Cluster node(s) have shutdown.NDB Cluster management server shutdown.ndb_mgm>

This means that the cluster nodes sql1.example.com and sql2.example.com and also the cluster management server have shut down.

Run

quit;

to leave the ndb_mgm console.

To start the cluster management server, do this on loadb1.example.com:

loadb1.example.com:

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

and on sql1.example.com and sql2.example.com you run

sql1.example.com / sql2.example.com:

ndbd

or, if you have changed /var/lib/mysql-cluster/config.ini on loadb1.example.com:

ndbd --initial

Afterwards, you can check on loadb1.example.com if the cluster has restarted:

loadb1.example.com:

ndb_mgm

On the ndb_mgm console, type

show;

to see the current status of the cluster. It might take a few seconds after a restart until all nodes are reported as connected.

Type

quit;

to leave the ndb_mgm console.

标签: