Summer's Blog
😈酷炫主页
✨运维
🎉安装
👀踩坑
  • k8s
  • shell
  • python
  • redis
  • elasticsearch
  • mysql
  • ceph
  • spark
  • 关于
  • 思维
  • 命令
  • 友链
  • 分类
  • 标签
  • 归档
👨‍👩‍👦‍👦腾讯云社区
🗣GitHub

Summer———夏苏文

💨运维界的前行者
😈酷炫主页
✨运维
🎉安装
👀踩坑
  • k8s
  • shell
  • python
  • redis
  • elasticsearch
  • mysql
  • ceph
  • spark
  • 关于
  • 思维
  • 命令
  • 友链
  • 分类
  • 标签
  • 归档
👨‍👩‍👦‍👦腾讯云社区
🗣GitHub
  • ES只读模式修改
  • mysql主从只读
  • 服务器CPU爆满问题定位
  • 浅谈VIP地址漂移
  • 恢复磁盘占用过大变成只读模式
  • 登录环境故障解决
  • 解决ES无分片可用
  • docker日志过大处理
  • 软连接解决磁盘满
  • k8s常用端口打不开
  • redis端口不通解决方法
  • Docker容器启动报ipv4
  • nginx安装lua模块报错处理
  • linux重启网卡报错处理
  • linux命令notfound处理汇总
  • redis创建集群问题解决
    • k8s容器时间修改
    • k8s无法删除namespace
    • 服务器终端乱码问题
    • getcwd无法定位当前工作目录
    • 踩坑
    summer
    2020-01-24

    redis创建集群问题解决

    # Could not connect to Redis No route to host

    点击查看
    • 一般是防火墙问题,关闭每个节点的防火墙即可
    [root@summer script]# /usr/local/bin/redis-cli --cluster create  192.168.0.68:27000 192.168.0.68:27001 192.168.0.186:27000 192.168.0.186:27001 192.168.0.90:27000 192.168.0.90:27001 --cluster-replicas 1
    Could not connect to Redis at 192.168.0.90:27000: No route to host
    [root@summer script]# systemctl stop firewalld.service
    [root@summer script]# /usr/local/bin/redis-cli --cluster create  192.168.0.68:27000 192.168.0.68:27001 192.168.0.186:27000 192.168.0.186:27001 192.168.0.90:27000 192.168.0.90:27001 --cluster-replicas 1
    >>> Performing hash slots allocation on 6 nodes...
    Master[0] -> Slots 0 - 5460
    Master[1] -> Slots 5461 - 10922
    Master[2] -> Slots 10923 - 16383
    Adding replica 192.168.0.186:27001 to 192.168.0.68:27000
    Adding replica 192.168.0.90:27001 to 192.168.0.186:27000
    Adding replica 192.168.0.68:27001 to 192.168.0.90:27000
    M: db9f53a88ca58a45c0937ee47a3059351c08be63 192.168.0.68:27000
       slots:[0-5460] (5461 slots) master
    S: 0b1c24d6db9152c19062a2e1cef5b893d8722e55 192.168.0.68:27001
       replicates ec9254a213de1d9c4d17ef2b1208e224b73bd2e2
    M: d55bafc8e5e06a17d9987ac50075118988710330 192.168.0.186:27000
       slots:[5461-10922] (5462 slots) master
    S: 045ca4b6d55fd19f2b77bac013b0fa13e346b1cd 192.168.0.186:27001
       replicates db9f53a88ca58a45c0937ee47a3059351c08be63
    M: ec9254a213de1d9c4d17ef2b1208e224b73bd2e2 192.168.0.90:27000
       slots:[10923-16383] (5461 slots) master
    S: 22399be1d3274c8a6494a13f96030ff144e8f8ea 192.168.0.90:27001
       replicates d55bafc8e5e06a17d9987ac50075118988710330
    Can I set the above configuration? (type 'yes' to accept): yes
    >>> Nodes configuration updated
    >>> Assign a different config epoch to each node
    >>> Sending CLUSTER MEET messages to join the cluster
    Waiting for the cluster to join
    ....
    >>> Performing Cluster Check (using node 192.168.0.68:27000)
    M: db9f53a88ca58a45c0937ee47a3059351c08be63 192.168.0.68:27000
       slots:[0-5460] (5461 slots) master
       1 additional replica(s)
    S: 0b1c24d6db9152c19062a2e1cef5b893d8722e55 192.168.0.68:27001
       slots: (0 slots) slave
       replicates ec9254a213de1d9c4d17ef2b1208e224b73bd2e2
    M: ec9254a213de1d9c4d17ef2b1208e224b73bd2e2 192.168.0.90:27000
       slots:[10923-16383] (5461 slots) master
       1 additional replica(s)
    M: d55bafc8e5e06a17d9987ac50075118988710330 192.168.0.186:27000
       slots:[5461-10922] (5462 slots) master
       1 additional replica(s)
    S: 22399be1d3274c8a6494a13f96030ff144e8f8ea 192.168.0.90:27001
       slots: (0 slots) slave
       replicates d55bafc8e5e06a17d9987ac50075118988710330
    S: 045ca4b6d55fd19f2b77bac013b0fa13e346b1cd 192.168.0.186:27001
       slots: (0 slots) slave
       replicates db9f53a88ca58a45c0937ee47a3059351c08be63
    [OK] All nodes agree about slots configuration.
    >>> Check for open slots...
    >>> Check slots coverage...
    [OK] All 16384 slots covered.
    [root@summer script]# redis-cli -h 192.168.0.68 -p 27000
    192.168.0.68:27000> cluster nodes
    0b1c24d6db9152c19062a2e1cef5b893d8722e55 192.168.0.68:27001@37001 slave ec9254a213de1d9c4d17ef2b1208e224b73bd2e2 0 1608806725754 5 connected
    ec9254a213de1d9c4d17ef2b1208e224b73bd2e2 192.168.0.90:27000@37000 master - 0 1608806723740 5 connected 10923-16383
    d55bafc8e5e06a17d9987ac50075118988710330 192.168.0.186:27000@37000 master - 0 1608806724000 3 connected 5461-10922
    22399be1d3274c8a6494a13f96030ff144e8f8ea 192.168.0.90:27001@37001 slave d55bafc8e5e06a17d9987ac50075118988710330 0 1608806722732 6 connected
    db9f53a88ca58a45c0937ee47a3059351c08be63 192.168.0.68:27000@37000 myself,master - 0 1608806720000 1 connected 0-5460
    045ca4b6d55fd19f2b77bac013b0fa13e346b1cd 192.168.0.186:27001@37001 slave db9f53a88ca58a45c0937ee47a3059351c08be63 0 1608806724747 4 connected
    192.168.0.68:27000> 
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61

    # 37000总线端口未开放

    点击查看
    • 创建集群时一直显示Waiting for the cluster to join
    1. 每个Redis集群中的节点都需要打开两个TCP连接。一个连接用于正常的给Client提供服务,比如6379,还有一个额外的端口(通过在这个端口号上加10000)作为数据端口。如16379,这是一个用二进制协议的点对点通信信道。集群总线(Cluster bus)用于节点的失败侦测、配置更新、故障转移授权,等等。客户端从来都不应该尝试和这些集群总线端口通信,它们只应该和正常的Redis命令端口进行通信。

    2. 命令端口和集群总线端口的偏移量是10000。

    注意,集群中的每个节点都应该可以访问集群总线端口(客户端通信端口 + 10000)

    集群总线用一个不同的二进制协议通信,用于节点之间的数据交换

    #redis
    上次更新: 1/6/2021, 9:24:31 PM
    linux命令notfound处理汇总
    k8s容器时间修改

    ← linux命令notfound处理汇总 k8s容器时间修改→

    最近更新
    01
    centos8安装部署ovirt-engine
    11-21
    02
    安装Acunetix
    11-02
    03
    三大漏洞扫描工具报告获取
    05-24
    更多文章>
    Theme by Vdoing | Copyright © 2019-2022 夏苏文 | MIT License

    网站已在灾难中运行:

    蜀ICP备2022029853号-1
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式