Is it possible to start single node/container redis cluster?
I am using bitnami/redis-cluster
image, When I start master using the following commmand
docker run --name redis-cluster -e ALLOW_EMPTY_PASSWORD=yes -e REDIS_NODES=1 -e REDIS_PORT_NUMBER=30001 -p 30001:30001 -e REDIS_REPLICATION_MODE=master bitnami/redis-cluster:latest
One node comes, but when I am trying to get cluster info
127.0.0.1:30001> CLUSTER INFO
cluster_state:fail
cluster_slots_assigned:0
cluster_slots_ok:0
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:1
cluster_size:0
cluster_current_epoch:0
cluster_my_epoch:0
cluster_stats_messages_sent:0
cluster_stats_messages_received:0
When i start application with redis cluster ip set as localhost:30001 it gives error as
[] [] [2021-11-25 15:30:29] [ WARN] [] - [lettuce-nioEventLoop-4-3] - [ClusterTopologyRefresh] - Unable to connect to 172.17.0.4:30001 io.netty.channel.ConnectTimeoutException: connection timed out: /172.17.0.4:30001
I am not sure why it is trying to connect to 172.17.0.4.
When I try to connect in python
>>> from rediscluster import RedisCluster
>>> startup_nodes = [{"host": "127.0.0.1", "port": "30001"}]
>>> rc = RedisCluster(startup_nodes=startup_nodes, decode_responses=True)
>>> rc.set("foo", "bar")
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/rediscluster/connection.py", line 376, in get_master_node_by_slot
return self.nodes.slots[slot][0]
KeyError: 12182
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/redis/client.py", line 1801, in set
return self.execute_command('SET', *pieces)
File "/usr/local/lib/python3.8/site-packages/rediscluster/client.py", line 555, in execute_command
return self._execute_command(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/rediscluster/client.py", line 643, in _execute_command
raise e
File "/usr/local/lib/python3.8/site-packages/rediscluster/client.py", line 606, in _execute_command
node = self.connection_pool.get_master_node_by_slot(slot)
File "/usr/local/lib/python3.8/site-packages/rediscluster/connection.py", line 378, in get_master_node_by_slot
raise SlotNotCoveredError('Slot "{slot}" not covered by the cluster. "skip_full_coverage_check={skip_full_coverage_check}"'.format(
rediscluster.exceptions.SlotNotCoveredError: Slot "12182" not covered by the cluster. "skip_full_coverage_check=False"