MySQL Cluster 安装

企鹅博客 2019年8月16日06:35:48 评论 145

下载软件包:

[root@mysql1 paul]# wget http://cdn.mysql.com/Downloads/MySQL-Cluster-7.2/mysql-cluster-gpl-7.2.10.tar.gz

配置前的规划
管理节点IP: 172.1.2.10 节点ID: id=1 Management Node
NDB数据节点1: 172.1.2.9 节点ID: id=2 Data Node
NDB数据节点2: 172.1.2.8 节点ID: id=3 Data Node
mysql节点2: 172.1.2.7 节点ID: id=4 SQL Node

 

所有机器关闭防火墙:

[root@mysql1 mysql-cluster-gpl-7.2.10]# /etc/init.d/iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: mangle filter [ OK ]
Unloading iptables modules: [ OK ]
You have new mail in /var/spool/mail/root
[root@mysql1 mysql-cluster-gpl-7.2.10]#

系统版本:

[root@mysql1 paul]# uname -a
Linux mysql1.qyer.com 2.6.18-308.el5.028stab099.3 #1 SMP Wed Mar 7 15:56:00 MSK 2012 x86_64 x86_64 x86_64 GNU/Linux
You have new mail in /var/spool/mail/root
[root@mysql1 paul]#

安装管理节点与其它节点安装是一样的

[root@mysql1 paul]# tar -zxvf mysql-cluster-gpl-7.2.10.tar.gz

[root@mysql1 paul]# cd mysql-cluster-gpl-7.2.10

[root@mysql1 mysql-cluster-gpl-7.2.10]# cmake -DCMAKE_INSTALL_PREFIX=/Data/apps/mysql-5.5.12 -DWITH_INNOBASE_STORAGE_ENGINE=ON -DWITH_MYISAM_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

出错:

CMake Error at storage/ndb/cmake/ndb_require_variable.cmake:24 (MESSAGE):
The variable JAVA_RUNTIME is required to build NDB
Call Stack (most recent call first):
storage/ndb/CMakeLists.txt:247 (NDB_REQUIRE_VARIABLE)

解决:

[root@mysql1 mysql-cluster-gpl-7.2.10]# yum install java

[root@mysql1 mysql-cluster-gpl-7.2.10]# rm CMakeCache.txt

[root@mysql1 mysql-cluster-gpl-7.2.10]# java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.8) (rhel-1.35.1.11.8.el5_9-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
[root@mysql1 mysql-cluster-gpl-7.2.10]#

又一个错:

– Looking for MySQL include file my_default.h – not found
– Java_VERSION:
– Java_VERSION_STRING:
– JAVA_RUNTIME: /usr/bin/java
– JAVA_COMPILE: JAVA_COMPILE-NOTFOUND
– JAVA_ARCHIVE: JAVA_ARCHIVE-NOTFOUND
CMake Error at storage/ndb/cmake/ndb_require_variable.cmake:24 (MESSAGE):
The variable JAVA_COMPILE is required to build NDB
Call Stack (most recent call first):
storage/ndb/CMakeLists.txt:248 (NDB_REQUIRE_VARIABLE)

尝试解决:

下载一个jre:http://java.com/zh_CN/download/manual.jsp

出错:[root@mysql1 paul]# rpm -ivh jre-7u15-linux-i586.rpm
Preparing… ########################################### [100%]
1:jre ########################################### [100%]
Unpacking JAR files…
rt.jar…
Error: Could not open input file: /usr/java/jre1.7.0_15/lib/rt.pack
jsse.jar…
Error: Could not open input file: /usr/java/jre1.7.0_15/lib/jsse.pack
charsets.jar…
Error: Could not open input file: /usr/java/jre1.7.0_15/lib/charsets.pack
localedata.jar…
Error: Could not open input file: /usr/java/jre1.7.0_15/lib/ext/localedata.pack
plugin.jar…
Error: Could not open input file: /usr/java/jre1.7.0_15/lib/plugin.pack
javaws.jar…
Error: Could not open input file: /usr/java/jre1.7.0_15/lib/javaws.pack
deploy.jar…
Error: Could not open input file: /usr/java/jre1.7.0_15/lib/deploy.pack
[root@mysql1 paul]#

