当前位置: 首页> 科技> 名企 > 上海新闻网手机版_武汉网站seo技术_帮别人发广告赚钱平台_seo关键词排名点击工具

上海新闻网手机版_武汉网站seo技术_帮别人发广告赚钱平台_seo关键词排名点击工具

时间:2025/7/11 9:46:20来源:https://blog.csdn.net/obboda/article/details/145907431 浏览次数:0次
上海新闻网手机版_武汉网站seo技术_帮别人发广告赚钱平台_seo关键词排名点击工具

一、环境准备

主机名IP地址备注
openEuler-1192.168.121.11mysql-server-1
openEuler-2192.168.121.12mysql-server-2
openEuler-3192.168.121.13client
Rocky-1192.168.121.51haproxy

二、mysql-server配置

[root@openEuler-1 ~]# yum install -y mariadb-server
[root@openEuler-1 ~]# vim /etc/my.cnf
[mysqld]
server-id=11     # 另一台主机为12# 授权用户(mariadb授权自动创建用户)
[root@openEuler-1 ~]# systemctl enable --now mariadb
[root@openEuler-1 ~]# mysql -e "grant all on *.* to test@'192.168.121.%' identified by '123456'"

三、haproxy配置

[root@Rocky-1 ~]# vim /etc/haproxy/conf.d/mysql.cfg
listen mysql_portbind 192.168.121.51:3306mode tcpbalance leastconnserver mysql1 192.168.121.11:3306 checkserver mysql2 192.168.121.12:3306 check# 或者使用frontend和backend实现
frontend mysqlbind :3306mode tcp                            #必须指定tcp模式default_backend mysqlsrvs
backend mysqlsrvsmode tcp                            #必须指定tcp模式balance leastconnserver mysql1 192.168.121.11:3306server mysql2 192.168.121.11:3306# 检查配置文件
[root@Rocky-1 ~]# haproxy -c -f /etc/haproxy/conf.d/mysql.cfg
[root@Rocky-1 ~]# systemctl restart haproxy.service

四、client测试

[root@openEuler-3 ~]# mysql -utest -p123456 -h192.168.121.51 -e "select @@server_id"
+-------------+
| @@server_id |
+-------------+
|          11 |
+-------------+
[root@openEuler-3 ~]# mysql -utest -p123456 -h192.168.121.51 -e "select @@server_id"
+-------------+
| @@server_id |
+-------------+
|          12 |
+-------------+

 

关键字:上海新闻网手机版_武汉网站seo技术_帮别人发广告赚钱平台_seo关键词排名点击工具

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: