Today simple to do a MySQL cluster experiment, still smooth, the steps recorded, after the yaxing again to the layout of the supplement
Environment Description:
192.168.6.240 Management node SQL node data node
192.168.5.172 SQL Node Data node
Get ready:
Download the binary package mysql-cluster-gpl-7.4.12-linux-glibc2.5-x86_64.tar.gz
Extract
Tar zxvf mysql-cluster-gpl-7.4.12-linux-glibc2.5-x86_64.tar.gz
Placed on two machines/usr/local/mysql-cluster
Configuration:
On two machines.
Add Export path= $PATH:/usr/local/mysql-cluster/bin to/etc/profile
Create MySQL users and groups
Create Data Catalog
Mkdir-p/mysql/data
Modifying a configuration file/etc/my.cnf
[Client] Socket=/mysql/data/mysql.sock
[Mysqld] Character-set-server = Ndbcluster max_connections=100 Basedir=/usr/local/mysql-cluster Datadir=/mysql/data Socket=/mysql/data/mysql.sock Ndbcluster ndb-connectstring=192.168.6.240
[Mysqld_safe] Log-error=/mysql/data/error.err Pid-file=/mysql/data/mysql.pid
[Mysql_cluster] ndb-connectstring=192.168.6.240 |
Initializing data nodes
Cd/usr/local/mysql-cluster
./scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql-cluster--datadir=/mysql/data--defaults-file=/ Etc/my.cnf
Execute on 6.240 (Management node)
Vim/usr/local/mysql-cluster/config.ini
[NDBD DEFAULT] noofreplicas=2 datamemory=1024m indexmemory=1024m
[TCP DEFAULT] portnumber=2202
[NDB_MGMD] Id=1 hostname=192.168.6.240 Datadir=/usr/local/mysql-cluster
[NDBD] id=2 hostname=192.168.6.240 Datadir=/mysql/data
[NDBD] Id=3 hostname=192.168.5.172 Datadir=/mysql/data
[MYSQLD] hostname=192.168.6.240
[MYSQLD] hostname=192.168.5.172 |
Start:
The node's boot order is the data node, the management node,->sql node
Management node
Ndb_mgmd-f/usr/local/mysql-cluster/comfig.ini
Data node
NDBD--initial
SQL node
/usr/local/mysqld_safe--user=mysql &
Management Maintenance cluster:
Cluster off:
Common Administrative commands:
Log Management:
Backup and Recovery:
Add/Remove Nodes
Optimization:
Find a problem like InnoDB, MyISAM table, insert data is added later, and Ndbcluster is added earlier. The principle is explained another day.
This article from "Vampire--it Life" blog, reproduced please contact the author!
MySQL Cluster experiment