暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
Maxscale2.4(已包含MHA+ProxySQL功能)+Keepalived高可用架构部署
2354
7页
9次
2020-11-26
5墨值下载
安装Maxscale
下载自动安装配置软件安装源
官方的脚本会配置下面三个安装源,配置完即可安装Maxscale
MariaDB安装源
MariaDBMaxscale安装源
MariaDBTools安装源
运行脚本命令
curl‐sShttps://downloads.mariadb.com/MariaDB/mariadb_repo_setup|sudobash
如果需要下载脚本
curl‐Ohttps://downloads.mariadb.com/MariaDB/mariadb_repo_setup
安装Maxscale组件
yum‐yinstallmaxscale
配置Maxscale
在数据库中配置Maxscale用户的权限
#mysql‐uroot
>CREATEUSER'maxscale'@'%'IDENTIFIEDBY'maxscale';
>GRANTSELECTONmysql.*TO'maxscale'@'%';
>GRANTSHOWDATABASESON*.*TO'maxscale'@'%';
>GRANTSUPER,RELOADON*.*TO'maxscale'@'%';
如果使用的数据库用户在maxscale服务器上没有权限,那么需要是需要额外添加用户权限到指定IP上
修改Maxscale策略
修改Maxscale策略
maxscale配置项在文件 /etc/maxscale.cnf 中,下面是一个标准的读写分离策略
[maxscale]
# auto
threads=auto
#
[server1]
type=server
#IP
address=10.90.1.107
#
port=3306
#
protocol=MariaDBBackend
[server2]
type=server
address=10.90.1.133
port=3306
protocol=MariaDBBackend
#
[MariaDB‐Monitor]
type=monitor
# mysql mariadb
module=mariadbmon
#
servers=server1,server2
user=maxscale
password=maxscale
monitor_interval=2000
#
auto_failover=true
#
auto_rejoin=true
#[Read‐Only‐Service]
#type=service
#router=readconnroute
#servers=server1
#user=myuser
#password=mypwd
#router_options=slave
#
[Read‐Write‐Service]
type=service
#
router=readwritesplit
#
servers=server1,server2
#
#
user=maxscale
password=maxscale
#
master_accept_reads=true
# SQL
master_reconnection=true
master_failure_mode=error_on_write
delayed_retry=true
transaction_replay=true
#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=MariaDBClient
#port=4008
#
[Read‐Write‐Listener]
type=listener
service=Read‐Write‐Service
protocol=MariaDBClient
port=3306
# Maxadmin Keepalived maxscale
[MaxAdmin]
type=service
router=cli
[MaxAdmin‐Unix‐Listener]
type=listener
service=MaxAdmin
protocol=maxscaled
socket=default
[MaxAdmin‐Inet‐Listener]
type=listener
service=MaxAdmin
protocol=maxscaled
address=localhost
port=6603
安装Keepalived
直接命令安装即可
of 7
5墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。