Professional Documents
Culture Documents
Mysql Cluster Single Host
Mysql Cluster Single Host
com)
Kebutuhan :
- Paket installer mysql-cluster-versi_anda-xxx.tar.gz
- Profil user setara root pada system Linux anda.
1. Installasi MySQL :
[rizky@shellcode]# cd /usr/local/mysql/conf
[rizky@shellcode]# vi config.ini
[ndbd default]
noofreplicas=2
[ndbd]
hostname=localhost
id=2
[ndbd]
hostname=localhost
id=3
[ndb_mgmd]
id=1
hostname=localhost
[mysqld]
id=4
hostname=localhost
[mysqld]
id=5
hostname=localhost
[mysqld]
id=6
hostname=localhost
[rizky@shellcode]# vi my.1.conf
ndb-nodeid=4
ndbcluster=true
socket=/tmp/mysql1.sock
datadir=/usr/local/mysql/data/data1
basedir=/usr/local/mysql
port=3306
server-id=1
log-bin
[rizky@shellcode]# vi my.2.conf
ndb-nodeid=5
ndbcluster=true
socket=/tmp/mysql2.sock
datadir=/usr/local/mysql/data/data2
basedir=/usr/local/mysql
port=3307
server-id=2
log-bin
[rizky@shellcode]# vi my.3.conf
ndb-nodeid=6
ndbcluster=true
socket=/tmp/mysql3.sock
datadir=/usr/local/mysql/data/data3
basedir=/usr/local/mysql
port=3306
server-id=3
log-bin
[rizky@shellcode]# /usr/local/mysql/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 @127.0.0.1 (mysql-5.1.34 ndb-7.0.6, Nodegroup: 0, Master)
id=3 @127.0.0.1 (mysql-5.1.34 ndb-7.0.6, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @127.0.0.1 (mysql-5.1.34 ndb-7.0.6)
[mysqld(API)] 3 node(s)
id=4 @127.0.0.1 (mysql-5.1.34 ndb-7.0.6)
id=5 @127.0.0.1 (mysql-5.1.34 ndb-7.0.6)
id=6 @127.0.0.1 (mysql-5.1.34 ndb-7.0.6)
ndb_mgm>
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Database changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| rtes |
+----------------+
1 row in set (0.00 sec)
mysql>