云原生-Harproxy的四层负载

1.环境设定

#部署mariadb数据库

root@webserver1+2 \~\]# dnf install mariadb-server mariadb -y ![](https://i-blog.csdnimg.cn/direct/66c7605a7b254a238f7a13c00174d12e.png) \[root@webserver1+2 \~\]# vim /etc/my.cnf.d/mariadb-server.cnf ![](https://i-blog.csdnimg.cn/direct/dd2d88bda9c443daa63396b23b25b08f.png) \[root@webserver1+2 \~\]#systemctl start mariadb #建立远程登录用户并授权 \[root@webserver2+1 \~\]# mysql ![](https://i-blog.csdnimg.cn/direct/650284b38c2c4304a2705b0c9b967232.png) web1 ![](https://i-blog.csdnimg.cn/direct/4d1554a0f10d47f69a31ed1c317662ec.png) web2 ![](https://i-blog.csdnimg.cn/direct/bc88417338534ca7a35f83e6374cf45b.png) 2.四层负载操作 \[root@haproxy \~\]# vim /etc/haproxy/haproxy.cfg ![](https://i-blog.csdnimg.cn/direct/06a932bde6c545c6b2deb6b4e6f64e2a.png) \[root@haproxy \~\]#systemctl restart haproxy.service #测试:![](https://i-blog.csdnimg.cn/direct/06a2081dc3eb4e409ec1721ca360e5c1.png) ![](https://i-blog.csdnimg.cn/direct/fff5b3ff0cfe4cffaaba9df2d6abee62.png) ### backup参数 \[root@haproxy \~\]# vim /etc/haproxy/haproxy.cfg ![](https://i-blog.csdnimg.cn/direct/af46b834a914471f8cc5041adb6336ac.png) \[root@haproxy \~\]#systemctl restart haproxy.service #测试 ![](https://i-blog.csdnimg.cn/direct/e564989e2ee94299aa534bce0196c530.png) ![](https://i-blog.csdnimg.cn/direct/8ef83082b9064cbc92acefdd0223ce49.png) #关闭10的mariadb并等待1分钟 \[root@webserver1 \~\]# systemctl stop mariadb ![](https://i-blog.csdnimg.cn/direct/5c9c4743fe3a4fc9ba10e25d124744c8.png) #还原故障主机等待片刻 \[root@webserver1 \~\]# systemctl start mariadb ![](https://i-blog.csdnimg.cn/direct/8151922fbd2c4acc9e7c7b25f45dca72.png)

相关推荐
掘根14 小时前
【微服务即时通讯项目】系统联调
微服务·云原生·架构
http阿拉丁神猫19 小时前
kubernetes知识点汇总31-36
云原生·容器·kubernetes
ai_coder_ai1 天前
如何在自动化脚本中使用云原生功能(FaaS和BaaS)?
云原生·autojs·自动化脚本·冰狐智能辅助·easyclick
fengyehongWorld1 天前
kubernetes Argo简介
云原生·容器·kubernetes
键盘鼓手苏苏1 天前
Kubernetes与GitOps最佳实践
云原生·kubernetes·k8
AI精钢2 天前
谷歌时隔一年发布“更加开源“的 Gemma 4,意图何为?
人工智能·云原生·开源·aigc
小陈工2 天前
Python Web开发入门(十):数据库迁移与版本管理——让数据库变更可控可回滚
前端·数据库·人工智能·python·sql·云原生·架构
威联通安全存储2 天前
云原生数据湖:QuObjects 本地 S3 对象存储解析
python·云原生
wei_shuo2 天前
从边缘到云端:国产时序数据库IoTDB与TimechoDB的云原生落地全攻略
云原生·时序数据库·iotdb
A-刘晨阳2 天前
K8s之StatefulSet控制器
运维·云原生·容器·kubernetes·statefulset