设为首页 收藏本站
查看: 1159|回复: 0

[经验分享] haproxy(3)Upgrade haproxy to 1.4.25 and Proxy RabbitMQ Cluster

[复制链接]

尚未签到

发表于 2017-4-18 08:52:10 | 显示全部楼层 |阅读模式
  haproxy(3)Upgrade haproxy to 1.4.25 and Proxy RabbitMQ Cluster

1. Install the latest Version
Prepare the latest Package
>wget http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.25.tar.gz
Unzip the file and Move to the working directory.
>make TARGET=generic ARCH=x86_64 USE_PCRE=1
>make install DESTDIR='/Users/carl/tool/haproxy-1.4.25' PREFIX=''

>sudo ln -s /Users/carl/tool/haproxy-1.4.25 /opt/haproxy-1.4.25
>sudo ls -s /opt/haproxy-1.4.25 /opt/haproxy

Add that sbin path to my system.
export PATH=/opt/haproxy/sbin:$PATH

Installation is success.
>haproxy -v
HA-Proxy version 1.4.25 2014/03/27 Copyright 2000-2014 Willy Tarreau <w@1wt.eu>

2. Configuration
http://cbonte.github.io/haproxy-dconv/configuration-1.5.html

The sample configuration is as follow:
#this config needs haproxy-1.4.25
  #logging options
  global        
  log 127.0.0.1 local0 info        
  maxconn 5120        
  chroot /opt/haproxy        
  uid 99        
  gid 99        
  daemon         quiet        
  nbproc  2        
  pidfile /opt/haproxy/haproxy.pid
  #load balancing
  defaults defaults       
  log        global        #使用4层代理模式,"mode   http"为7层代理模式       
  mode       tcp       
  #if you set mode to tcp,then you nust change tcplog into http
  log        option    
  tcplog        option    
  dontlognull       
  retries    3       
  option redispatch       
  maxconn 2000       
  contimeout      5s       
  clitimeout      120s       
  srvtimeout      120s
  #front-end IP for consumers and producters
  listen rabbitmq_local_cluster 127.0.0.1:5670       
  #配置TCP模式       
  mode      tcp       
  #balance url_param userid       
  #balance url_param session_id check_post 64       
  #balance hdr(User-Agent)       
  #balance hdr(host)       
  #balance hdr(Host) use_domain_only       
  #balance rdp-cookie       
  #balance leastconn       
  #balance source  //ip        #简单的轮询       
  balance roundrobin       
  #rabbitmq集群节点配置       
  server rabbit1  127.0.0.1:5672 check inter 5000 rise 2 fall 2       
  server rabbit2 127.0.0.1:5673 check inter 5000 rise 2 fall 2
  #配置haproxy web监控,查看统计信息
  listen private_monitoring :8100       
  mode    http       
  option  httplog       
  stats   enable       
  #设置haproxy监控地址为http://localhost:8100/rabbitmq-stats       
  stats   uri  /rabbitmq-stats       
  stats   refresh 5s

I  can check the status page here.
http://localhost:8100/rabbitmq-stats

And when we plan to use rabbitmq, we will connect to this port number 5670.

References:
http://sillycat.iteye.com/blog/562645  installation and loadbalance
http://sillycat.iteye.com/blog/562646  session stick
http://sillycat.iteye.com/blog/1055846

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-365708-1-1.html 上篇帖子: 负载均衡工具haproxy安装配置使用 下篇帖子: HAProxy 学习笔记1-- 配置日志
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表