Redis Learning Cluster error node is not empty

Source: Internet
Author: User
Tags bind redis redis server
write in front


After a redis3.0.x cluster is completed, of course, to use the client jediscluster simple test cluster, this will be redis.conf bind 127.0.0.1 changed to bind + Real machine IP (my 192.168.161.131 ), the following simply records the problems and solutions encountered in the test in this article.

problems encountered and their solutions



After bind the real machine IP in redis.conf, then re-execute each redis.conf, and then create the cluster again, but error, as shown in the following figure:

The error that is reported in the picture is:



[ERR] Node 192.168.161.131:7000 is not empty. Either the node already knows other nodes (check with CLUSTER nodes) or contains some key in database 0.
That's weird, so I went over the REDIS.CONF,IP and I did change.



Thought for a while to find that these three files appendonly.aof Dump.rdb nodes.conf was generated before executing ip127.0.0.1, after I changed to True machine IP, the execution did not take effect.



Here's an explanation of the dump.rdb file:



Dump.rdb is automatically generated by the Redis server by default every once in a while the Redis server program automatically iterates through the database, writing memory snapshots in a file called "Dump.rdb", a persistence mechanism called snapshot. With snapshot, if the server goes down and the Redis server program restarts, Redis automatically loads the DUMP.RDB and restores the database state to the last time it was snapshot.



Know the reason is good to do, the solution:



1) Delete aof, RDB, nodes.conf Local backup files under each node;
2) 172.168.63.201:7001> Flushdb #清空当前数据库 (can be omitted)
3) then execute the script and execute it successfully;



After the problem is resolved, it can be successfully tested from the Java client:

PS: Here you do not test, you can write it in the configuration file, I am here for convenience. 

written in the last



In fact, usually in the test encountered many problems, can find the answer on the Internet, here is just a simple record one of them. For an introduction to Redis clustering, see the Redis Chinese introduction


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.