代理 Memcache_Servers 没有可用的服务器

proxy Memcache_Servers has no server available

代理 Memcache_Servers 没有可用的服务器,当我启动 haproxy.service:

[root@ha-node1 log]# systemctl restart haproxy.service
 Message from syslogd@localhost at Aug  2 10:49:23 ...
 haproxy[81665]: proxy Memcache_Servers has no server available!

我的配置haproxy.cfg

listen Memcache_Servers
  bind 45.117.40.168:11211
  balance roundrobin
  mode   tcp
  option  tcpka
  server ha-node1 ha-node1:11211 check inter 10s fastinter 2s downinter 2s rise 30 fall 3
  server ha-node2 ha-node2:11211 check inter 10s fastinter 2s downinter 2s rise 30 fall 3
  server ha-node3 ha-node3:11211 check inter 10s fastinter 2s downinter 2s rise 30 fall 3

最后,我发现我的hosts中的ip是这样的:

[root@ha-node1 sysconfig]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.8.101 ha-node1 ha-node1.aa.com
192.168.8.102 ha-node2 ha-node2.aa.com
192.168.8.103 ha-node3 ha-node3.aa.com
45.117.40.168 ha-vhost devops.aa.com
192.168.8.104 nfs-backend backend.aa.com

但是我的/etc/sysconfig/memcached里面的ip不是之前hosts的ip,所以改成了hosts里面的ip:

现在我重启了memcached和haproxy,现在可以正常使用了。