rc.local 中加入 mongodb 启动命令:
/usr/local/mongodb/bin/mongod --dbpath=/usr/local/mongodb/data/db/ --logpath=/usr/local/mongodb/log/mongodb.log --logappend --fork
重启服务器后 mongo 客户端链接失败 查看 log 日志 错误如下
Sun May 12 18:37:35.658 [initandlisten] MongoDB starting : pid=963 port=27017 dbpath=/usr/local/mongodb/data/db/ 64-bit host=AY1304122154200811e8
Sun May 12 18:37:35.658 [initandlisten] db version v2.4.3
Sun May 12 18:37:35.658 [initandlisten] git version: fe1743177a5ea03e91e0052fb5e2cb2945f6d95f
Sun May 12 18:37:35.658 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
Sun May 12 18:37:35.658 [initandlisten] allocator: tcmalloc
Sun May 12 18:37:35.658 [initandlisten] options: { dbpath: "/usr/local/mongodb/data/db/", fork: true, journal: true, logpath: "/usr/local/mongodb/log/mongodb.log" }
Sun May 12 18:37:35.703 [initandlisten] journal dir=/usr/local/mongodb/data/db/journal
Sun May 12 18:37:35.705 [initandlisten] recover : no journal files present, no recovery needed
Sun May 12 18:37:35.844 [initandlisten] waiting for connections on port 27017
Sun May 12 18:37:35.844 [websvr] admin web console waiting for connections on port 28017
Sun May 12 18:39:02.513 [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
Sun May 12 18:39:02.513 [signalProcessingThread] now exiting
Sun May 12 18:39:02.513 dbexit:
Sun May 12 18:39:02.513 [signalProcessingThread] shutdown: going to close listening sockets...
Sun May 12 18:39:02.513 [signalProcessingThread] closing listening socket: 9
Sun May 12 18:39:02.513 [signalProcessingThread] closing listening socket: 10
Sun May 12 18:39:02.513 [signalProcessingThread] closing listening socket: 11
Sun May 12 18:39:02.513 [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
Sun May 12 18:39:02.513 [signalProcessingThread] shutdown: going to flush diaglog...
Sun May 12 18:39:02.513 [signalProcessingThread] shutdown: going to close sockets...
Sun May 12 18:39:02.513 [signalProcessingThread] shutdown: waiting for fs preallocator...
Sun May 12 18:39:02.513 [signalProcessingThread] shutdown: lock for final commit...
Sun May 12 18:39:02.513 [signalProcessingThread] shutdown: final commit...
Sun May 12 18:39:02.513 [signalProcessingThread] shutdown: closing all files...
Sun May 12 18:39:02.513 [signalProcessingThread] closeAllFiles() finished
Sun May 12 18:39:02.513 [signalProcessingThread] journalCleanup...
Sun May 12 18:39:02.513 [signalProcessingThread] removeJournalFiles
Sun May 12 18:39:02.542 [signalProcessingThread] shutdown: removing fs lock...
Sun May 12 18:39:02.542 dbexit: really exiting now
然后在我指定的 dbpath 目录中 (usr/local/mongodb/data/db/) 啥也没生成... 请问怎么解决啊...