您好,登錄后才能下訂單哦!
本篇內容主要講解“Redis錯誤failed: Hostname must not be empty or null怎么解決”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“Redis錯誤failed: Hostname must not be empty or null怎么解決”吧!
1.收到大量應用告警
Could not retrieve cluster information. CLUSTER NODES returned with error. - 172.23.17.57:6379 failed: Hostname must not be empty or null
2.登陸集群機器查看
[root@aliyun-mb-welike-prod-rdc-1-b-01 ~]# /usr/local/src/redis-4.0.8/src/redis-trib.rb check 172.23.13.194:6379 >>> Performing Cluster Check (using node 172.23.13.194:6379) S: aa30a9c5004d2492d01c90692f7de8d3b90fd4ed 172.23.13.194:6379 slots: (0 slots) slave replicates 7122bb26444cb62228396e89ae3db97eda256926 S: 39f2b3370729bf2e99f4b0efeb96b58cb849ac91 172.23.13.200:6379 slots: (0 slots) slave replicates 1e3b30a7e08279067cb193a8d550c3b22230a629 S: a6fb7fb6e9243c5cc9679daaa3d3aacbf71f0e5a 172.23.13.195:6379 slots: (0 slots) slave replicates c3bbc8f04e902d16cc0a40516a292715b74b4d19 M: c3bbc8f04e902d16cc0a40516a292715b74b4d19 172.23.17.58:6379 slots:2068-2105,2636-4996,5463-6374,7283-7541,9741-9771,10923-11417 (4096 slots) master 1 additional replica(s) M: 7122bb26444cb62228396e89ae3db97eda256926 172.23.17.55:6379 slots:28,431,1967-2067,7104-7282,8194-9106,9719-9740,11833-12434,12436-12617,14417-16383 (3968 slots) master 1 additional replica(s) S: 011401a43fbe38dad3ff6dfc429aa1e987436aa8 172.23.17.57:6379 slots: (0 slots) slave replicates 5cb816f4c9f9d48c7bba5115b7a89c881bf6b46f S: 45b52d2692c3c16d91c360b3b4c18c4ae18e4f28 172.23.17.55:6380 slots: (0 slots) slave replicates a6dd59d54ffacbbe7ade84d4ffeaa746e99e724c S: 600cb902806705526037d12ca94dfbde8d27318a 172.23.13.194:6380 slots: (0 slots) slave replicates a6dd59d54ffacbbe7ade84d4ffeaa746e99e724c M: a6dd59d54ffacbbe7ade84d4ffeaa746e99e724c 172.23.13.201:6379 slots:12435 (1 slots) master 2 additional replica(s) M: 5cb816f4c9f9d48c7bba5115b7a89c881bf6b46f 172.23.13.196:6379 slots:861-1145,1822-1966,2234-2635,6706-7103,9298-9718,9778-9782,9785-10922,12618-13654,14025-14416 (4223 slots) master 1 additional replica(s) M: 1e3b30a7e08279067cb193a8d550c3b22230a629 172.23.17.56:6379 slots:0-27,29-430,432-860,1146-1821,2106-2233,4997-5462,6375-6705,7542-8193,9107-9297,9772-9777,9783-9784,11418-11832,13655-14024 (4096 slots) master 1 additional replica(s) [OK] All nodes agree about slots configuration. >>> Check for open slots... >>> Check slots coverage... [OK] All 16384 slots covered.
喲,好像集群狀態正常,也沒找到這個ip的信息啊
3.繼續查看節點信息
[root@aliyun-mb-welike-prod-rdc-1-b-01 ~]# /usr/local/redis//bin/redis-cli -a inH7HkD7iXoxKZCi -h 172.23.13.194 -c cluster nodes 1e54bab9fb0f02e634cf9c958613f3814d221d9f :0@0 slave,fail,noaddr 1e3b30a7e08279067cb193a8d550c3b22230a629 1552634222097 1552634217000 89 disconnected aa30a9c5004d2492d01c90692f7de8d3b90fd4ed 172.23.13.194:6379@16379 myself,slave 7122bb26444cb62228396e89ae3db97eda256926 0 1552876530000 67 connected 39f2b3370729bf2e99f4b0efeb96b58cb849ac91 172.23.13.200:6379@16379 slave 1e3b30a7e08279067cb193a8d550c3b22230a629 0 1552876532139 89 connected a6fb7fb6e9243c5cc9679daaa3d3aacbf71f0e5a 172.23.13.195:6379@16379 slave c3bbc8f04e902d16cc0a40516a292715b74b4d19 0 1552876530134 90 connected c3bbc8f04e902d16cc0a40516a292715b74b4d19 172.23.17.58:6379@16379 master - 0 1552876532000 90 connected 2068-2105 2636-4996 5463-6374 7283-7541 9741-9771 10923-11417 7122bb26444cb62228396e89ae3db97eda256926 172.23.17.55:6379@16379 master - 0 1552876531000 87 connected 28 431 1967-2067 7104-7282 8194-9106 9719-9740 11833-12434 12436-12617 14417-16383 011401a43fbe38dad3ff6dfc429aa1e987436aa8 172.23.17.57:6379@16379 slave 5cb816f4c9f9d48c7bba5115b7a89c881bf6b46f 0 1552876531000 91 connected 45b52d2692c3c16d91c360b3b4c18c4ae18e4f28 172.23.17.55:6380@16380 slave a6dd59d54ffacbbe7ade84d4ffeaa746e99e724c 0 1552876531138 92 connected 600cb902806705526037d12ca94dfbde8d27318a 172.23.13.194:6380@16380 slave a6dd59d54ffacbbe7ade84d4ffeaa746e99e724c 0 1552876533000 92 connected a6dd59d54ffacbbe7ade84d4ffeaa746e99e724c 172.23.13.201:6379@16379 master - 0 1552876533142 92 connected 12435 5cb816f4c9f9d48c7bba5115b7a89c881bf6b46f 172.23.13.196:6379@16379 master - 0 1552876530000 91 connected 861-1145 1822-1966 2234-2635 6706-7103 9298-9718 9778-9782 9785-10922 12618-13654 14025-14416 1e3b30a7e08279067cb193a8d550c3b22230a629 172.23.17.56:6379@16379 master - 0 1552876534145 89 connected 0-27 29-430 432-860 1146-1821 2106-2233 4997-5462 6375-6705 7542-8193 9107-9297 9772-9777 9783-9784 11418-11832 13655-14024
就是第一條信息導致的
4.解決辦法
如果一個節點處于“:0 master,fail,noaddr”狀態,執行“del-node”會報錯: [ERR] No such node ID 80560d0d97a0b3fa975203350516437b58251745 這種情況下,只需要執行“CLUSTER FORGET”將其剔除即可(注意,需要在所有節點上執行一次,不然未執行的節點上可 能仍然看得到“:0 master,fail,noaddr”): 每個節點上執行cluster forget node-id
到此,相信大家對“Redis錯誤failed: Hostname must not be empty or null怎么解決”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。