call':ERR MEET 中的 IP 地址无效(Redis::CommandError)Redis

问题描述 投票:0回答:1

当我第一次执行 redis cluster 命令时,出现以下错误

>>> Performing hash slots allocation on 2 nodes...
M: a644f0c711c6a7a455f4154682beb0866df0c1e5 10.1.0.164:1234
   slots:0-8191 (8192 slots) master
M: 3d057397fbafc5a29a5c9aacffec70b3b356cbed 10.1.2.68:1112
slots:8192-16383 (8192 slots) master
Can I set the above configuration? (type 'yes' to accept): yes
>>> Nodes configuration updated
>>> Sending CLUSTER MEET messages to join the cluster
/Library/Ruby/Gems/1.8/gems/redis-3.0.4/lib/redis/client.rb:85:in `call': ERR Invalid      IP address in MEET (Redis::CommandError)
from /Library/Ruby/Gems/1.8/gems/redis-3.0.4/lib/redis.rb:2240:in `method_missing'
from /Library/Ruby/Gems/1.8/gems/redis-3.0.4/lib/redis.rb:36:in `synchronize'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'
from /Library/Ruby/Gems/1.8/gems/redis-3.0.4/lib/redis.rb:36:in `synchronize'
from /Library/Ruby/Gems/1.8/gems/redis-3.0.4/lib/redis.rb:2239:in `method_missing'
from ./redis-trib.rb:495:in `join_cluster'
from ./redis-trib.rb:493:in `each'
from ./redis-trib.rb:493:in `join_cluster'
from ./redis-trib.rb:687:in `create_cluster_cmd'
from ./redis-trib.rb:755:in `send'
from ./redis-trib.rb:755

如果我第二次执行相同的命令,错误将更改为以下

>>> Performing hash slots allocation on 2 nodes...
M: b19f4a4e3fd69e905897937cb694c62ceaf47643 127.0.0.1:1112
slots:0-16383 (16384 slots) master
M: 1e93a0ccde04d9fba0403917e622e82a891b2137 10.1.0.164:1234
slots:0-16383 (16384 slots) master
Can I set the above configuration? (type 'yes' to accept): yes
/Library/Ruby/Gems/1.8/gems/redis-3.0.4/lib/redis/client.rb:85:in `call': ERR Slot     10247 is already busy (Redis::CommandError)
from /Library/Ruby/Gems/1.8/gems/redis-3.0.4/lib/redis.rb:2240:in `method_missing'
from /Library/Ruby/Gems/1.8/gems/redis-3.0.4/lib/redis.rb:36:in `synchronize'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'
from /Library/Ruby/Gems/1.8/gems/redis-3.0.4/lib/redis.rb:36:in `synchronize'
from /Library/Ruby/Gems/1.8/gems/redis-3.0.4/lib/redis.rb:2239:in `method_missing'
from ./redis-trib.rb:184:in `flush_node_config'
from ./redis-trib.rb:476:in `flush_nodes_config'
from ./redis-trib.rb:475:in `each'
from ./redis-trib.rb:475:in `flush_nodes_config'
from ./redis-trib.rb:684:in `create_cluster_cmd'
from ./redis-trib.rb:755:in `send'
from ./redis-trib.rb:755

请帮我解决这两个问题。

如果有Redis集群配置傻瓜教程请分享给我。

redis node-redis redistogo
1个回答
0
投票
    root@redis-5:/data# redis-cli --cluster create \
    >                 redis-0.redis-headless.default.svc.cluster.local:6379 \
    >                 redis-1.redis-headless.default.svc.cluster.local:6379 \
    >                 redis-2.redis-headless.default.svc.cluster.local:6379 \
    >                 redis-3.redis-headless.default.svc.cluster.local:6379 \
    >                 redis-4.redis-headless.default.svc.cluster.local:6379 \
    >                 redis-5.redis-headless.default.svc.cluster.local:6379 --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 redis-4.redis-headless.default.svc.cluster.local:6379 to redis-0.redis-headless.default.svc.cluster.local:6379
    Adding replica redis-5.redis-headless.default.svc.cluster.local:6379 to redis-1.redis-headless.default.svc.cluster.local:6379
    Adding replica redis-3.redis-headless.default.svc.cluster.local:6379 to redis-2.redis-headless.default.svc.cluster.local:6379
    M: 190a10eac9afa61d79db0958d902ea9d70f85ada redis-0.redis-headless.default.svc.cluster.local:6379
       slots:[0-5460] (5461 slots) master
    M: e40957794ba94a48c4bede9b329176d6543da125 redis-1.redis-headless.default.svc.cluster.local:6379
       slots:[5461-10922] (5462 slots) master
    M: dac7354e586ce1b606561897d1bd6d993cb2be5d redis-2.redis-headless.default.svc.cluster.local:6379
       slots:[10923-16383] (5461 slots) master
    S: 60095149f37eba8d40bbf905ad5a1e5b1770c3a6 redis-3.redis-headless.default.svc.cluster.local:6379
       replicates dac7354e586ce1b606561897d1bd6d993cb2be5d
    S: d8d07bcd6eeb82c7941dd8254c8909af68607be1 redis-4.redis-headless.default.svc.cluster.local:6379
       replicates 190a10eac9afa61d79db0958d902ea9d70f85ada
    S: e96dad8186ae2605a7fabd81b98130960d3f97fa redis-5.redis-headless.default.svc.cluster.local:6379
       replicates e40957794ba94a48c4bede9b329176d6543da125
    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
    Node redis-1.redis-headless.default.svc.cluster.local:6379 replied with error:
    ERR Invalid node address specified: redis-0.redis-headless.default.svc.cluster.local:6379
    
    same issue.


root@redis-1:/data# nc -zv redis-0.redis-headless.default.svc.cluster.local 6379
redis-0.redis-headless.default.svc.cluster.local [10.1.14.183] 6379 (?) open
root@redis-1:/data# nc -zv redis-0.redis-headless.default.svc.cluster.local 16379
redis-0.redis-headless.default.svc.cluster.local [10.1.14.183] 16379 (?) open

and have no connect error from node-1 to node-0

    enter code here
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.