fsckzy
V2EX  ›  Redis

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

  •  
  •   fsckzy · May 23, 2018 · 3932 views
    This topic created in 2917 days ago, the information mentioned may be changed or developed.

    创建了 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 replies    2018-05-23 13:06:16 +08:00
    cloverstd
        1
    cloverstd  
       May 23, 2018
    哨兵吧
    fsckzy
        2
    fsckzy  
    OP
       May 23, 2018
    @cloverstd 哨兵的进程应该是 xx.xx.xx.xx:17003[Sentinel]
    kemad
        3
    kemad  
       May 23, 2018
    你这个是 tcp 端口侦听,不是进程。看 netstat 输出的最后一列,前面的数字才是 pid,只有三个进程。

    本人对 redis 不熟。
    defunct9
        4
    defunct9  
       May 23, 2018
    3 进程,6 个监听。无毛病啊
    zts1993
        5
    zts1993  
       May 23, 2018
    redis cluster : redis 端口+10000 作为集群通信端口

    结贴吧
    yexiangyang
        6
    yexiangyang  
       May 23, 2018
    搭车 问一句 client list 里面怎么总是多一个客户端链接
    yexiangyang
        7
    yexiangyang  
       May 23, 2018
    fsckzy
        8
    fsckzy  
    OP
       May 23, 2018
    @zts1993 谢谢
    Jakesoft
        9
    Jakesoft  
       May 23, 2018
    昨天也恰好看到了,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  
       May 23, 2018
    @yexiangyang
    cmd=info 估计服务器上是有 redis 运行状态的监控吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3095 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 11:37 · PVG 19:37 · LAX 04:37 · JFK 07:37
    ♥ Do have faith in what you're doing.