MySQL in-depth use of ameoba for read-write separation

Source: Internet
Author: User

3 Ameoba Installation Configuration

?

3.1 Installing the configuration JDK

[Email protected] ~]# RPM-IVH jdk-7u67-linux-x64.rpm

[Email protected] ~]# cd/usr/java/

?

modifying environment variables

?

[Email protected] ~]# vim/etc/profile.d/java.sh

[Email protected] ~]# cat/etc/profile.d/java.sh

Export Java_home=/usr/java/latest

Export path= $JAVA _home/bin: $PATH

#即时生效配置文件

[Email protected] ~]#. /etc/profile.d/java.sh

Test: Execute java-version, the correct words should be displayed:

[Email protected] ~]# java-version

Java Version "1.7.0_67"

Java (TM) SE Runtime Environment (build 1.7.0_67-b01)

Java HotSpot (TM) 64-bit Server VM (build 24.65-b04, Mixed mode)

?

Lftp 172.16.0.1:/pub/sources/6.x86_64/amoeba>

[Email protected] ~]# Mkdir/usr/local/amoeba

[Email protected] ~]# tar XF amoeba-mysql-binary-2.2.0.tar.gz-c/usr/local/amoeba

?

?

?

[[email protected] amoeba]# Bin/amoeba start

?

The stack size specified is too small, specify at least 228k

Error:could not create the Java Virtual machine.

ERROR:A Fatal exception has occurred. Program would exit.

#解决方法

[Email protected] bin]# pwd

/usr/local/amoeba/bin

default_opts= "-server-xms256m-xmx256m-xss516k"

?

?

?

?

?

?

?

?

[[email protected] amoeba]# Bin/amoeba start

?

?

3.4 Use validation

?

# Login Verification

[Email protected] ~]# mysql-h127.0.0.1-uroot-p-p3306

Mysql> Show master status;

+------------------+----------+--------------+------------------+

| File | Position | binlog_do_db | binlog_ignore_db |

+------------------+----------+--------------+------------------+

| mysql-bin.000003 | 961 | | |

+------------------+----------+--------------+------------------+

1 row in Set (0.06 sec)

?

?

Test read/write separation:

On the Amoea node node15 of the installation, create a database that looks at all the databases for the backend node master (NODE16), Slave (NODE17), respectively:

mysql> CREATE DATABASE Amoeba_test;

Query OK, 1 row affected (0.11 sec)

?

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| Information_schema |

| Amoeba_test |

| MySQL |

| Performance_schema |

| Test |

+--------------------+

5 rows in Set (0.00 sec)

?

[[email protected] ~]# MySQL

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| Information_schema |

| MySQL |

| Performance_schema |

| Test |

+--------------------+

4 rows in Set (0.07 sec)

?

?

# After logging in from the Amoeba interface to create the database amoeba_test, and then from the main library interface to query the database has been created, indicating that the write is actually landed on the main library node;

# to verify that Ameoba is scheduled for a read operation, you need to temporarily stop the copy operation from the library and then update the data on the main library so that reading data from Ameoba will appear

MySQL in-depth use of ameoba for 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.