文檔地址:https://github.com/mariadb-corporation/MaxScale/blob/2.1/Documentation/Documentation-Contents.md
1伦意,maxscale安裝
下載地址:https://downloads.mariadb.com/MaxScale/2.1.3/centos/7/x86_64/
wget https://downloads.mariadb.com/MaxScale/2.1.3/centos/7/x86_64/maxscale-2.1.3-1.centos.7.x86_64.rpm
yum list installed | grep maxscale 查看是否安裝過(guò)maxscale yum remove -y maxscale.x86_64 卸載之前的版本 yum install -y maxscale-2.1.3-1.centos.7.x86_64.rpm 安裝rpm包
2厨诸,配置文件路徑
vim /etc/maxscale.cnf
配置文件
/var/log/maxscale/maxscale.log日志文件
maxscale --config=/etc/maxscale.cnf---->maxadmin
/usr/share/maxscale/maxscale start / stop/ restart/ reload啟動(dòng)腳本 centos6 /etc/init.d/maxscale
3飒赃,mysql增加用戶(hù)
添加maxscale監(jiān)控以及獲取user表信息的用戶(hù)
create user 'maxscale'@'%' identified by 'maxscale';
grant select on mysql.user to 'maxscale'@'%';
grant select on mysql.db to 'maxscale'@'%';
grant select on mysql.tables_priv to 'maxscale'@'%';
grant show databases on . to 'maxscale'@'%';
grant replication client on . to 'maxscale'@'%';
(
重點(diǎn)
)添加連接maxscale代理的客戶(hù)端用戶(hù)锭环。(機(jī)器多個(gè)ip聪全,都要進(jìn)行添加, 包括內(nèi)網(wǎng)ip)
client用戶(hù)辅辩,并增加代理訪問(wèn)db的權(quán)限难礼。
grant all privileges on . to 'scaleclient'@'192.168.0.62' identified by 'scaleclient';
grant all privileges on . to 'scaleclient'@'192.168.0.63' identified by 'scaleclient';
登錄代理若連不上代理娃圆,查看log或者是mysql用戶(hù)權(quán)限配置不正確
4,maxadmin登錄蛾茉。
5, maxscale
Create the encrypted password using maxkeys and maxpasswd if you want to encrypt the password for the user that access the database servers: