centos65安装简测mysqlcluster7.3.7(六)

2015-07-24 09:07:33 · 作者: · 浏览: 5
22 20:39:53 3054 [Note] Binlog end
2015-01-22 20:39:53 3054 [Note] InnoDB: FTS optimize thread exiting.
2015-01-22 20:39:53 3054 [Note] InnoDB: Starting shutdown...
2015-01-22 20:39:54 3054 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h myqClter1 password 'new-password'

Alternatively you can run:

./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

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 ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

[root@myqClter1 mysql]#

9
配置启动脚本
[root@myqClter1 mysql]# cp support-files/mysql.server /etc/init.d/mysqld
# 设置mysql服务为开机自启动
# chkconfig --add mysqld

#################
#以上第3-9步部署数据节点和SQL节点,根据规划在另一台服务器做同样操作
#################

#################
# 部署管理节点
#################

管理节点只需ndb_mgm和ndb_mgmd两个文件和一个配置文件,这两个文件从数据节点上copy就行。
ndb_mgmd是 mysql cluster管理服务器,ndb_mgm是客户端管理工具

10
[root@myqClter1 mysql]# ll bin/ndb_mgm
ndb_mgm ndb_mgmd
[root@myqClter1 mysql]# cp mysql/bin/ndb_mgm*/usr/local/bin
[root@myqClter1 mysql]# ll /usr/local/bin/ndb_mgm*
-rwxr-xr-x. 1 root root 7131043 1月 22 21:25 /usr/local/bin/ndb_mgm
-rwxr-xr-x. 1 root root 16141964 1月 22 21:25 /usr/local/bin/ndb_mgmd

#################
# 配置
#################

11
配置mysql服务器成数据节点和SQL节点
[root@myqClter1 mysql]# cp support-files/my-default.cnf /etc/my.cnf
[root@myqClter1 mysql]# vi /etc/my.cnf
增加如下内容

[mysqld]
ndbcluster #运行NDB存储引擎

[mysql_cluster]
ndb-connectstring=192.168.55.15 #管理节点IP

另一个节点上同样操作
#scp /etc/my.cnf 192.168.55.16:/etc/
注意两台服务器都得这样配置。

12
配置管理节点
[root@myqClter1 mysql]# mkdir /var/lib/mysql-cluster
[root@myqClter1 mysql]# vi /var/lib/mysql-cluster/config.ini
加入以下内容:

[ndbd default]
NoOfReplicas=2 #每个数据节点的镜像数量
DataMemory=200M #每个数据节点中给数据分配的内存
IndexMemory=20M #每个数据节点中给索引分配的内存

[tcp default]
portnumber=2202

[ndb_mgmd] #配置管理节点
#NodeId=1
hostname=192.168.55.15
datadir=/var/lib/mysql-cluster/ #管理节点 日志目录

[ndbd]
#数据节点配置,一个数据节点一个[ndbd]
#NodeId=2
hostname=192.168.55.15
datadir=/usr/local/mysql/data/ #数据节点目录

[ndbd]
#NodeId=3
hostname=192.168.55.16
datadir=/usr/local/mysql/data/

[mysqld]
#SQL节点配置
hostname=192.168.55.15

[mysqld]
hostname=192.168.55.16


13
启动:
启动顺序:
管理节点->数据节点->SQL节点

启动管理节点:
[root@myqClter1 bin]# ndb_mgmd -f /var/lib/mysql-cluster/config.ini
MySQL Cluster Management Server mysql-5.6.21 ndb-7.3.7
[root@myqClter1 bin]#

启动数据节点
[root@myqClter1 bin]# ./ndbd --initial
2015-01-23 15:31:15 [ndbd] INFO -- Angel connected to '192.168.55.15:1186'
2015-01-23 15:31:15 [ndbd] INFO -- Angel allocated nodeid: 2
[root@myqClter1 bin]#


启动第二