代码之家  ›  专栏  ›  技术社区  ›  aircraft

memcached。服务处于活动状态,但在haproxy网页中,它们处于关闭状态

  •  0
  • aircraft  · 技术社区  · 8 年前

    memcached.service 处于活动状态(正在运行):

    [root@ha-node3 my.cnf.d]# systemctl status   memcached.service
    ● memcached.service - memcached daemon
       Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; vendor preset: disabled)
       Active: active (running) since Wed 2017-08-02 01:01:29 CST; 6min ago
     Main PID: 13329 (memcached)
       CGroup: /system.slice/memcached.service
               └─13329 /usr/bin/memcached -p 11211 -u memcached -m 1024 -c 8192 -l 127.0.0.1,::1,10.10.0.101 -t 4 -I 10m
    
    Aug 02 01:01:29 ha-node3 systemd[1]: Started memcached daemon.
    Aug 02 01:01:29 ha-node3 systemd[1]: Starting memcached daemon...
    

    enter image description here


    编辑-1

    Memcache_Servers 中的配置 /etc/haproxy/haproxy.cfg 22122 11211 ,然后重新启动haproxy,但仍不工作。

    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
    
    1 回复  |  直到 8 年前
        1
  •  0
  •   aircraft    8 年前

    最后,我发现我的主机中的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不是主机ip,所以我在主机中改为ip,您可以看到下面的快照:

    enter image description here

    enter image description here