Preface: Atlasy caused by parity Tiger produced, developed on Mysqp-proxy, with Lua script, th used to replace Mysql-proxy and Amoebo, the latter two have ceased to develop.
atlas:192.168.168.130
master:192.168.168.128
slave:192.168.168.129
Configure Master and slave master-slave:
Reference: http://752030200.blog.51cto.com/8936921/1853460
First download the RPM installation package from the official. Https://github.com/Qihoo360/Atlas/releases # # EL6 for CentOS 6.x system, El5 for CentOS 5.x
3. Installation: Rpm-i atlas-2.2.1.el6.x86_64.rpm #默认安装路径:/usr/local/mysql-proxy/
4.VIM/USR/LOCAL/MYSQL-PROXY/CONF/TEST.CNF #修改配置文件, Note that there can be no space after the True,false parameter, otherwise it will error, judgment method: Non-editing mode, the cursor to the right can not move to the last means no space , otherwise there are spaces.
Mainly according to the actual adjustment of several:
[Mysql-proxy]
#带 # is a non-required configuration item
#管理接口的用户名
Admin-username = Atlas
#管理接口的密码
Admin-password = Atlas
#Atlas后端连接的MySQL主库的IP和端口, multiple items can be set, separated by commas
Proxy-backend-addresses = 192.168.168.128:3306
#Atlas后端连接的MySQL从库的IP和端口, the number at the end of the @ represents the weight, used for load balancing, and if omitted the default is 1, you can set multiple items, separated by commas
Proxy-read-only-backend-addresses = 192.168.168.129:[email protected]
#用户名与其对应的加密过的MySQL密码, password using the Prefix/bin directory encryption program encrypt encryption, downlink user1 and User2 For example, replace it with your MySQL username and encryption password!
#密码加密: Encrypt 123456 result equals:/izxz+0groa=
PWDs = [email protected]:/izxz+0groa=
5. Start/Stop/restart Atlas:
[[email protected] ~]#/usr/local/mysql-proxy/bin/mysql-proxyd test start
[[email protected] ~]#/usr/local/mysql-proxy/bin/mysql-proxyd test stop
[Email protected] ~]#/usr/local/mysql-proxy/bin/mysql-proxyd test restart
6. Log in to the Atlas Admin interface:
[Email protected] ~]# mysql-u atlas-patlas-h127.0.0.1-p2345
Mysql> SELECT * from Help; ---See all available commands to help
Mysql> SELECT * from Backends; --View back-end information
+-------------+----------------------+------+-------+---------+
| Backend_ndx | Address | State | Type |
+-------------+----------------------+------+-------+---------+
| 1 | 192.168.168.128:3306 | Up | RW |
| 2 | 192.168.168.129:3306 | Up | Ro |
+-------------+----------------------+----+---------+---------+
2 rows in Set (0.00 sec)
Verify:
7. Log in to Atlas to operate MySQL:
[Email protected] ~]# mysql-u root-p123456-h127.0.0.1-p1234
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| MySQL |
| Test |
+--------------------+
5 rows in Set (0.00 sec)
Mysql>create database TOP; --Create a new database top to successfully
Query OK, 1 row Affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| TOP |
| MySQL |
| Test |
+--------------------+
4 rows in Set (0.01 sec)
8. Log in to master to see if there is a TOP database
[[email protected] ~]# MySQL
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| TOP |
| MySQL |
| Test |
+--------------------+
4 rows in Set (0.00 sec)
9. Login SLAVE to see if there is a TOP database
[[email protected] ~]# MySQL
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| TOP |
| MySQL |
| Test |
+--------------------+
4 rows in Set (0.00 sec)
10, you can see that when you create a new top database in Atlas, it is successfully written to master, and slave successfully copied from master.
Note: 1. User name and encryption password This section is used to log in to MySQL for operation.
2. Management interface users are used to manage Atlas.
3. When Atlas is not started, the Atlas service cannot be started with restart and will be error-free.
Installation configuration of the CentOS 6.5 Atlas middleware