• haporxy 负载elasticsearch


    <pre name="code" class="html">-bash-4.1# cat /etc/haproxy/haproxy.cfg
    global
    	log 127.0.0.1	local3 
    	maxconn 65535 
    	chroot /usr/local/haproxy
    	uid 401
    	gid 401 
    	daemon
    
    defaults
    	log	global
    	mode	http
    	option	httplog
    	option	dontlognull
    	retries	3
    	option  redispatch
    	option  abortonclose 
    	maxconn 65535	
    	timeout connect 5000
    	timeout client  50000
    	timeout server 50000
    
    	timeout check   5s
    	stats   refresh 30s
    	stats   uri     /stats	
    	stats   realm   baison-test-Haproxy     
      	stats   auth    admin:admin
      	stats   hide-version 
           
    	
    frontend  	www
     bind    	*:9200
    
     default_backend eshttp_server
    backend eshttp_server
            mode    	http
    	balance		roundrobin
    backend eshttp_server
            mode    	http
    	balance		roundrobin
    	server ela01 192.168.32.80:9200 check inter 2000 fall 3
    	server ela02 192.168.32.81:9200 check inter 2000 fall 3
    	server ela03 192.168.32.82:9200 check inter 2000 fall 3
    #服务器定义,cookie 1表示serverid为1,check inter 1500 是检测心跳频率
    
    
    #rise 3是3次正确认为服务器可用,fall 3是3次失败认为服务器不可用,weight代表权重
    
    
    server mms1 10.1.5.134:80 cookie 1 check inter 1500 rise 3 fall 3 weight 1
    
    
    server mms2 10.1.6.118:80 cookie 2 check inter 1500 rise 3 fall 3 weight 2
    
    
    
    
    
    


    
                                        
    
  • 相关阅读:
    js 为表格增加行 动态
    百度测试新搜索结果页面 改进灵感来自谷歌?
    多线程程序中使用fork的问题
    C++ struct和class的区别
    J2SE 5 HotSpot JVM 解释
    并行优化、xvout
    C++基础:纯虚函数和抽象类
    C++的四种cast
    logcat过滤输出
    C++虚函数和纯虚函数(2)
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350267.html
Copyright © 2020-2023  润新知