https://github.com/flike/kingshard/blob/master/doc/KingDoc/admin_command_introduce.md
mysql -h 127.0.0.1 -P9696 -uroot -proot
mysql> admin server(opt,k,v) values('show','proxy','config');
+--------------+------------------+
| Key | Value |
+--------------+------------------+
| Addr | 0.0.0.0:9696 |
| User_List | root,kingshard |
| LogPath | /Users/flike/log |
| LogLevel | debug |
| LogSql | on |
| SlowLogTime | 1 |
| Nodes_Count | 1 |
| Nodes_List | node1 |
| ClientConns | 1 |
| ClientQPS | 0 |
| ErrLogTotal | 0 |
| SlowLogTotal | 0 |
+--------------+------------------+
12 rows in set (0.00 sec)
#查看node装填
mysql> admin server(opt,k,v) values('show','node','config');
+-------+---------------------+--------+-------+-------------------------------+---------+----------+------------+---------------+--------------+
| Node | Address | Type | State | LastPing | MaxConn | IdleConn | CacheConns | PushConnCount | PopConnCount |
+-------+---------------------+--------+-------+-------------------------------+---------+----------+------------+---------------+--------------+
| node1 | 192.168.10.73:3306 | master | up | 2019-07-15 17:30:21 +0800 CST | 32 | 24 | 8 | 32 | 0 |
| node1 | 192.168.10.254:3306 | slave | up | 2019-07-15 17:30:21 +0800 CST | 32 | 24 | 8 | 33 | 1 |
| node1 | 192.168.10.249:3306 | slave | up | 2019-07-15 17:30:21 +0800 CST | 32 | 24 | 8 | 32 | 0 |
+-------+---------------------+--------+-------+-------------------------------+---------+----------+------------+---------------+--------------+
3 rows in set (0.00 sec)
admin server(opt,k,v) values('show','schema','config');
#添加一个新的slave到node1
admin node(opt,node,k,v) values('add','node1','slave','127.0.0.1:3306')
#删除node1上的一个slave。注意:只能删除slave,不能删除master
admin node(opt,node,k,v) values('del','node1','slave','127.0.0.1:3306')
#将一个slave设置为下线状态
admin node(opt,node,k,v) values('down','node1','slave','127.0.0.1:3306')
#将一个slave设置为上线状态
admin node(opt,node,k,v) values('up','node1','slave','127.0.0.1:3306')
#将master设置为下线状态
admin node(opt,node,k,v) values('down','node1','master','127.0.0.1:3306')
#将master设置为上线状态
admin node(opt,node,k,v) values('up','node1','master','127.0.0.1:3306')
curl -X GET \
-H 'Content-Type: application/json' \
-u admin:admin \
127.0.0.1:9797/api/v1/nodes/status