MySQL Agent: Mysql-proxy to achieve read-write separation

Source: Internet
Author: User
Tags mysql client

This article System Centos6.0

The MySQL agent is a simple program between the MySQL client and the MySQL server that can be used to monitor, analyze, or transmit communication between them. His flexibility allows you to use it as much as possible, including load balancing, fault tolerance, analysis and corrections, and so on.

master:192.168.182.128

slave:192.168.182.129

mysql-proxy:192.168.182.130

1, the master-slave server installation database;

Master, slave operations:

[Root@master ~]# yum install MySQL mysql-devel-y

Configure master-slave replication;

Master

VIM/ETC/MY.CNF
log-bin=mysql-bin   #新增
server-id=1              #新增

Slave

VIM/ETC/MY.CNF
log-bin=mysql-bin   #新增
server-id=2             #新增

Master: Add authorized users;

mysql> grant replication Slave on *.* to ' Leo ' @ '% ' identified by ' leo123 ';

This column more highlights: http://www.bianceng.cn/database/MySQL/

Slave

mysql> Change Master to master_host= ' 192.168.182.128 ', master_user= ' Leo ', master_password= ' leo123 ', Master_log_ File= ' mysql-bin.000001 ', master_log_pos=247;
mysql> start slave;

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.