From 22ee2f9cd553e889d09263aaf3e3d5c38f869ff7 Mon Sep 17 00:00:00 2001 From: therealbill Date: Mon, 11 May 2015 14:08:57 -0500 Subject: [PATCH] adding a sentinel command: "flushconfig" This new command triggers a config flush to save the in-memory config to disk. This is useful for cases of a configuration management system or a package manager wiping out your sentinel config while the process is still running - and has not yet been restarted. It can also be useful for scripting a backup and migrate or clone of a running sentinel. --- src/sentinel.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sentinel.c b/src/sentinel.c index 77932233..03b072cc 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -2788,6 +2788,10 @@ void sentinelCommand(redisClient *c) { sentinelEvent(REDIS_WARNING,"+monitor",ri,"%@ quorum %d",ri->quorum); addReply(c,shared.ok); } + } else if (!strcasecmp(c->argv[1]->ptr,"flushconfig")) { + sentinelFlushConfig(); + addReply(c,shared.ok); + return; } else if (!strcasecmp(c->argv[1]->ptr,"remove")) { /* SENTINEL REMOVE */ sentinelRedisInstance *ri; -- GitLab