最近在搭建MONGODB集群的rs.initiate(config)时报错"ok" : 0, "errmsg" : "server is not running
"_id" : "shard1",
"members" : [
{
"_id" : 0,
"host" : "192.168.11.134:27017"
},
{
"_id" : 1,
"host" : "192.168.11.135:27017"
},
{
"_id" : 2,
"host" : "192.168.11.136:27017"
}
]
}
> rs.initiate(config)
{ "ok" : 0, "errmsg" : "server is not running with --replSet", "code" : 76 }
查看日志显示
2015-05-24T06:25:35.363-0700 I JOURNAL [initandlisten] journal dir=/usr/mongodb/data01/journal
2015-05-24T06:25:35.378-0700 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed
2015-05-24T06:25:35.475-0700 I JOURNAL [durability] Durability thread started
2015-05-24T06:25:35.475-0700 I JOURNAL [journal writer] Journal writer thread started
2015-05-24T06:25:35.476-0700 I CONTROL [initandlisten] MongoDB starting : pid=23723 port=27017 dbpath=/usr/mongodb/data01 64-bit host=servera
2015-05-24T06:25:35.476-0700 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2015-05-24T06:25:35.476-0700 I CONTROL [initandlisten]
2015-05-24T06:25:35.477-0700 I CONTROL [initandlisten] db version v3.0.3
2015-05-24T06:25:35.477-0700 I CONTROL [initandlisten] git version: b40106b36eecd1b4407eb1ad1af6bc60593c6105
2015-05-24T06:25:35.477-0700 I CONTROL [initandlisten] build info: Linux build14.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2015-05-24T06:25:35.477-0700 I CONTROL [initandlisten] allocator: tcmalloc
2015-05-24T06:25:35.477-0700 I CONTROL [initandlisten] options: { net: { port: 27017 }, storage: { dbPath: "/usr/mongodb/data01" }, systemLog: { destination: "file", path: "/usr/mongodb/data01/mongo.log" } }
2015-05-24T06:25:35.568-0700 I NETWORK [initandlisten] waiting for connections on port 27017
2015-05-24T06:32:06.561-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:40680 #1 (1 connection now open)
2015-05-24T06:35:29.883-0700 I REPL [conn1] replSetInitiate admin command received from client
2015-05-24T06:40:38.656-0700 I NETWORK [conn1] end connection 127.0.0.1:40680 (0 connections now open)
2015-05-24T06:41:01.326-0700 I NETWORK [initandlisten] connection accepted from 127.0.0.1:40681 #2 (1 connection now open)
2015-05-24T06:41:43.173-0700 I REPL [conn2] replSetInitiate admin command received from client