The error 'redis cluster node is not empty' signifies that a Redis node currently holds data, and therefore, it cannot be used to create or join a cluster. This usually occurs when you try to form a cluster with nodes that have been used before and still contain key-value pairs.
Using existing nodes with data for cluster formation can lead to inconsistencies in data distribution across the entire cluster. The Redis clustering algorithm presumes that all joining nodes are initially empty to avoid any complications during the hash slot allocation and rebalancing processes. Thus, if a node contains data, the operation will fail, causing this error.
To solve the 'redis cluster node is not empty' issue, you need to clear the data from the node before using it in a cluster formation process. This can be done in two ways:
FLUSHALL command to remove all keys from the database of the node or nodes causing the trouble. Be cautious while using this command as it will permanently delete all data present on the node.
nodes.conf, etc.) manually, and then restart the server.
After you've cleared data from the node, you should be able to add it to your cluster without encountering the 'redis cluster node is not empty' error.