Test the read/write splitting of MySQLCluster-create an Amoeba Environment

Source: Internet
Author: User
Learning about MySQLCluster continues. This time, OneCoder uses Amoeba to build a MySQL cluster environment with read/write splitting and load balancing. Like MySQLCluster, the installation process is to download, decompress, configure, and start. Amoeba official document address: docs.hexnova.comamoebaindex.html Amoeba Project address:

Learning about MySQL Cluster continues. This time, OneCoder uses Amoeba to build a MySQL Cluster environment with read/write splitting and load balancing. Like MySQL Cluster, the installation process is to download, decompress, configure, and start. Amoeba official documentation address: http://docs.hexnova.com/amoeba/index.html Amoeba Project address:

Learning about MySQL Cluster continues. This time, OneCoder uses Amoeba to build a MySQL Cluster environment with read/write splitting and load balancing.

Like MySQL Cluster, the installation process is to download, decompress, configure, and start.
Amoeba official documentation address: http://docs.hexnova.com/amoeba/index.html
Amoeba Project address: http://sourceforge.net/projects/amoeba/files/

After decompression, run the following command:

$>amoeba

The first problem occurred during verification:

The stack size specified is too small, Specify at least 160k.

This is obviously a problem with JVM parameters. Use vim to edit the amoeba Startup File. Modify the following:

Change the last-Xss128k of DEFAULT_OPTS = "-server..." in the selected row to K. Verification passed. Continue to configure Amoeba.

The following content is taken from the official Amoeba documentation:

What are the main configuration files of Amoeba? Imagine that Amoeba, as the database proxy layer, will certainly communicate with many databases, so it must know how the database on which it acts as the proxy connects, such as the most basic: host IP address, port, username and password used by Amoeba, etc. The information is stored in $ AMOEBA_HOME/conf/dbServers. xml. Amoeba provides complete sharding rule configuration to complete data sharding. To understand how to partition data and how to integrate the data returned by the database, it must know the sharding rule. Information related to splitting rules is stored in $ AMOEBA_HOME/conf/rule. xml. When writing SQL statements to operate databases, we often use many different database functions, such as UNIX_TIMESTAMP () and SYSDATE. How can these functions be parsed by Amoeba? $ AMOEBA_HOME/conf/functionMap. xml describes the relationship between function names and function processing. For $ AMOEBA_HOME/conf/rule. some of our own functions are used for xml configuration. For example, we need to calculate the HASH value for the user ID to split the data. These functions are available in $ AMOEBA_HOME/conf/ruleFunctionMap. it is defined in xml. Amoeba allows you to specify IP addresses of hosts that can be accessed or access is denied. In $ AMOEBA_HOME/conf/access_list.conf, Amoeba allows you to configure the log output level and method, the configuration method uses the log4j file format. The file is $ AMOEBA_HOME/conf/log4j. xml.

Modify the database link configuration in dbServers. xml at a glance ).

Then confirm that the MySQL Cluster runs normally and then start Amoeba.

Use the MySQL command to directly connect to MySQL 205 for testing. Access successful.

In fact, OneCoder encountered a very clever problem, that is, server1 in my environment is temporarily unavailable, and I only configured server2. It can be started, but the client connection always reports that access is denied. After several checks, a default node setting is found in amoeba. xml. Also configured server1, changed to server2 is finally easy to use.

,

The version of the service is mysql-amoeba-proxy. The show databases command can also be used to list the Database List.

Original article address: MySQL Cluster read/write splitting verification-Amoeba environment setup. Thanks to the original author for sharing.

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.