尝试下载JDK

[root@mysql1 paul]# chmod +x jdk-6u13-linux-i586.bin

[root@mysql1 paul]# ./jdk-6u13-linux-i586.bin

[root@mysql1 paul]# mv jdk1.6.0_13 /usr/local/

[root@mysql1 paul]# cd /etc/profile.d/

[root@mysql1 profile.d]# vim java.sh

#set java environment
JAVA_HOME=/usr/local/jdk1.6.0_13
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH

[root@mysql1 profile.d]# source java.sh

[root@mysql1 profile.d]# java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)
[root@mysql1 profile.d]#

成功:

– Using gcc atomic builtins
– Looking for mach/mach_time.h
– Looking for mach/mach_time.h – not found
– Looking for srandomdev
– Looking for srandomdev – not found
– Looking for gethrvtime
– Looking for gethrvtime – not found
– Looking for memset
– Looking for memset – found
– Performing Test HAVE_FUNC_IN_CXX
– Performing Test HAVE_FUNC_IN_CXX – Success
– Performing Test HAVE_PEERCRED
– Performing Test HAVE_PEERCRED – Success
– Configuring done
– Generating done
– Build files have been written to: /home/paul/mysql-cluster-gpl-7.2.10
[root@mysql1 mysql-cluster-gpl-7.2.10]#

[root@mysql1 mysql-cluster-gpl-7.2.10]# make

[root@mysql1 mysql-cluster-gpl-7.2.10]# make install

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

NDB数据节点安装:

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

安装步骤和管理节点一样,也需要JAVA环境,

[root@mysql3 mysql-cluster-gpl-7.2.10]# yum install cmake gcc bison gcc-c++ ncurses-devel

[root@mysql02 mysql-cluster-gpl-7.2.10]# cmake -DCMAKE_INSTALL_PREFIX=/Data/apps/mysql-5.5.12 -DWITH_INNOBASE_STORAGE_ENGINE=ON -DWITH_MYISAM_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

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

SQL Node的安装:

[root@mysql4 mysql-cluster-gpl-7.2.10]# yum install cmake gcc bison gcc-c++ ncurses-devel

[root@mysql4 mysql-cluster-gpl-7.2.10]# cmake -DCMAKE_INSTALL_PREFIX=/Data/apps/mysql-5.5.12 -DWITH_INNOBASE_STORAGE_ENGINE=ON -DWITH_MYISAM_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

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

配置管理节点:

安装位于:

[root@mysql1 mysql-5.5.12]# pwd
/Data/apps/mysql-5.5.12
[root@mysql1 mysql-5.5.12]# ll
total 76
drwxr-xr-x 2 root root 4096 Feb 26 08:51 bin
-rw-r–r– 1 root root 17987 Dec 20 00:12 COPYING
drwxr-xr-x 4 root root 4096 Feb 26 08:51 data
drwxr-xr-x 2 root root 4096 Feb 26 08:51 docs
drwxr-xr-x 4 root root 4096 Feb 26 08:51 include
-rw-r–r– 1 root root 7605 Dec 20 00:12 INSTALL-BINARY
drwxr-xr-x 3 root root 4096 Feb 26 08:51 lib
drwxr-xr-x 4 root root 4096 Feb 26 08:51 man
drwxr-xr-x 10 root root 4096 Feb 26 08:51 mysql-test
-rw-r–r– 1 root root 2552 Dec 20 00:12 README
drwxr-xr-x 2 root root 4096 Feb 26 08:51 scripts
drwxr-xr-x 29 root root 4096 Feb 26 08:51 share
drwxr-xr-x 4 root root 4096 Feb 26 08:51 sql-bench
drwxr-xr-x 2 root root 4096 Feb 26 08:52 support-files
[root@mysql1 mysql-5.5.12]#

建立配置文件:

