Search code examples
bashmacosredismacos-sierraredis-cluster

Unable to start Redis Cluster servers


I'm trying to start the Redis cluster servers by turning on 6 servers from ports 7000 to 7005, each with a redis.conf in their own directories on my macOS Sierra. I can start the first server fine (either of the 6) and here's that output and the info in the cli: Here's an example of one of these commands I run, using redis 3.2.1

redis-server /private/etc/redis-3.2.1/src/7002/redis.conf

but starting another would give this error:

11245:M 06 Mar 22:45:22.536 * Increased maximum number of open files to 10032 (it was originally set to 7168).
11245:M 06 Mar 22:45:22.537 # Sorry, the cluster configuration file nodes.conf is already used by a different Redis Cluster node. Please make sure that different nodes use different cluster configuration files.

Following the docs, I have each redis.conf configured to this with their corresponding port numbers

port 7000
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes

This used to work for me. I don't know for certain if it's related, but since then I have built these files into Docker images and containers. However, as far as I can tell I have deleted them, and also this file: /Users/MyUserAccount/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux

I also just deleted all the directories and recreated them in a different directory, but still it does not work. What can I do to get these ports available for Redis Cluster again?


UPDATE:

Also, my nodes.conf file is not being recreated in any of the port folders, and all of them only has the redis.conf file. Before when it worked, there was a nodes.conf file generated with 2 other files (I think a dump file and one other one).


Solution

  • Looks like a nodes.conf is being generated from wherever I call redis-server from, and I am able to start the servers if I cd into the different directories. This seems kind of inconvenient since before I just had a script that called from a single location the redis.conf at their absolute paths. But at least I have some solution.