Maxscale 配置和管理
配置文件: /etc/maxscale.cnf
:
# MaxScale documentation on GitHub: # https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Documentation-Contents.md # Global parameters # # Complete list of configuration options: # https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Getting-Started/Configuration-Guide.md [maxscale] threads=1 # Server definitions # # Set the address of the server to the network # address of a MySQL server. # [server1] type=server address=127.0.0.1 port=3306 protocol=MySQLBackend # Monitor for the servers # # This will keep MaxScale aware of the state of the servers. # MySQL Monitor documentation: # https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Monitors/MySQL-Monitor.md [MySQL Monitor] type=monitor module=mysqlmon servers=server1 user=root passwd=tangweinan monitor_interval=10000 # Service definitions # # Service Definition for a read-only service and # a read/write splitting service. # # ReadConnRoute documentation: # https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Routers/ReadConnRoute.md [Read-Only Service] type=service router=readconnroute servers=server1 user=root passwd=tangweinan router_options=slave # ReadWriteSplit documentation: # https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Routers/ReadWriteSplit.md [Read-Write Service] type=service router=readwritesplit servers=server1 user=root passwd=tangweinan max_slave_connections=100% # This service enables the use of the MaxAdmin interface # MaxScale administration guide: # https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Reference/MaxAdmin.md [MaxAdmin Service] type=service router=cli # Listener definitions for the services # # These listeners represent the ports the # services will listen on. # [Read-Only Listener] type=listener service=Read-Only Service protocol=MySQLClient port=4008 [Read-Write Listener] type=listener service=Read-Write Service protocol=MySQLClient port=4006 [MaxAdmin Listener] type=listener service=MaxAdmin Service protocol=maxscaled socket=default
MaxScale 管理:
进入 shell 环境:
> maxadmin
获取列表:
> list services
Services.
--------------------------+-------------------+--------+----------------+-------------------
Service Name | Router Module | #Users | Total Sessions | Backend databases
--------------------------+-------------------+--------+----------------+-------------------
Read-Only Service | readconnroute | 1 | 1 | server1
Read-Write Service | readwritesplit | 1 | 1 | server1
MaxAdmin Service | cli | 2 | 4 |
--------------------------+-------------------+--------+----------------+-------------------
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论