Cluster: if no previous config exists, create the myself node as master.

This commit is contained in:
antirez 2013-02-22 19:24:01 +01:00
parent f4093753e4
commit 825e07f2fd

View File

@ -229,7 +229,8 @@ void clusterInit(void) {
if (clusterLoadConfig(server.cluster_configfile) == REDIS_ERR) {
/* No configuration found. We will just use the random name provided
* by the createClusterNode() function. */
server.cluster->myself = createClusterNode(NULL,REDIS_NODE_MYSELF);
server.cluster->myself =
createClusterNode(NULL,REDIS_NODE_MYSELF|REDIS_NODE_MASTER);
redisLog(REDIS_NOTICE,"No cluster configuration found, I'm %.40s",
server.cluster->myself->name);
clusterAddNode(server.cluster->myself);