mongodb连接数据库问题
直接输入./bin/mongo 127.0.0.1:12345 有如下错误
kh@ubuntu:~/mongodb_simple$ ./bin/mongo 127.0.0.1:12345 MongoDB shell version: 2.6.5 connecting to: 127.0.0.1:12345/test 2015-07-26T16:42:39.699+0800 warning: Failed to connect to 127.0.0.1:12345, reason: errno:111 Connection refused 2015-07-26T16:42:39.700+0800 Error: couldn't connect to server 127.0.0.1:12345 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:148 exception: connect failed
如果输入numactl 。。。。等等才能连接,而每次都要这样,求解啊!
kh@ubuntu:~/mongodb_simple$ numactl --interleave=all bin/mongod -f conf/mongod.conf about to fork child process, waiting until server is ready for connections. forked process: 59743 child process started successfully, parent exiting kh@ubuntu:~/mongodb_simple$ ./bin/mongo 127.0.0.1:12345 MongoDB shell version: 2.6.5 connecting to: 127.0.0.1:12345/test
另外shutdownServer()会出现
db.shutdownServer() 2015-07-26T15:36:49.420+0800 DBClientCursor::init call() failed server should be down... 2015-07-26T15:36:49.439+0800 trying reconnect to 127.0.0.1:12345 (127.0.0.1) failed 2015-07-26T15:36:49.441+0800 warning: Failed to connect to 127.0.0.1:12345, reason: errno:111 Connection refused 2015-07-26T15:36:49.441+0800 reconnect 127.0.0.1:12345 (127.0.0.1) failed failed couldn't connect to server 127.0.0.1:12345 (127.0.0.1), connection attempt failed > db.2015-07-26T15:37:00.657+0800 trying reconnect to 127.0.0.1:12345 (127.0.0.1) failed 2015-07-26T15:37:00.657+0800 warning: Failed to connect to 127.0.0.1:12345, reason: errno:111 Connection refused