You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
863 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#docker部署
docker run -d --name maxscale -p 8989:8989 -p 4016:4016 mariadb/maxscale:latest
#部署完成后进入到容器内
docker exec -it 容器id bash
#配置文件
vi /etc/maxscale.cnf
[maxscale]
threads=auto
admin_secure_gui=false
admin_host=0.0.0.0
[server1]
type=server
address=10.10.14.63
port=22066
protocol=MariaDBBackend
[server2]
type=server
address=10.10.14.64
port=22066
protocol=MariaDBBackend
[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=server1,server2
user=root
password=DsideaL147258369
monitor_interval=2s
[Read-Write-Service]
type=service
router=readwritesplit
servers=server1,server2
user=root
password=DsideaL147258369
enable_root_user=true # 默认禁止root用户访问设置为true开启
[Read-Write-Listener]
type=listener
service=Read-Write-Service
protocol=MariaDBClient
port=4016