redis slave 不会与 master 同步 [英] redis slave won't sync with master

查看:58
本文介绍了redis slave 不会与 master 同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

redis slave 不会与 master 同步.

The redis slave won't sync with the master.

我发出来就可以连接到master

I can connect to the master when I issue

HOST_NAME=fakehost
redis-cli -h $HOST_NAME

并使用诸如 INFO 之类的命令检查主站状态,因此连接性不是问题.

and check the master status using a command like INFO, so connectivity is not an issue.

从奴隶箱,我发出

SLAVEOF $HOST_NAME 6379

并收到OK.

当我在从站上发出 INFO 命令时,我得到

When I issue the INFO command on the slave, I get

# Replication
role:slave
master_host:<removed>
master_port:6379
master_link_status:down
master_last_io_seconds_ago:-1
master_sync_in_progress:0
master_link_down_since_seconds:1379450797
slave_priority:100
slave_read_only:1
connected_slaves:0

在主盒上,我发出 info 并获取

On the master box, I issue info and get

# Replication
role:master
connected_slaves:0

很明显我没有连接.

[11225] 17 Sep 14:31:33.225 * Connecting to MASTER...
[11225] 17 Sep 14:31:33.226 * MASTER <-> SLAVE sync started
[11225] 17 Sep 14:31:33.226 * Non blocking connect for SYNC fired the event.
[11225] 17 Sep 14:31:33.226 * Master replied to PING, replication can continue...
[11225] 17 Sep 14:31:33.227 # MASTER aborted replication with an error: ERR Unable to perform background save

测试

测试是否在 BGSAVE 上创建了 dump.rdb

Tests

Test that dump.rdb is created on BGSAVE

BGSAVE
> OK

测试是否在 SAVE 上创建了 dump.rdb

Test that dump.rdb is created on SAVE

SAVE
> OK

提前致谢.

推荐答案

我今天遇到了类似的情况.似乎对于使用 sysctl 的系统,您可能必须这样做:

I encountered a similar situation today. It seems that for systems that use sysctl, you might have to do:

sysctl vm.overcommit_memory=1

并重启从redis服务器.此链接可能会有所帮助.

and restart the slave redis server. This link might help.

这篇关于redis slave 不会与 master 同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