2016年8月

安装过程

Github-Qihoo360/Atlas 上下载Atlas-2.2-debian6.0-x86_64.deb

wget https://github.com/Qihoo360/Atlas/releases/download/2.2/Atlas-2.2-debian6.0-x86_64.deb

执行安装

dpkg -i Atlas-2.2-debian6.0-x86_64.deb

修改配置文件

待编辑

配置详情参考Github-Atlas的安装

启动服务遇错误

2016-08-18 14:13:01: (critical) loading module '/usr/local/mysql-proxy/lib/mysql-proxy/plugins/libproxy.so' failed: libmysqlclient.so.16: cannot open shared object file: No such file or directory
2016-08-18 14:13:01: (critical) setting --plugin-dir=<dir> might help
2016-08-18 14:13:01: (message) Initiating shutdown, requested from mysql-proxy-cli.c:432
2016-08-18 14:13:01: (message) shutting down normally, exit code is: 1

查找问题过程

apt-file search libmysqlclient

发现系统目录/usr/lib/x86_64-linux-gnu/下有/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20

ln建连接

ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.16

失败报错如下

2016-08-18 16:39:29: (critical) loading module '/usr/local/mysql-proxy/lib/mysql-proxy/plugins/libproxy.so' failed: /usr/lib/x86_64-linux-gnu/libmysqlclient.so.16: version `libmysqlclient_16' not found (required by /usr/local/mysql-proxy/lib/mysql-proxy/plugins/libproxy.so)
2016-08-18 16:39:29: (critical) setting --plugin-dir=<dir> might help
2016-08-18 16:39:29: (message) Initiating shutdown, requested from mysql-proxy-cli.c:432
2016-08-18 16:39:29: (message) shutting down normally, exit code is: 1

删除连接 从csdn下载libmysqlclient.so.16文件
报错

2016-08-18 16:48:12: (critical) loading module '/usr/local/mysql-proxy/lib/mysql-proxy/plugins/libproxy.so' failed: libmysqlclient.so.16: wrong ELF class: ELFCLASS32
2016-08-18 16:48:12: (critical) setting --plugin-dir=<dir> might help
2016-08-18 16:48:12: (message) Initiating shutdown, requested from mysql-proxy-cli.c:432
2016-08-18 16:48:12: (message) shutting down normally, exit code is: 1

从CSDN从新下载了libmysqlclient.so.16(64bit)

服务启动成功。

root@ebs-39470:/usr/local/mysql-proxy/log# /usr/local/mysql-proxy/bin/mysql-proxyd test status
MySQL-Proxy of test is running (6127)
root@ebs-39470:/#mysql -h127.0.0.1 -P2345 -uuser -ppwd

mysql> select * from help;

+----------------------------+---------------------------------------------------------+
| command                    | description                                             |
+----------------------------+---------------------------------------------------------+
| SELECT * FROM help         | shows this help                                         |
| SELECT * FROM backends     | lists the backends and their state                      |
| SET OFFLINE $backend_id    | offline backend server, $backend_id is backend_ndx's id |
| SET ONLINE $backend_id     | online backend server, ...                              |
| ADD MASTER $backend        | example: "add master 127.0.0.1:3306", ...               |
| ADD SLAVE $backend         | example: "add slave 127.0.0.1:3306", ...                |
| REMOVE BACKEND $backend_id | example: "remove backend 1", ...                        |
| ADD CLIENT $client         | example: "add client 192.168.1.2", ...                  |
| REMOVE CLIENT $client      | example: "remove client 192.168.1.2", ...               |
| SAVE CONFIG                | save the backends to config file                        |
+----------------------------+---------------------------------------------------------+
10 rows in set (0.00 sec)

完结撒花~