node cluster configuration file configurable via redis.conf

This commit is contained in:
antirez 2011-04-07 21:34:41 +02:00
parent 2bc52b2c02
commit 1793752d97
2 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,7 @@ int clusterNodeGetSlotBit(clusterNode *n, int slot);
sds clusterGenNodesDescription(void);
clusterNode *clusterLookupNode(char *name);
int clusterNodeAddSlave(clusterNode *master, clusterNode *slave);
int clusterAddSlot(clusterNode *n, int slot);
/* -----------------------------------------------------------------------------
* Initialization

View File

@ -289,6 +289,9 @@ void loadServerConfig(char *filename) {
if ((server.cluster_enabled = yesnotoi(argv[1])) == -1) {
err = "argument must be 'yes' or 'no'"; goto loaderr;
}
} else if (!strcasecmp(argv[0],"cluster-config-file") && argc == 2) {
zfree(server.cluster.configfile);
server.cluster.configfile = zstrdup(argv[1]);
} else {
err = "Bad directive or wrong number of arguments"; goto loaderr;
}