240 发简信
IP属地:江苏
  • @foundwant 但是这个方案只能作为个人或者小规模使用时的妥协方案,对外暴露那么多node port并不安全和优雅,对于公有云或者大型私有云来说,还是前面加一层proxy只暴露一个endpoint比较好,redis6.0版本好像会有这个redis cluster proxy功能的提供

    从零开始搭建Kubernetes集群(六、在K8S上部署Redis 集群)

    一、前言 上一文《从零开始搭建Kubernetes集群(五、搭建K8S Ingress)》[https://www.jianshu.com/p/feeea0bbd73e#]主...

  • @foundwant
    可以看一看redis配置文件中的这个配置
    ########################## CLUSTER DOCKER/NAT support ########################

    # In certain deployments, Redis Cluster nodes address discovery fails, because
    # addresses are NAT-ted or because ports are forwarded (the typical case is
    # Docker and other containers).
    #
    # In order to make Redis Cluster working in such environments, a static
    # configuration where each node knows its public address is needed. The
    # following two options are used for this scope, and are:
    #
    # * cluster-announce-ip
    # * cluster-announce-port
    # * cluster-announce-bus-port
    #
    # Each instruct the node about its address, client port, and cluster message
    # bus port. The information is then published in the header of the bus packets
    # so that other nodes will be able to correctly map the address of the node
    # publishing the information.
    #
    # If the above options are not used, the normal Redis Cluster auto-detection
    # will be used instead.
    #
    # Note that when remapped, the bus port may not be at the fixed offset of
    # clients port + 10000, so you can specify any port and bus-port depending
    # on how they get remapped. If the bus-port is not set, a fixed offset of
    # 10000 will be used as usually.
    #
    # Example:
    #
    # cluster-announce-ip 10.1.1.5
    # cluster-announce-port 6379
    # cluster-announce-bus-port 6380
    这里配置使用node port地址就可以了

    从零开始搭建Kubernetes集群(六、在K8S上部署Redis 集群)

    一、前言 上一文《从零开始搭建Kubernetes集群(五、搭建K8S Ingress)》[https://www.jianshu.com/p/feeea0bbd73e#]主...

  • 这个方案只能提供给k8s集群内的应用使用,对集群外的应用根本用不了,因为一旦涉及到move命令,redis节点只会给出内部的pod ip,这个使得集群外的应用根本连不上,因为这个涉及到redis的源码,redis集群节点的相互通讯使用的redis进程所在的环境的ip,而这个ip就是pod ip,相对的节点发送给客户端的move的ip也是pod ip

    从零开始搭建Kubernetes集群(六、在K8S上部署Redis 集群)

    一、前言 上一文《从零开始搭建Kubernetes集群(五、搭建K8S Ingress)》[https://www.jianshu.com/p/feeea0bbd73e#]主...