• 为什么写博客,是因为遇到的坑,不希望别人在踩一遍!
  • 选择了,剩下的就是坚持和努力-------致自己!
  • 当能力达不到梦想时,更需要学习,努力,拼搏

报错 Starting proxy rabbitmq: cannot bind socket

故障汇总 雪豹 6年前 (2018-03-06) 824次浏览 0个评论

今天在安装haproxy 过程中报错报错 Starting proxy rabbitmq: cannot bind socket

#下载haproxy rpm包网址
http://www.rpmfind.net/linux/rpm2html/search.php?query=haproxy
# 因为我的是Centos 7 
[root@kl tools]# wget http://www.rpmfind.net/linux/centos/7.4.1708/os/x86_64/Packages/haproxy-1.5.18-6.el7.x86_64.rpm
# rpm -ivh 安装
[root@kl tools]# rpm -ivh haproxy-1.5.18-6.el7.x86_64.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:haproxy-1.5.18-6.el7             ################################# [100%]

启动查看没有端口

[root@kl haproxy]# systemctl start haproxy
[root@kl haproxy]# netstat -lntulp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1155/sshd           
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1517/master         
tcp6       0      0 :::22                   :::*                    LISTEN      1155/sshd           
tcp6       0      0 ::1:25    

查看报错

# 在这个查看报错
[root@kl6 ~]# vim /var/log/messages  

Mar 6 23:01:29 localhost haproxy-systemd-wrapper: [WARNING] 064/230129 (2396) : config : log format ignored for proxy 'private_monitoring' since it has no log address.
Mar 6 23:01:29 localhost haproxy-systemd-wrapper: [ALERT] 064/230129 (2396) : Starting proxy rabbitmq: cannot bind socket [172.16.1.10:5672]

# 设置

# 开启允许绑定非本机的IP
[root@kl6 ~]# vi /etc/sysctl.conf
net.ipv4.ip_nonlocal_bind=1
# 生效
[root@kl6 ~]# sysctl -p
net.ipv4.ip_nonlocal_bind = 1

再次启动

[root@kl6 ~]# systemctl start haproxy
[root@kl6 ~]# netstat -lntup
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1142/sshd           
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1489/master         
tcp        0      0 0.0.0.0:8100            0.0.0.0:*               LISTEN      2426/haproxy        
tcp        0      0 172.16.1.110:5672       0.0.0.0:*               LISTEN      2426/haproxy        
tcp6       0      0 :::22                   :::*                    LISTEN      1142/sshd           
tcp6       0      0 ::1:25                  :::*                    LISTEN      1489/master  

有需要可以联系微信xuebao19930721和加入微信群
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址