MySQL cluster configuration in Linux

Source: Internet
Author: User
Recently, I have seen a lot of information about cluster. I have been studying the load balancing and high availability of Linux systems, but it has not been completely successful yet, but it only implements some simple services;

Recently, I have seen a lot of information about cluster. I have been studying the load balancing and high availability of Linux systems, but it has not been completely successful yet, but it only implements some simple services;

Recently, I have seen a lot of information about cluster. I have been studying the load balancing and high availability of Linux systems, but it has not been completely successful yet, but it only implements some simple services; today, I found that the MySQL cluster is not very complex. I spent an afternoon studying it and referring to the MySQL cluster configuration steps of the Nanu predecessors, A simple cluster is successful. But I don't understand it. Is it true that after the MySQL cluster configuration is complete, only tables in the database can be synchronized, rather than the entire database? Please give me some advice. Thank you!
Li zengji contact MSN: lzj0619@hotmail.com Email: zengji.li@gmail.com hope to communicate with you in Linux cluster!

I. experiment environment
1. Linux OS version. RedHat AS4-U2
2. Mysql database version mysql-max-5.0.22-Linux-i686-glibc23.tar.gz.
A total of three machine PCs installed with the RedHat AS4-U2 version, first ensure that the system does not have a package with mysql, if there is rpm-e.
PC1 IP: 192.168.10.196
PC2 IP: 192.168.10.197
PC3 IP: 192.168.10.198

Ii. Installation Procedure
1. Execute the following commands on PC1 and PC2 in order:
Music mysql-max-5.0.22-Linux-i686-glibc23.tar.gz/usr/local/
Cd/usr/local/
Tar zxvf mysql-max-5.0.22-Linux-i686-glibc23.tar.gz
Rm mysql-max-5.0.22-Linux-i686-glibc23.tar.gz
Music mysql-max-5.0.22-Linux-i686-glibc23 mysql
Groupadd mysql
Useradd-g mysql
Cd mysql
Scripts/mysql_install_db -- user = mysql
Chown-R mysql: mysql.
Cp/usr/local/mysql/support-files/my-medium.cnf/etc/my. cnf
Vi/etc/my. cnf
Find the line myisam_sort_buffer_size = 8 m, and add the following two lines to the end:
Ndbcluster
Ndb-connectstring = 192.168.10.198
Add the following six lines to the last line of my. cnf:
[Ndbd]
Connect-string = 192.168.10.198
[Ndb_mgm]
Connect-string = 192.168.10.198
[Ndb_mgmd]
Config-file =/var/lib/mysql-cluster
After modification, save and release!
Mkdir/var/lib/mysql-cluster
2. Execute the following command on PC3 in sequence:
Music mysql-max-5.0.22-Linux-i686-glibc23.tar.gz/usr/local/
Cd/usr/local/
Tar zxvf mysql-max-5.0.22-Linux-i686-glibc23.tar.gz
Rm mysql-max-5.0.22-Linux-i686-glibc23.tar.gz
Music mysql-max-5.0.22-Linux-i686-glibc23 mysql
Groupadd mysql
Useradd-g mysql
Cd mysql
Scripts/mysql_install_db -- user = mysql
Chown-R mysql: mysql.
Cp/usr/local/mysql/support-files/my-medium.cnf/etc/my. cnf
Vi/etc/my. cnf
Find the line myisam_sort_buffer_size = 8 m, and add the following two lines to the end:
Ndbcluster
Ndb-connectstring = 192.168.10.198
Add the following six lines to the last line of my. cnf:
[Ndbd]
Connect-string = 192.168.10.198
[Ndb_mgm]
Connect-string = 192.168.10.198
[Ndb_mgmd]
Config-file =/var/lib/mysql-cluster
After modification, save and release!
Mkdir/var/lib/mysql-cluster
Cd/var/lib/mysql-cluster
Touch config. ini
Vi config. ini enter the following information: (errors are not allowed for half a character)
[Ndbd default]
NoOfReplicas = 2
DataDir =/var/lib/mysql-cluster
[NDB_MGMD]
Hostname = 192.168.10.198
DataDir =/var/lib/mysql-cluster
[NDBD]
HostName = 192.168.10.197
[NDBD]
HostName = 192.168.10.196'
[MYSQLD]
[MYSQLD]
[MYSQLD]
Save and exit!
3. The configuration process has been completed so far. You need to set some shortcut commands below:
On PC1 and PC2, enter the following command:
Cp/usr/local/mysql/support-files/mysql. server/etc/rc. d/init. d/mysqld
Chmod + x/etc/rc. d/init. d/mysqld
Chkconfig-add mysqld
Ln-s/usr/local/mysql/bin/ndbd/usr/bin/ndbd
Vi/etc/rc. local
Add a line of ndbd and save and exit
On PC3, enter the following command:
Cp/usr/local/mysql/support-files/mysql. server/etc/rc. d/init. d/mysqld
Chmod + x/etc/rc. d/init. d/mysqld
Chkconfig-add mysqld
Ln-s/usr/local/mysql/bin/ndb_mgm/usr/bin/ndb_mgm
Ln-s/usr/local/mysql/bin/ndb_mgmd/usr/bin/ndb_mgmd
Add the following line after vi/etc/rc. local
/Usr/local/mysql/bin/ndb_mgmd-f/var/lib/mysql-cluster/config. ini
Save and exit!

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.