Amoeba-mysql Master-slave + read/write separate combat + Test + Debug

Source: Internet
Author: User

Amoeba-mysql Read and write separate combat

Amoeba use a lot, here to see the title we first say read and write separation, because I will only this. Amoeba is defined as domestic, open source. Currently (October 20, 2015) We use the amoeba2.2 version to do.

First say I environment: 650) this.width=650; "title=" 1.png "src=" http://s3.51cto.com/wyfs02/M00/74/AF/ Wkiol1ym5zbyixexaaday0vnumg256.jpg "alt=" wkiol1ym5zbyixexaaday0vnumg256.jpg "style=" padding:0px;margin:0px; Vertical-align:top;border:none; "/>



Mysql 5.6

Centos 6.4

MySQL one master two from is OK.

Amoeba 2.2.x

amoeba:http://sourceforge.net/projects/amoeba/files/amoeba%20for%20mysql/

Since amoeba needs to use jave SE, we need to install the JDK environment.

The latest 1.8 is available.

To install the JDK:

RPM-IVH jdk-8u60-linux-x64.rpm

650) this.width=650; "title=" 2.png "src=" Http://s3.51cto.com/wyfs02/M01/74/B2/wKiom1Ym50jR_QM_AAEV4426fbg217.jpg " alt= "Wkiom1ym50jr_qm_aaev4426fbg217.jpg" width= "650" style= "Padding:0px;margin:0px;vertical-align:top;border: none; "/>


Source/etc/profile

To verify the JDK:

650) this.width=650; "title=" 3.png "src=" Http://s3.51cto.com/wyfs02/M02/74/B2/wKiom1Ym52qSsKYOAAEhME4H_Cc727.jpg " alt= "Wkiom1ym52qsskyoaaehme4h_cc727.jpg" width= "650" style= "Padding:0px;margin:0px;vertical-align:top;border: none; "/>

The JDK is done, and now the amoeba installation begins.

Create a catalog file first

Mkdir/usr/local/amoeba

Tar zxvf amoeba-mysql-binary-2.2.0.tar.gz-c/usr/local/amoeba

Unzip the specified directory

650) this.width=650; "title=" 4.png "src=" Http://s3.51cto.com/wyfs02/M02/74/AF/wKioL1Ym57rCmWhXAAFbVfwqpww932.jpg " alt= "Wkiol1ym57rcmwhxaafbvfwqpww932.jpg" style= "padding:0px;margin:0px;vertical-align:top;border:none;"/>


Then we go into the Conf file, where the XML for the storage amoeba set the data to connect to MySQL

Under the Amoeba directory, enter

./bin/amoeba

650) this.width=650; "title=" 5.png "src=" Http://s3.51cto.com/wyfs02/M00/74/B2/wKiom1Ym56mhWXu9AABAvOaodL4427.jpg " alt= "Wkiom1ym56mhwxu9aabavoaodl4427.jpg" style= "padding:0px;margin:0px;vertical-align:top;border:none;"/>

If there is a description amoeba install OK,

Next set the parameters of the amoeba, set the parameters of the file in the Conf directory under Amoeba.xml and dbservers.xml two files.

See Dbserviers.xml first.

650) this.width=650; "title=" 6.png "src=" Http://s3.51cto.com/wyfs02/M00/74/AF/wKioL1Ym5-uyJ-yDAARt_eq2r5A452.jpg " alt= "Wkiol1ym5-uyj-ydaart_eq2r5a452.jpg" width= "650" style= "Padding:0px;margin:0px;vertical-align:top;border: none; "/>


Grant all on * * to [e-mail protected] ' 192.168.0.191 ' identified by "123456"; This command needs to be run on the client, so that the amoeba scheduler can connect to our database and do the operation

650) this.width=650; "title=" 7.png "src=" Http://s3.51cto.com/wyfs02/M01/74/B2/wKiom1Ym5-HyttdUAAPoUDHtH64447.jpg " alt= "Wkiom1ym5-hyttduaapoudhth64447.jpg" width= "650" style= "Padding:0px;margin:0px;vertical-align:top;border: none; "/>


This dbservers.xml is set up here.

Next look at Amoeba.xml.


650) this.width=650; "title=" 8.png "src=" Http://s3.51cto.com/wyfs02/M02/74/B2/wKiom1Ym5_2SAOlWAAMQ1eTXXC4730.jpg " alt= "Wkiom1ym5_2saolwaamq1etxxc4730.jpg" width= "650" style= "Padding:0px;margin:0px;vertical-align:top;border: none; "/>650) this.width=650;" title= "9.png" src= "http://s3.51cto.com/wyfs02/M02/74/AF/wKioL1Ym6D_ H4zpraan8fzp7mgk709.jpg "alt=" wkiol1ym6d_h4zpraan8fzp7mgk709.jpg "width=" 650 "style=" padding:0px;margin:0px; Vertical-align:top;border:none; "/>


Save after configuration is complete.

Then enable Amoeba

/usr/local/amoeba/bin/amoeba & & means running in the background

If it appears

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/75/77/wKiom1Y5tEDQktl4AAFO8PV24ao190.jpg "title=" 1.png " alt= "wkiom1y5tedqktl4aafo8pv24ao190.jpg"/> open Bin/amoeba

Default_opts= "-server-xms256m-xmx256m-xss128k"
Change into

Default_opts= "-server-xms256m-xmx256m-xss256k"




Use Ps–ef |grep amoeba to see if it starts.

View NETSTAT-TUNLP | grep 8066 See if the port is open

# #amoeba这台机器是不用开启mysql服务

Verify on other clients that you can log on to amoeba;

650) this.width=650; "title=" 10.png "src=" http://s3.51cto.com/wyfs02/M02/74/AF/wKioL1Ym6F7hkcY1AABGN6mSdvA342.jpg "alt=" wkiol1ym6f7hkcy1aabgn6msdva342.jpg "style=" Padding:0px;margin:0px;vertical-align:top;border:none;/>



This means that the login was successful.

650) this.width=650; "title=" 11.png "src=" http://s3.51cto.com/wyfs02/M00/74/B2/wKiom1Ym6E-A4lJoAAEF1P-PbwU124.jpg "alt=" wkiom1ym6e-a4ljoaaef1p-pbwu124.jpg "style=" Padding:0px;margin:0px;vertical-align:top;border:none;/>



The read and write separation has been completed, if you want to combine to the previous Web application on the Web side of the database connection to amoeba this server 8066 port, User name password is the user name and secret (not real-mysql-server) user configured in Amoeba.xml.

Here I front-end Web is discuz forum, need to revise/usr/local/nginx/html/config/config_global.php

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/75/76/wKioL1Y5v6SCVrOXAAKfBq_TL2g715.jpg "title=" 2.png " alt= "Wkiol1y5v6scvroxaakfbq_tl2g715.jpg"/>

Amoeba-mysql Master-slave + read/write separate combat + Test + Debug

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.