操作环境
Linux 7.3
server1(172.25.3.1) Haproxy
server2(172.25.3.2) httpd 后端
server3(172.25.3.3) httpd 后端
server1安装haproxy
yum install haproxy -y
修改haproxy的配置文件
vim /etc/haproxy/haproxy.cfg
在server2和server3
安装httpd,并编写默认发布目录文件方便查看轮询效果
yum install -y httpd
vim /var/www/html/index.html
我是server2 | server3
systemctl start httpd
开启server1的haproxy的服务
systemctl start haproxy
物理机测试
curl server1