3如果的集群请每一台重复安装,本文介绍在第一台按章
1:下载包文件,Install, 一定在安装好mysql 安装mysqlrouter,本文安装用户是在mysql上建立了一个账号 mysql@172.31.26.31:9002 密码是:test01
cd/data
wget https://product.greatdb.com/GreatSQL-8.0.32-24/greatsql-mysql-router-8.0.32-24.1.el7.x86_64.rpm;
yum -y install greatsql-mysql-router-8.0.32-24.1.el7.x86_64.rpm;
history | grep mysqlrouter
2:安装mysqlrouter 本机器IP 172.31.26.31:9002
systemctl status mysqlrouter;systemctl restart mysqlrouter;
mysqlrouter --bootstrap mysql@172.31.26.31:9002 --user=mysqlrouter --directory=/data/mysqlrouter/ --conf-set-option=routing:bootstrap_ro.max_connections=2000 --conf-set-option=routing:bootstra_rw.max_connections=2000 --conf-set-option=routing:bootstrap_ro.routing_strategy=round-robin
3:编辑文件 /data/mysqlrouter/mysqlrouter.conf
vim /data/mysqlrouter/mysqlrouter.conf
添加一行
max_total_connections=5200
4:添加执行文件目录地址
ExecStart=/usr/bin/mysqlrouter -c /data/mysqlrouter/mysqlrouter.conf
5:重新启动mysqlrouter
systemctl stop mysqlrouter.service
systemctl daemon-reload
systemctl restart mysqlrouter.service
systemctl status mysqlrouter.service
==================the configuration information====================
{
"replicaSetName": "test88",
"routers" {
"zy-nph-skg-fat-dba-dbworker04::":{
"hostname": "zy-nph-skg-fat-dba-dbworker04",
"lastCheckIn": null,
"roPort": "6447",
"roXPort": "6449",
"rwPort": "6446",
"rwXPort": "6448"
"version": "8.0.32"
},
"zy-nph-skg-fat-dba-dbworker04::system":{
"hostname": "zy-nph-skg-fat-dba-dbworker04",
"lastCheckIn": null,
"roPort": "6447",
"roXPort": "6449",
"rwPort": "6446",
"rwXPort": "6448"
"version": "8.0.32"
}
}