Redis Error Summary

Source: Internet
Author: User
Tags redis
1, undefined reference to ' clock_gettime ' link wrong solution
When installing Redis, compile file make the Redis folder this error, clock_gettime in real Time library LIBRT, because the link is not linked to this library caused an error.
Solution Ideas:
Just add the dynamic link library LIBRT (-LRT) in the makefile file we run and recompile. Operation Steps:
(1) Find the path of the real-time library LIBRT:
Command
Find/-name ' *librt* '
/usr/lib/librt.so (need to correspond to the file location of the machine)
(2) Open the makefile file under the/home/wm/redis-3.2.7 path:
Vim/home/wm/redis-3.2.7/makefile
(3) Modify the Makefile file configuration:
Ifeq ($ (MALLOC), Jemalloc)
106 dependency_targets+= Jemalloc
107 final_cflags+=-duse_jemalloc-i. /deps/jemalloc/include
108 final_libs+=. /deps/jemalloc/lib/libjemalloc.a
109 final_libs+=/usr/lib/librt.so #此路径加上librt. so#
endif
(4) Execute: Wq command save exit, recompile can
2. [ERR] Node is not empty. Either the node already knows other nodes (check with C

[root@node00 src]#./redis-trib.rb add-node--slave--master-id4f6424e47a2275d2b7696bfbf8588e8c4c3a5b95 172.168.63.202:7001172.168.63.202:7000

......

[OK] All nodes agree about Slotsconfiguration.

>>> Check for open Slots ...

>>> Check Slots Coverage ...

[OK] All 16384 slots covered.

Connecting to Node 172.168.63.202:7001:ok

[ERR] Node 172.168.63.202:7001 is not empty. Either the Nodealready knows other nodes (check with CLUSTER nodes) or contains some key in database 0.

Workaround:

1), will need to add new nodes under AoF, RDB and other local backup files deleted;

2), at the same time, the new node's cluster configuration file is deleted, that is: delete your redis.conf inside cluster-config-file files;

3), add new node again if it is an error, log in to the new Node,./redis-cli–h x–p to clear the database:

172.168.63.201:7001> flushdb #清空当前数据库

( 1), 2) or 3 of the above solutions, then execute the script successfully;


3. Not all 16384 slots is covered by nodes.

[root@node01 src]#./REDIS-TRIB.RB check172.168.63.202:7000


Connecting to Node 172.168.63.202:7000:ok

Connecting to Node 172.168.63.203:7000:ok

Connecting to Node 172.168.63.201:7000:ok

>>> performing Cluster Check (using node 172.168.63.202:7000)

m:449de2d2a4b799ceb858501b5b78ab91504c72e0172.168.63.202:7000

Slots: (0 slots) Master

0additional Replica (s)

m:db9d26b1d15889ad2950382f4f32639606f9a94b172.168.63.203:7000

Slots: (0 slots) Master

0additional Replica (s)

m:f90924f71308eb434038fc8a5f481d3661324792172.168.63.201:7000

Slots: (0 slots) Master

0additional Replica (s)

[OK] All nodes agree about Slotsconfiguration.

>>> Check for open Slots ...

>>> Check Slots Coverage ...

[ERR] Not all 16384 slots is covered by nodes.


Reason:

This is often due to the removal of the primary node, but does not remove the slot above node, resulting in the total number of slots does not reach 16384, in fact, the slots distribution is incorrect. at the time of deleting the node, it is important to note whether the Master master node is deleted.

1), the official is recommended to use REDIS-TRIB.RB fix to repair the cluster ..... Through cluster nodes see 7001 This node was killed ... So

[root@node01 src]# ./redis-trib.rb Fix 172.168.63.201:7001


After the repair is complete, check the correct

[root@node01 src]#./REDIS-TRIB.RB check172.168.63.202:7000

Whenever you enter a node in any cluster, all related nodes are automatically checked. You can view the output to see if each master has slots, and if the distribution is uneven then you can reassign the slots in the following way:

[Root@node01 src]#./REDIS-TRIB.RB Reshard 172.168.63.201:7001

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.