Amoeba realizing MySQL read-write separation

Source: Internet
Author: User
Tags lua

Because of the drbd+mysql+heartbeat done before. Feel high available to do is not thorough enough. Just understand the next amoeba.


    • Document Address:http://docs.hexnova.com/amoeba/index.html

Download: http://sourceforge.net/projects/amoeba/files/

    • Amoeba function: Agent.

Amoeba for MySQLcommitted toMySQLdistributed database front-end agent layer, which is primarily accessed at the application levelMySQLthe time to act asQueryrouting capabilities, focusingDistributed DatabaseProxydevelopment. Located withClient,DB Server (s)between. Transparent to the client. With load balancing, high availability,Queryfiltering, read-write separation, routable-relatedQueryto the target database and can concurrently request multiple databases to merge results. in theAmoebaabove you can complete the multi-data source of high availability, load balancing, data slicing function. Currently in the production line of many enterprises to use.

    • Amoeba for MySQL vs MySQL Proxy

in the MySQL Proxy 6.0 version above if you want to read and write separation and read the cluster, write the cluster machine more cases, with MySQL proxy requires a considerable amount of work, the current MySQL proxy does not have a ready- made Lua script. MySQL proxy does not have a configuration file at all, and the Lua script is its entirety, of course Lua is quite handy. So the same thing requires writing a lot of scripts to complete a complex configuration. Amoeba for Mysql only needs to be configured to meet the requirements.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/70/19/wKioL1Wxyv7RhK0vAAKt0tvUXlY858.jpg "title=" 1.png " Style= "Float:none;" alt= "wkiol1wxyv7rhk0vaakt0tvuxly858.jpg"/>

    • Installation:

JDK Environment Build: Run Jdk-6u26-linux-i586.bin Set environment variable: [[email protected]~]# tail/etc/profileexportjava_home=/usr/java/ Jdk1.6export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH
    • Read/write Separation configuration:

A. Provisioning server resources VIM Dbservers.xml

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/19/wKioL1WxyxfDcjIyAARo9oPGfa4906.jpg "title=" 2.jpg " Style= "Float:none;" alt= "wkiol1wxyxfdcjiyaaro9opgfa4906.jpg"/>

B. Configuring read-write Separation rules:vim Conf/amoeba.xml


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/19/wKioL1Wxyz-BefgDAALNVYqVujI314.jpg "title=" 3.png " Style= "Float:none;" alt= "wkiol1wxyz-befgdaalnvyqvuji314.jpg"/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/1C/wKiom1WxyV7w8fSCAADQ935jt7I174.jpg "style=" float: none; "title=" 4.png "alt=" Wkiom1wxyv7w8fscaadq935jt7i174.jpg "/>

    • To start the test:

[[email protected] bin] #amoeba start

during the test, my Mysql Master and slave just did not sync, so when the test . written in Master, read it in SLAVE. It's easier to see it!


Amoeba realizing MySQL read-write separation

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.