0, size: 64MB,? took 0.001 secs
2015-10-28T10:03:33.511+0800 I NETWORK? [initandlisten] waiting for connections on port 27017
###停止mongo,直接使用ctrl + c
^C2015-10-28T10:09:21.510+0800 I CONTROL? [signalProcessingThread] got signal 2 (Interrupt), will terminate after current cmd ends
2015-10-28T10:09:21.511+0800 I CONTROL? [signalProcessingThread] now exiting
2015-10-28T10:09:21.511+0800 I NETWORK? [signalProcessingThread] shutdown: going to close listening sockets...
2015-10-28T10:09:21.511+0800 I NETWORK? [signalProcessingThread] closing listening socket: 5
2015-10-28T10:09:21.511+0800 I NETWORK? [signalProcessingThread] closing listening socket: 6
2015-10-28T10:09:21.511+0800 I NETWORK? [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2015-10-28T10:09:21.511+0800 I NETWORK? [signalProcessingThread] shutdown: going to flush diaglog...
2015-10-28T10:09:21.511+0800 I NETWORK? [signalProcessingThread] shutdown: going to close sockets...
2015-10-28T10:09:21.512+0800 I STORAGE? [signalProcessingThread] shutdown: waiting for fs preallocator...
2015-10-28T10:09:21.512+0800 I STORAGE? [signalProcessingThread] shutdown: final commit...
2015-10-28T10:09:21.512+0800 I JOURNAL? [signalProcessingThread] journalCleanup...
2015-10-28T10:09:21.512+0800 I JOURNAL? [signalProcessingThread] removeJournalFiles
2015-10-28T10:09:21.515+0800 I JOURNAL? [signalProcessingThread] Terminating durability thread ...
2015-10-28T10:09:21.615+0800 I JOURNAL? [journal writer] Journal writer thread stopped
2015-10-28T10:09:21.615+0800 I JOURNAL? [durability] Durability thread stopped
2015-10-28T10:09:21.615+0800 I STORAGE? [signalProcessingThread] shutdown: closing all files...
2015-10-28T10:09:21.618+0800 I STORAGE? [signalProcessingThread] closeAllFiles() finished
2015-10-28T10:09:21.618+0800 I STORAGE? [signalProcessingThread] shutdown: removing fs lock...
2015-10-28T10:09:21.618+0800 I CONTROL? [signalProcessingThread] dbexit:? rc: 0
###修复启动过程中的两个警告,关于使用root用户启动mongo的警告先忽略
# echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
# echo "never" > /sys/kernel/mm/transparent_hugepage/defrag
###再次重启,后置于后台进程,
# mongod --dbpath /data/mongodata &
###查看启动后的进程
# ps -ef|grep mongo |grep -v grep
root? ? 11115 27956? 0 10:11 pts/2? ? 00:00:00 mongod --dbpath /data/mongodata
# lsof -i:27017
COMMAND? PID USER? FD? TYPE? DEVICE SIZE/OFF NODE NAME
mongod? 11115 root? ? 5u? IPv4 50567119? ? ? 0t0? TCP *:27017 (LISTEN)
###使用mongo连接到mongod
# mongo
MongoDB shell version: 3.0.6
connecting to: test
2015-10-28T10:14:30.685+0800 I NETWORK? [initandlisten] connection accepted from 127.0.0.1:53907 #1 (1 connection now open)
Server has startup warnings:
2015-10-28T10:11:49.217+0800 I CONTROL? [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2015-10-28T10:11:49.217+0800 I CONTROL? [initandlisten]
> help
? ? ? ? db.help()? ? ? ? ? ? ? ? ? ? help on db methods
? ? ? ? db.mycoll.help()? ? ? ? ? ? help on collection methods
? ? ? ? sh.help()? ? ? ? ? ? ? ? ? ? sharding helpers
? ? ? ? rs.help()? ? ? ? ? ? ? ? ? ? replica set helpers
? ? ? ? help admin? ? ? ? ? ? ? ? ? administrative help
? ? ? ? help connect? ? ? ? ? ? ? ? connecting to a db help
? ? ? ? help keys? ? ? ? ? ? ? ? ? ? key shortcuts
? ? ? ? help misc? ? ? ? ? ? ? ? ? ? misc things to know
? ? ? ? help mr? ? ? ? ? ? ? ? ? ? ? mapreduce
? ? ? ? show dbs? ? ? ? ? ? ? ? ? ? show database names
? ? ? ? show collections? ? ? ? ?