MySQL Cluster 安装(三)

2014-11-24 17:31:35 · 作者: · 浏览: 3
ta
[mysqld]
Id= 4
HostName= 172.1.2.7


[mysqld]
Id= 5


[mysqld]
Id= 6


[mysqld]
Id= 7


# choose an unused port number
# in this configuration 63132, 63133, and 63134
# will be used
[tcp default]
PortNumber= 63132
[root@mysql1 cluster-conf]#


同步进行数据节点进行相应配置


[root@mysql2 mysql-5.5.12]# mkdir -p /Data/apps/mysql-5.5.12/ndbdata


[root@mysql3 mysql-cluster-gpl-7.2.10]# mkdir -p /Data/apps/mysql-5.5.12/ndbdata


[root@mysql2 home]# chown mysql:mysql /Data/apps/mysql-5.5.12/ -R


[root@mysql3 mysql-cluster-gpl-7.2.10]# chown mysql:mysql /Data/apps/mysql-5.5.12/ –R



配置数据节点:


NDB数据节点1: 172.1.2.9 节点ID: id=2 Data Node
NDB数据节点2: 172.1.2.8 节点ID: id=3 Data Node


[root@mysql2 support-files]# cp /Data/apps/mysql-5.5.12/support-files/my-medium.cnf /etc/my.cnf
cp锛.. . .etc/my.cnf . y
[root@mysql2 support-files]#


[root@mysql2 ndbdata]# cat /etc/my.cnf
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M – 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "–help" option.


# The following options will be passed to all MySQL clients


# Here follows entries for some specific programs


# The MySQL server
[mysqld]
Datadir=/Data/apps/mysql-5.5.12/ndbdata
ndbcluster
ndb-connectstring=172.1.2.10
[mysql_cluster]
ndb-connectstring=172.1.2.10
You have new mail in /var/spool/mail/root
[root@mysql2 ndbdata]#


[root@mysql3 apps]# cp /Data/apps/mysql-5.5.12/support-files/my-medium.cnf /etc/my.cnf
cp锛.. . .etc/my.cnf . y
[root@mysql3 apps]#


———————————————————————————————————————–


[root@mysql3 apps]# cat /etc/my.cnf
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M – 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "–help" option.


# The following options will be passed to all MySQL clients


# The MySQL server
[mysqld]
Datadir=/Data/apps/mysql-5.5.12/ndbdata
ndbcluster
ndb-connectstring=172.1.2.10
[mysql_cluster]
ndb-connectstring=172.1.2.10
[root@mysql3 apps]#


———————————————————————————————————————–


数据节点:


[root@mysql4 mysql-5.5.12]# cp /Data/apps/mysql-5.5.12/support-files/my-medium.cnf /etc/my.cnf
cp锛.. . .etc/my.cnf . y
[root@mysql4 mysql-5.5.12]#


初始化数据库


[root@mysql4 mysql-5.5.12]# /Data/apps/mysql-5.5.12/scripts/mysql_install_db –user=mysql –basedir=/Data/apps/mysql-5.5.12/ –datadir=/Data/apps/mysql-5.5.12/data/
Installing MySQL system tables…
ERROR: 1 Can’t create/write to file ‘/tmp/#sql_6dcc_0.MYI’ (Errcode: 13)
130226 1