mysql cluster
create below folder on both hserver and client
mkdir -p /var/lib/mysql
create config file on Server only
/usr/local/mysql-cluster/config.ini
vi /usr/local/mysql-cluster/config.ini
[NDBD DEFAULT]
NoOfReplicas=2
[MYSQLD DEFAULT]
[NDB_MGMD DEFAULT]
[TCP DEFAULT]
# Section for the cluster management node
[NDB_MGMD]
# IP address of the management node (this system)
HostName=192.168.68.129
# Section for the storage nodes
[NDBD]
# IP address of the first storage node
HostName=192.168.68.129
DataDir= /var/lib/mysql-cluster
[NDBD]
# IP address of the second storage node
HostName=192.168.68.131
wq;
commands used are below
server only
#ndb_mgmd --config-file=//usr/local/mysql-cluster/config.ini
server and client
#ndb_mgm
#ndbd --initial
My.cnf on both server and client should be same
vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
ndbcluster
ndb-connectstring=192.168.68.129
default-storage-engine=NDBCLUSTER
[mysql_cluster]
# IP address of the cluster management node
ndb-connectstring=192.168.68.129
#user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
#old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
~
:wq
packages used on both machines
MySQL-Cluster-client-gpl-7.2.12-1.rhel5.i386.rpm
MySQL-Cluster-devel-gpl-7.2.12-1.rhel5.i386-1.rpm
MySQL-Cluster-devel-gpl-7.2.12-1.rhel5.i386.rpm
MySQL-Cluster-gpl-management-7.0.34-1.rhel5.i386.rpm
MySQL-Cluster-gpl-management-7.1.15-1.rhel5.i386.rpm
MySQL-Cluster-server-gpl-7.2.12-1.rhel5.i386.rpm
MySQL-Cluster-shared-compat-gpl-7.2.12-1.rhel5.i386.rpm
MySQL-Cluster-test-gpl-7.2.12-1.rhel5.i386.rpm
ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: 192.168.68.129:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @192.168.68.129 (mysql-5.5.30 ndb-7.2.12, Nodegroup: 0)
id=3 @192.168.68.131 (mysql-5.5.30 ndb-7.2.12, Nodegroup: 0, Master)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @192.168.68.129 (mysql-5.5.30 ndb-7.2.12)
[mysqld(API)] 2 node(s)
id=4 @192.168.68.129 (mysql-5.5.30 ndb-7.2.12)
id=5 @192.168.68.131 (mysql-5.5.30 ndb-7.2.12)
ndb_mgmd -f /usr/local/mysql-cluster/config.ini
MySQL Cluster Management Server mysql-5.5.30 ndb-7.2.12
[root@localhost ~]# ndbd --initial
2013-05-05 15:49:22 [ndbd] INFO -- Angel connected to '192.168.68.129:1186'
2013-05-05 15:49:22 [ndbd] INFO -- Angel allocated nodeid: 2
Comments
Post a Comment