Deploy multi-point mysql-cluster7.3.2 server in ubuntu under Virtual Machine

Source: Internet
Author: User

Ubuntu Virtual Machine deployment of Multi-Point mysql-cluster7.3.2 server deployment environment: System: ubuntu-12.04.2 LTS-server-i386.iso Cluster: mysql-cluster-gpl-7.3.2-linux-glibc23-i686.tar.gz Description: 1, it is best not to install Mysql-server (here cluster is a binary Version) 2. chkconfig needs to be installed separately and libaio1 must be installed separately to solve libaio. so.1 the problem cannot be found. When installing mysql, you need to install this component to finally solve the problem of multiple points today. This is a verified version. Mgm node: 192.168.131.11 SQL Data node: 192.168.131.12 SQL Data node: 192.168.131.13 (1) install management Node 1. Unzip the file sudo tar-zvxf mysql-cluster-gpl-7.3.2-linux-glibc23-i686.tar.gz sudo mv mysql-cluster-gpl-7.3.2-linux-glibc23-i686 mysqlc 2. Create the installation directory sudo mkdir-p/home/lwprain/ndbdata sudo cd mysqlc sudo cp bin/ndb_mgmd/ usr/local/bin sudo cp bin/ndb_mgm/usr/local/bin 3. Configure the log file storage directory sudo mkdir/var/lib/mysql-cluster 4. Create the configuration file Recording and file sudo touch config. ini sudo nano config. ini = = [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] # definition Management node IP address or host name nodeid = 1 HostName = 192.168.131.11 DataDir =/var/lib/mysql-cluster [ndbd] # define data node nodeid = 11 HostName = 192.168.131.12 DataDir =/home/lwprain /ndbdata [ndbd] # define data node nodeid = 12 HostName = 192.168. 131.13 DataDir =/home/lwprain/ndbdata [ndbd] [mysqld] # define SQL node nodeid = 21 HostName = 192.168.131.12 [ndbd] [mysqld] # define SQL node nodeid = 22 HostName = 192.168.131.13 [mysqld] [mysqld] ============================== ================================= (2) install SQL Data node unzip file sudo tar-zvxf mysql-cluster-gpl-7.3.2-linux-glibc23-i686.tar.gz sudo mv mysql-cluster-gpl-7.3.2-linux-glibc23-i686 mysqlc create installation directory mkdir-p/home/lwprain/ndbda Ta copy the execution file cp mysqlc/bin/ndbd/usr/local/bin add mysql user groupadd mysql useradd-g mysql add permission chown-R mysql: mysql/home/lwprain/mysqlc copy configuration file cp/home/lwprain/mysqlc/support-files/my-default.cnf/etc/my. cnf initializes the database cd/home/lwprain/mysqlc scripts/mysql_install_db -- user = cp/home/lwprain/mysqlc/support-files/mysql to copy the files required by the daemon. server/etc/init. d/mysqld change configuration file sudo nano/etc/my. cnf # Replay from mysqlc Edit the following information in/etc: [mysqld] # configure the connection port between the SQL node and the management node = 3306 socket =/tmp/mysql. sock ndbcluster ndb-connectstring = 192.168.131.11 [mysql_cluster] # configure the data node connection management node ndb-connectstring = 192.168.131.11 (3) start and stop the Cluster in sequence: management node ---> data node ---> SQL node Note: show in ndb_mgm is displayed correctly only after all the nodes are started. (This is a key factor that is considered unsuccessful and has been a detour) 1. Start the management node cd/usr/local/bin/ndb_mgmd-f/home/lwprain/config. ini ndb_mgm (view node connection status) 2. Start the data node/usr/local/bin/ndbd- -Initial (this command is used for the first startup)/usr/local/bin/ndbd (this command will be used later) 3, start the SQL node/home/lwprain/mysqlc/bin/mysqld_safe -- user = mysql & after setting the path, you can flexibly execute the mysql command to log on to your user (non-root ), enter $ sudo nano ~ on the terminal ~ /. Profile can be added to the end of this file with the following PATH settings: export PATH = "PATH:/home/lwprain/mysqlc/bin/" to save the file, log out, and then log on. The variable takes effect. The variables added in this method are only valid for the current user. Then, log on to mysql-uroot show engines on a server. You can check whether the ndbcluster has been installed successfully to create a database and the table create database test; create table tt (id int (10 )) engine = ndbcluster; insert into tt (1); then go to another server to check whether the database is synchronized

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.