redis连接时报错:Could not connect to Redis at 192.168.1.21:6379: Connection refused

2022-09-07 14:03:39 浏览数 (1)

大家好,又见面了,我是你们的朋友全栈君。

brew install redis 安装好redis

用terminal连接redis查看状态时时出现错误:

代码语言:javascript复制
[root@admin2 bin]# redis-cli -h 192.168.1.21 info Replication
Could not connect to Redis at 192.168.1.21:6379: Connection refused

但是查看127.0.0.1状态时,却是完好无损的,能够出现所要查看的状态信息

代码语言:javascript复制
[root@admin2 bin]# redis-cli -h 127.0.0.1 info Replication
# Replication
role:slave
master_host:192.168.1.21
master_port:6379
master_link_status:down
master_last_io_seconds_ago:-1
master_sync_in_progress:0
slave_repl_offset:1
master_link_down_since_seconds:1536458613
slave_priority:100
slave_read_only:1
connected_slaves:0
master_replid:d426c9f4ca894232a5264edcca622dd9c7628adf
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:0
second_repl_offset:-1
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0
[root@admin2 bin]# 

这是什么原因导致的呢?难道是因为缺少一定的配置信息才导致的这个情况吗?

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/136416.html原文链接:https://javaforall.cn

0 人点赞