Ubuntu Server deployment MysqlCluster Cluster deployment environment: System: ubuntu-12.04.1-server-i386.iso cluster: mysql-cluster-gpl-7.0.37-linux-i686-glibc23.tar.gz Description: 1, do not install Mysql before deployment, some people are deployed with Mysql deployment, but if you use Cluster binary, do not install Mysql 2. Some system commands cannot be used, so be sure to prepare for these commands: three computer Mgm nodes: 192.168.21.183 Data node: 192.168.21.60 SQL node: 192.168.21.19 (1) install the management Node
1. decompress the file tar-zvxf mysql-cluster-gpl-7.0.37-linux-i686-glibc23.tar.gz2, create the installation directory mkdir-p/usr/local/mysql/ndbdatacd mysql-cluster-gpl-7.0.37-linux-i686-glibc23.tar.gzcp bin/ndb_mgmd/usr/local/bincp bin/ndb_mgm/usr/local /bin3, configure the log file storage directory mkdir/var/lib/mysql-cluster4, create the configuration file directory and file mkdir/usr/local/mysql/cluster-confvi/usr/local/mysql/ cluster-conf/config. ini
========================= Configuration file content ========================== [ndbd default] NoOfReplicas = 2 # Number of copied members DataMemory = 80 M # Memory allocated for data storage IndexMemory = 18 M # Memory allocated for index storage [ndb_mgmd] # define Management Nodes IP address or host name id = 1 HostName = 192.168.21.183DataDir =/var/lib/mysql-cluster [ndbd] # define data node id = 11 HostName = 192.168.21.60DataDir =/usr/local/mysql/ ndbdata [ndbd] [mysqld] # define the SQL node id = 21 HostName = 192.168.21.19 ================== ==================================
(2) install data nodes
Decompress the file tar-zvxf mysql-cluster-gpl-7.0.37-linux-i686-glibc23.tar.gz to create the installation directory mkdir-p/usr/local/mysql/binmkdir-p/usr/local/mysql/ndbdata copy the execution file cp mysql-cluster-gpl-7.0.37-linux-i686-glibc23/bin/ndbd/ usr/local/mysql/bin Add the execution file path vi ~ /. Bash_profilePATH = $ PATH: $ HOME/bin:/usr/local/mysql/bin create a configuration file: vi/etc/my. cnf: [mysql_cluster] # configure the data node connection management node ndb-connectstring = 192.168.21.183
(3) Install SQL nodes
Unzip the file tar-zvxf mysql-cluster-gpl-7.0.37-linux-i686-glibc23.tar.gz copy the Installation File mv mysql-cluster-gpl-7.0.37-linux-i686-glibc23/usr/local/mysql add mysql user groupadd mysqluseradd-g mysql add permission chown-R mysql: mysql/usr/local/mysql copy configuration file cp/usr/local/mysql/support-files/my-large.cnf/etc/my. cnf initializes the database cd/usr/local/mysqlscripts/mysql_install_db -- user = mysql to copy the file cp/usr/local/mysql/support-files/mysql required by the daemon. server /Etc/init. d/mysqld configuration daemon chkconfig-add mysqldchkconfig-level 35 mysqld on add the execution file path vi ~ /. Bash_profilePATH = $ PATH: $ HOME/bin:/usr/local/mysql/bin change the configuration file vi/etc/my. edit the following information for cnf: [mysqld] # configure the connection port between the SQL node and the management node = 3306 socket =/tmp/mysql. sockndbclusterndb-connectstring = 192.168.21.183
(4) start and stop a Cluster in sequence: manage nodes ---> data nodes ---> SQL nodes
1. Start the management node cd/usr/local/bin/ndb_mgmd-f/usr/local/mysql/cluster-conf/config. ininindb_mgm (view node connection information) 2. Start the data node/usr/local/mysql/bin/ndbd -- initial (this command is used for the first startup) /usr/local/mysql/bin/ndbd (Use this command later) 3. Start the SQL node/usr/local/mysql/bin/mysqld_safe -- user = mysql &