linux集群之Haproxy
Haproxy集群是基于应用层,可以根据客户端的访问来识别不同的发服务,LVS集群是基于传输层,需要在LVS服务器上指定好相应的端口,才能访问 举例说明:如有有两组服务器,一组服务器提供视频,另外一组服服务器提供音频,在这样的情况下,要能够同时实现对这两组服务器的负载均衡,则LVS集群实现不了,要用Haproxy才能实现 Haproxy 就是基于应用层的负载均衡集群 搭建环境: 将html服务器和php服务器当成是提供两种不同服务的服务器集群 ip地址分配: html服务器1:192.168.1.11 yum -y install mariadb-server php php-mysql mariadb cd /var/www/html touch index.html test.html test.php html服务器2:192.168.1.12 yum -y install mariadb-server php php-mysql mariadb cd /var/www/html touch index.html test.html test.php php服务器1:192.168.1.14 yum -y install mariadb-server php php-mysql mariadb cd /var/www/html touch index.html test