CentOS system Amoeba+mysql Master-Slave read/write separation configuration suitable for novice dummies tutorial! -----for reference only!

Source: Internet
Author: User

nonsense not to say, to begin directly:

One, the installation of three ways of MySQL, here the 2nd type (installation method no longer detailed, please refer to)

Http://www.cnblogs.com/babywaa/articles/4837946.html

1, RPM Installation
2. Source code Installation
3, Universal binary source installation

Environment preparation

192.168.5.10 Master1

192.158.5.20 slave1

Second, configure the master server, 192.168.5.10
1.
The first step:Log in to MySQL and add a password to the root account//reference command:SetPassword = PASSWORD (' pasword ');
Step Two:View MySQL version number//reference command:Select version ();
Step Three:Add slave to Native sync remote account//reference command:GRANT REPLICATION SLAVE on * * to ' SLAVE ' @ ' 192.168.5.10 ' identified by ' SLAVE ';
Part Fourth:View all users of current MySQL//reference command:Select User,host,password from Mysql.user;
Fifth Step:Delete the account password is empty the localhost account//reference command:Drop user ' @ ' localhost ';
part sixth:Delete account password is empty IZ25OGXAHFRZ account//reference command:Drop user ' @ ' iz25ogxahfrz ';
Seventh Step:Quit MySQL//reference command:\q

2. Edit my.cnf configuration file //reference command:vim my.cnf

3.
First step: restart MySQL service //reference command:service MySQL Restart
Step two: log in with the root user + password MySQL //reference command:Mysql-uroot-ppassword
Step Three: view the ID number of master //reference command:show VARIABLES like ' service_id ‘;
Fourth: View the current master's File+pos information and record the //reference command:show master status;

Third, configure the slave server, 192.168.5.20
1.
The first step:Log in to MySQL and add a password to the root account//reference command:SetPassword = PASSWORD (' pasword ');
Step Two:View MySQL version number//reference command:Select version ();
Step Three:View all users of current MySQL//reference command:Select User,host,password from Mysql.user;
Fourth Step:Delete the account password is empty the localhost account//reference command:Drop user ' @ ' localhost ';
Part Fifth:Delete account password is empty Iz25i0yer0yz account//reference command:Drop user ' @ ' iz25i0yer0yz ';
Sixth step:Quit MySQL//reference command:\q

2. edit Slave server my.cnf configuration file //reference command:vim my.cnf

3,
First step: restart MySQL service                                            ,         &NB Sp  //Reference command: service mysql Restart
Step two: view the ID number of the slave server //Reference command: SHOW VARIABLES like ' service_id ';
Step three: view slave synchronization status //reference command: show slave status\g
Fourth:         strong> shut down the slave server to prevent additions and deletions.   //reference command: stop slave;
Fifth Step: Configure slave How to synchronize master's data     //reference command: change Master to Maste R_host= ' 192.168.5.10 ', master_user= ' slave ', master_password= ' slave ', master_port=3306, master_log_file= ' Master_ Bin.000001 ', master_log_pos=120;
Sixth: Open the features of the slave server //reference command: start slave;

4 . View slave sync status //reference command:show slave Status\g

MySQL Master configuration complete

Iv. installation Amoeba: dependent on the Java environment

Java installation
1. Installation

2. Grant amoeba a MySQL remote account
Mysql> GRANT All privileges on * * to ' amoeba ' @ ' 192.168.5.30 ' identified by ' amoeba ' with GRANT OPTION;

V. Installation of Amoeba:


Six, configuration:
1, configuration amoeba under the Dbservers.xml

2, configuration amoeba under the Amoeba.xml

Seven, start amoeba:
1, "It is best to start with the current mode, to see if there are errors in startup, after troubleshooting errors in the background start"
Some information on the Internet: JDK7 startup has minimum requirements for XSS parameters and must be greater than 228 to start the JVM
Solve:
Set-xss256k to resolve

1 #JVM_OPTIONS ="-server-xms256m-xmx1024m-xss196k-xx:permsize=16m-xx:maxpermsize=96m " 2 jvm_options="-server-xms1024m-xmx1024m-xss256k-xx:permsize=16m-xx:maxpermsize=96m "

# vim/usr/local/amoeba/jvm.properties


2, Start again: report the error, please see


3, as shown: I did not use the normal shutdown mode to shut down the amoeba service caused by the error
And then, after the kill process, you don't hold a mistake.
So this is a long lesson.
Close Amoeba:
#/usr/local/amoeba/bin/shutdown
Background boot and save the output log to/var/log/amoeba.log
#/usr/local/amoeba/bin/launcher >/var/log/amoeba.log 2>&1 &


Eight, landing test:
1, because there is no MySQL installed on the 30 machine, so find a machine equipped with MySQL to test
MYSQL-UAMOEBA-P123456-H192.168.0.251-P8066//specifies that the port's-p is uppercase and not equal to the other. Be sure to pay attention to casing


2. Successful landing, please test freely.
Test method: (1) Amoeba create the library and then log in to master, slave to see if there are any libraries you just created
(2) Stop master MySQL, and then slave on the creation of the library, cannot indicate success
(3) There are better testing methods on the Internet, not listed. Please find it yourself.
Nine, Amoeba+mysql master-Slave separation configuration is complete!

CentOS system Amoeba+mysql Master-Slave read/write separation configuration suitable for novice dummies tutorial! -----for reference only!

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.