|
[root@Atlas ~]# mysql -uuser -ppwd -h192.168.100.152 -P2345
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", ... |
| ADD GMASTER $group_id $backend | example: "add gmaster 1 127.0.0.1:3306", ... |
| ADD GSLAVE $group_id $backend | example: "add gslave 1 127.0.0.1:3306", ... |
| REMOVE BACKEND $backend_id | example: "remove backend 1", ... |
| REMOVE GBACKEND $group_id $backend_id | example: "remove gbackend 1 1", ... |
| SELECT * FROM clients | lists the clients |
| ADD CLIENT $client | example: "add client 192.168.1.2", ... |
| REMOVE CLIENT $client | example: "remove client 192.168.1.2", ... |
| SELECT * FROM pwds | lists the pwds |
| ADD PWD $pwd | example: "add pwd user:raw_password", ... |
| ADD ENPWD $pwd | example: "add enpwd user:encrypted_password", ... |
| REMOVE PWD $pwd | example: "remove pwd user", ... |
| SAVE CONFIG | save the backends to config file |
| SELECT VERSION | display the version of Atlas |
+---------------------------------------+---------------------------------------------------------+
19 rows in set (0.00 sec)
mysql> select * from backends; ##查看后端mysql状态,工作类型
+----------+----------------------+-------+------+-------------+
| group_id | address | state | type | backend_ndx |
+----------+----------------------+-------+------+-------------+
| -1 | 192.168.100.150:3306 | up | rw | 1 |
| -1 | 192.168.100.151:3306 | up | ro | 2 |
+----------+----------------------+-------+------+-------------+
2 rows in set (0.00 sec)
|
|
|