[root@mysql1 mysql-5.5.12]# mkdir cluster-conf
[root@mysql1 mysql-5.5.12]# cp /Data/apps/mysql-5.5.12/support-files/ndb-config-2-node.ini /Data/apps/mysql-5.5.12/cluster-conf/
You have new mail in /var/spool/mail/root
[root@mysql1 mysql-5.5.12]#

设置权限:

[root@mysql1 /]# chown mysql:mysql /Data/apps/mysql-5.5.12 –R

进入配置文件目录:

[root@mysql1 mysql-5.5.12]# cd /Data/apps/mysql-5.5.12/cluster-conf/

打开配置文件:

[root@mysql1 cluster-conf]# cat ndb-config-2-node.ini
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Example Ndbcluster storage engine config file.
#
[ndbd default]
NoOfReplicas= 2
MaxNoOfConcurrentOperations= 10000
DataMemory= 80M
IndexMemory= 24M
TimeBetweenWatchDogCheck= 30000

[ndb_mgmd]
Id=1
HostName= 172.1.2.10
Datadir=/Data/apps/mysql-5.5.12/data

[ndbd]
Id= 2
HostName= 172.1.2.9
Datadir=/Data/apps/mysql-5.5.12/ndbdata

[ndbd]
Id= 3
HostName= 172.1.2.8
Datadir=/Data/apps/mysql-5.5.12/ndbdata
[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 10:32:07 [ERROR] Aborting

130226 10:32:07 [Note] /Data/apps/mysql-5.5.12//bin/mysqld: Shutdown complete

解决:

[root@mysql4 /]# chmod 777 /tmp/ –R

[root@mysql4 /]# /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…
OK
Filling help tables…
OK

To start mysqld at boot time you have to copy

启动管理节点:

[root@mysql1 mysql-5.5.12]# /Data/apps/mysql-5.5.12/bin/ndb_mgmd -f /Data/apps/mysql-5.5.12/cluster-conf/ndb-config-2-node.ini
MySQL Cluster Management Server mysql-5.5.29 ndb-7.2.10
2013-02-26 10:36:57 [MgmtSrvr] INFO — The default config directory ‘/Data/apps/mysql-5.5.12/mysql-cluster’ does not exist. Trying to create it…
2013-02-26 10:36:57 [MgmtSrvr] INFO — Sucessfully created config directory
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 27: [MGM] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 32: [DB] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 37: [DB] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 41: [API] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 45: [API] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 48: [API] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 51: [API] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 57: [tcp] PortNumber is deprecated
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 27: [MGM] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 32: [DB] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 37: [DB] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 41: [API] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 45: [API] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 48: [API] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 51: [API] Id is deprecated, use NodeId instead
2013-02-26 10:36:57 [MgmtSrvr] WARNING — at line 57: [tcp] PortNumber is deprecated

在次启动就行了:

都显示not connected

[root@mysql1 mysql-cluster]# /Data/apps/mysql-5.5.12/bin/ndb_mgmd -f /Data/apps/mysql-5.5.12/cluster-conf/ndb-config-2-node.ini
MySQL Cluster Management Server mysql-5.5.29 ndb-7.2.10
[root@mysql1 mysql-cluster]# /Data/apps/mysql-5.5.12/bin/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 (not connected, accepting connect from 172.1.2.9)
id=3 (not connected, accepting connect from 172.1.2.8)

[ndb_mgmd(MGM)] 1 node(s)
id=1 @172.1.2.10 (mysql-5.5.29 ndb-7.2.10)

[mysqld(API)] 4 node(s)
id=4 (not connected, accepting connect from 172.1.2.7)
i
d=5 (not connected, accepting connect from any host)
id=6 (not connected, accepting connect from any host)
id=7 (not connected, accepting connect from any host)

ndb_mgm>

启动数据节点:

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

[root@mysql2 ndbdata]# /Data/apps/mysql-5.5.12/bin/ndbd
2013-02-26 10:43:41 [ndbd] INFO — Angel connected to ’172.1.2.10:1186′
2013-02-26 10:43:41 [ndbd] INFO — Angel allocated nodeid: 2
[root@mysql2 ndbdata]#

[root@mysql3 apps]# /Data/apps/mysql-5.5.12/bin/ndbd
2013-02-26 10:44:57 [ndbd] INFO — Angel connected to ’172.1.2.10:1186′
2013-02-26 10:44:57 [ndbd] INFO — Angel allocated nodeid: 3
[root@mysql3 apps]#

启动SQL节点:

[root@mysql4 /]# /Data/apps/mysql-5.5.12/bin/mysqld_safe &
[1] 28179
[root@mysql4 /]# 130226 10:45:53 mysqld_safe Logging to ‘/Data/apps/mysql-5.5.12/data/mysql4.qyer.com.err’.
130226 10:45:53 mysqld_safe Starting mysqld daemon with databases from /Data/apps/mysql-5.5.12/data

[root@mysql4 /]# ps -ef |grep mysql
root 28179 3274 0 10:45 pts/0 00:00:00 /bin/sh /Data/apps/mysql-5.5.12/bin/mysqld_safe
mysql 28271 28179 2 10:45 pts/0 00:00:00 /Data/apps/mysql-5.5.12/bin/mysqld –basedir=/Data/apps/mysql-5.5.12 –datadir=/Data/apps/mysql-5.5.12/data –plugin-dir=/Data/apps/mysql-5.5.12/lib/plugin –user=mysql –log-error=/Data/apps/mysql-5.5.12/data/mysql4.qyer.com.err –pid-file=/Data/apps/mysql-5.5.12/data/mysql4.qyer.com.pid
root 28284 3274 0 10:46 pts/0 00:00:00 grep mysql
[root@mysql4 /]#

[root@mysql4 support-files]# 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
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
ndbcluster
ndb-connectstring=172.1.2.10
[mysql_cluster]
ndb-connectstring=172.1.2.10
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
skip-grant-tables
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

# Don’t listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# binary logging format – mixed recommended
binlog_format=mixed

# required unique id between 1 and 2^32 – 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) –
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
# where you replace <host>, <user>, <password> by quoted strings and
# <port> by the master’s port number (3306 by default).
#
# Example:
#
# CHANGE MASTER TO MASTER_HOST=’125.564.12.1′, MASTER_PORT=3306,
# MASTER_USER=’joe’, MASTER_PASSWORD=’secret’;
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables’ values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 – 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave – required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master – required
#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master – required
#master-password = <password>
#
# The port the master is listening on.
# optional – defaults to 3306
#master-port = <port>
#
# binary logging – not required for slaves, but recommended
#log-bin=mysql-bin

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /Data/apps/mysql-5.5.12/data
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /Data/apps/mysql-5.5.12/data
# You can set .._buffer_pool_size up to 50 – 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
[root@mysql4 support-files]#

———————————————————————————————————————-

在次查看管理节点:

ndb_mgm> show
Cluster Configuration
———————
[ndbd(NDB)] 2 node(s)
id=2 @172.1.2.9 (mysql-5.5.29 ndb-7.2.10, Nodegroup: 0, Master)
id=3 @172.1.2.8 (mysql-5.5.29 ndb-7.2.10, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1 @172.1.2.10 (mysql-5.5.29 ndb-7.2.10)

[mysqld(API)] 4 node(s)
id=4 @172.1.2.7 (mysql-5.5.29 ndb-7.2.10)
id=5 (not connected, accepting connect from any host)
id=6 (not connected, accepting connect from any host)
id=7 (not connected, accepting connect from any host)

ndb_mgm>

MySQL Cluster 的详细介绍:请点这里
MySQL Cluster 的下载地址:请点这里

推荐阅读:

MySQL Cluster 备份与恢复 http://www.linuxidc.com/Linux/2013-06/85295.htm

MySQL Cluster安装配置 http://www.linuxidc.com/Linux/2013-07/87705.htm

weinxin
欢迎加入中国SEO站长博客之家
本站的所有资源都会上传分享到博客之家,希望大家互相学习交流进步。
企鹅博客

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: