nginx+keepalived配置高可用的负载均衡
------------------------
在keepalived中配置nginx监视脚本。
if [ "$(ps -ef | grep "nginx: master process"| grep -v grep )" == "" ]
then
killall keepalived
---------------------------------------------
keepalived (slave) -> nginx ->(loadbance) ->{ apache.tomcat.server1,apache.tomcat.server2}
keepalived (master)- >nginx ->(loadbance) -> { apache.tomcat.server1,apache.tomcat.server2}
keepalived(master)一旦宕机或者不可用,跳转到slave,slave的nginx继续作为loadblance服务。
参考:
http://www.jbxue.com/article/2916.html