Description:
I am going to install Mysql clustering on Single node
Using below mentioned steps
1. install
Locate the tar ball that you’ve downloaded,
extract it and then create a link to it:
[~]$ gunzip Desktop/Downloads/msql-cluster-gpl-7.1.3-solaris10-i386.tar.gz
[~]$ tar xvf Desktop/Downloads/msql-cluster-gpl-7.1.3-solaris10-i386.tar
[~]$ ln –s msql-cluster-gpl-7.1.3-solaris10-i386 mysqlc
Optionally, you could add
~/mysqlc/bin
to your path to avoid needing the full path when running the processes.
2. onfigure
For a first Cluster, start wi
th a single MySQL Server (
mysqld
), a pair of Data Nodes (
ndbd
) and a single management node (
ndb_mgmd
)
– all running on the same server.
Create folders to store the config
uration files and the data files:
[~]$ mkdir my_cluster my_cluster/ndb_data my_cluster/mysqld_data my_cluster/conf
In the
conf
folder, create 2 files:
my.cnf
:
[mysqld]
ndbcluster
datadir=/home/user1/my_cluster/mysqld_data
basedir=/home/user1/mysqlc
port=5000
Copyright © 2010, 2011 Oracle and/or its affi
liates. All rights reserved.
Page 2 of 3
config.ini
:
[ndb_mgmd]
hostname=localhost
datadir=/home/user1/my_cluster/ndb_data
NodeId=1
[ndbd default]
noofreplicas=2
datadir=/home/user1/my_cluster/ndb_data
[ndbd]
hostname=localhost
NodeId=3
[ndbd]
hostname=localhost
NodeId=4
[mysqld]
NodeId=50
Note that in a production system there are other para
meters that you would set to tune the configuration.
Just like any other MySQL Server, the
mysqld
process requires a ‘mysql’ database to be
created and populated with essential system
data:
[~]$ cd mysqlc
[~/mysqlc]$ scripts/mysql_install_db --no-defaults --datadir=/home/user1/my_cluster/mysqld_data/
3. run
The processes should be started in the order of
management node, data nodes & then MySQL Server:
[~/mysqlc]$ cd ../my_cluster
[~/my_cluster]$ $HOME/mysqlc/bin/ndb_mgmd -f conf/config.ini --initial –configdir=$HOME/my_cluster/conf/
[~/my_cluster]$ $HOME/mysqlc/bin/ndbd -c localhost:1186
[~/my_cluster]$ $HOME/mysqlc/bin/ndbd -c localhost:1186
Check the status of the Cluster and wait for the Data N
odes to finish starting before starting the MySQL Server:
[~/my_cluster]$ $HOME/mysqlc/bin/ndb_mgm -e show
----------------------------------------------------------------------
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=3 @127.0.0.1 (mysql-5.5.31 ndb-7.2.13, Nodegroup: 0, Master)
id=4 @127.0.0.1 (mysql-5.5.31 ndb-7.2.13, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @127.0.0.1 (mysql-5.5.31 ndb-7.2.13)
[mysqld(API)] 1 node(s)
id=50 (not connected, accepting connect from any host)
----------------------------------------------------------------------------
bash-3.2# bin/mysqld --defaults-file=conf/my.conf&
[1] 4399
bash-3.2# Could not open required defaults file: /export/home/mysql-cluster-gpl-7.2.13-solaris10-x86_64/conf/my.conf
Fatal error in defaults handling. Program aborted
[1]+ Exit 1 bin/mysqld --defaults-file=conf/my.conf
-------------------------------------------------------------------------------
ash-3.2# bin/mysqld --defaults-file=/export/home/my_cluster/conf/my.cnf &
[1] 4339
bash-3.2# 131028 11:18:28 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
131028 11:18:28 [ERROR] Aborting
131028 11:18:28 [Note] bin/mysqld: Shutdown complete
Pls suggest
How to repeat:
I am going to install Mysql clustering on Single node
Using below mentioned steps
1. install
Locate the tar ball that you’ve downloaded,
extract it and then create a link to it:
[~]$ gunzip Desktop/Downloads/msql-cluster-gpl-7.1.3-solaris10-i386.tar.gz
[~]$ tar xvf Desktop/Downloads/msql-cluster-gpl-7.1.3-solaris10-i386.tar
[~]$ ln –s msql-cluster-gpl-7.1.3-solaris10-i386 mysqlc
Optionally, you could add
~/mysqlc/bin
to your path to avoid needing the full path when running the processes.
2. onfigure
For a first Cluster, start wi
th a single MySQL Server (
mysqld
), a pair of Data Nodes (
ndbd
) and a single management node (
ndb_mgmd
)
– all running on the same server.
Create folders to store the config
uration files and the data files:
[~]$ mkdir my_cluster my_cluster/ndb_data my_cluster/mysqld_data my_cluster/conf
In the
conf
folder, create 2 files:
my.cnf
:
[mysqld]
ndbcluster
datadir=/home/user1/my_cluster/mysqld_data
basedir=/home/user1/mysqlc
port=5000
Copyright © 2010, 2011 Oracle and/or its affi
liates. All rights reserved.
Page 2 of 3
config.ini
:
[ndb_mgmd]
hostname=localhost
datadir=/home/user1/my_cluster/ndb_data
NodeId=1
[ndbd default]
noofreplicas=2
datadir=/home/user1/my_cluster/ndb_data
[ndbd]
hostname=localhost
NodeId=3
[ndbd]
hostname=localhost
NodeId=4
[mysqld]
NodeId=50
Note that in a production system there are other para
meters that you would set to tune the configuration.
Just like any other MySQL Server, the
mysqld
process requires a ‘mysql’ database to be
created and populated with essential system
data:
[~]$ cd mysqlc
[~/mysqlc]$ scripts/mysql_install_db --no-defaults --datadir=/home/user1/my_cluster/mysqld_data/
3. run
The processes should be started in the order of
management node, data nodes & then MySQL Server:
[~/mysqlc]$ cd ../my_cluster
[~/my_cluster]$ $HOME/mysqlc/bin/ndb_mgmd -f conf/config.ini --initial –configdir=$HOME/my_cluster/conf/
[~/my_cluster]$ $HOME/mysqlc/bin/ndbd -c localhost:1186
[~/my_cluster]$ $HOME/mysqlc/bin/ndbd -c localhost:1186
Check the status of the Cluster and wait for the Data N
odes to finish starting before starting the MySQL Server:
[~/my_cluster]$ $HOME/mysqlc/bin/ndb_mgm -e show
----------------------------------------------------------------------
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=3 @127.0.0.1 (mysql-5.5.31 ndb-7.2.13, Nodegroup: 0, Master)
id=4 @127.0.0.1 (mysql-5.5.31 ndb-7.2.13, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @127.0.0.1 (mysql-5.5.31 ndb-7.2.13)
[mysqld(API)] 1 node(s)
id=50 (not connected, accepting connect from any host)
----------------------------------------------------------------------------
bash-3.2# bin/mysqld --defaults-file=conf/my.conf&
[1] 4399
bash-3.2# Could not open required defaults file: /export/home/mysql-cluster-gpl-7.2.13-solaris10-x86_64/conf/my.conf
Fatal error in defaults handling. Program aborted
[1]+ Exit 1 bin/mysqld --defaults-file=conf/my.conf
-------------------------------------------------------------------------------
ash-3.2# bin/mysqld --defaults-file=/export/home/my_cluster/conf/my.cnf &
[1] 4339
bash-3.2# 131028 11:18:28 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
131028 11:18:28 [ERROR] Aborting
131028 11:18:28 [Note] bin/mysqld: Shutdown complete
Pls suggest
Suggested fix:
no idea