V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
fsckzy
V2EX  ›  Redis

Redis-cluster 进程和网络连接不一致问题

  •  
  •   fsckzy · 2018-05-23 09:38:53 +08:00 · 2940 次点击
    这是一个创建于 2137 天前的主题,其中的信息可能已经有所发展或是发生改变。

    创建了 redis 集群,7003、7004、7005 三个节点。 查看网络连接为什么会出现 6 个节点?

    [root@iZ1mlxtcx2Z ~]# netstat -tpln |grep redis
    tcp        0      0 192.168.201.127:17003       0.0.0.0:*                   LISTEN      19533/redis-server  
    tcp        0      0 192.168.201.127:17004       0.0.0.0:*                   LISTEN      19537/redis-server  
    tcp        0      0 192.168.201.127:17005       0.0.0.0:*                   LISTEN      19541/redis-server  
    tcp        0      0 192.168.201.127:7003        0.0.0.0:*                   LISTEN      19533/redis-server  
    tcp        0      0 192.168.201.127:7004        0.0.0.0:*                   LISTEN      19537/redis-server  
    tcp        0      0 192.168.201.127:7005        0.0.0.0:*                   LISTEN      19541/redis-server  
    [root@iZ1mlxtcx2Z ~]# ps -ef|grep redis
    root     19533     1  0 May11 ?        00:10:06 redis-server 192.168.201.127:7003 [cluster]
    root     19537     1  0 May11 ?        00:11:39 redis-server 192.168.201.127:7004 [cluster]
    root     19541     1  0 May11 ?        00:06:04 redis-server 192.168.201.127:7005 [cluster]
    root     29113 28971  0 09:25 pts/0    00:00:00 grep redis
    
    
    10 条回复    2018-05-23 13:06:16 +08:00
    cloverstd
        1
    cloverstd  
       2018-05-23 09:43:20 +08:00
    哨兵吧
    fsckzy
        2
    fsckzy  
    OP
       2018-05-23 09:49:46 +08:00
    @cloverstd 哨兵的进程应该是 xx.xx.xx.xx:17003[Sentinel]
    kemad
        3
    kemad  
       2018-05-23 09:53:19 +08:00
    你这个是 tcp 端口侦听,不是进程。看 netstat 输出的最后一列,前面的数字才是 pid,只有三个进程。

    本人对 redis 不熟。
    defunct9
        4
    defunct9  
       2018-05-23 10:51:46 +08:00
    3 进程,6 个监听。无毛病啊
    zts1993
        5
    zts1993  
       2018-05-23 11:19:47 +08:00
    redis cluster : redis 端口+10000 作为集群通信端口

    结贴吧
    yexiangyang
        6
    yexiangyang  
       2018-05-23 11:42:24 +08:00
    搭车 问一句 client list 里面怎么总是多一个客户端链接
    yexiangyang
        7
    yexiangyang  
       2018-05-23 11:47:54 +08:00
    fsckzy
        8
    fsckzy  
    OP
       2018-05-23 12:51:34 +08:00
    @zts1993 谢谢
    Jakesoft
        9
    Jakesoft  
       2018-05-23 13:00:46 +08:00
    昨天也恰好看到了,https://redis.io/topics/cluster-tutorial

    > Every Redis Cluster node requires two TCP connections open. The normal Redis TCP port used to serve clients, for example 6379, plus the port obtained by adding 10000 to the data port, so 16379 in the example.
    hcymk2
        10
    hcymk2  
       2018-05-23 13:06:16 +08:00
    @yexiangyang
    cmd=info 估计服务器上是有 redis 运行状态的监控吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2871 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 11:38 · PVG 19:38 · LAX 04:38 · JFK 07:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.