[root@localhost bin]# mongo
MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.9
Server has startup warnings:
2019-12-19T08:52:54.033+0800 I STORAGE [initandlisten]
2019-12-19T08:52:54.033+0800 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-12-19T08:52:54.033+0800 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2019-12-19T08:52:55.132+0800 I CONTROL [initandlisten]
2019-12-19T08:52:55.132+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-12-19T08:52:55.132+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2019-12-19T08:52:55.132+0800 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2019-12-19T08:52:55.132+0800 I CONTROL [initandlisten]
2019-12-19T08:52:55.132+0800 I CONTROL [initandlisten]
2019-12-19T08:52:55.132+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2019-12-19T08:52:55.132+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2019-12-19T08:52:55.132+0800 I CONTROL [initandlisten]
2019-12-19T08:52:55.132+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2019-12-19T08:52:55.132+0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2019-12-19T08:52:55.132+0800 I CONTROL [initandlisten]
> use adminuse admin
switched to db admin
> db.shutdownServer();db.shutdownServer();
server should be down...
2019-12-19T08:54:16.182+0800 I NETWORK [thread1] trying reconnect to 127.0.0.1:27017 (127.0.0.1) failed
2019-12-19T08:54:16.182+0800 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2019-12-19T08:54:16.182+0800 I NETWORK [thread1] reconnect 127.0.0.1:27017 (127.0.0.1) failed failed
> exitexit
bye
[root@localhost bin]# ps aux | grep mongo
root 23417 0.0 0.0 103256 864 pts/2 S+ 08:54 0:00 grep mongo
[root@localhost bin]#
正常起库:(进bin目录——启动——查进程)
[root@localhost bin]# pwd
/opt/soap/mongodb-linux-x86_64-rhel62-3.4.9/bin
[root@localhost bin]# ./mongod -f mongodb.conf &
[1] 23525
[root@localhost bin]# about to fork child process, waiting until server is ready for connections.
forked process: 23527
child process started successfully, parent exiting
[1]+ Done ./mongod -f mongodb.conf
[root@localhost bin]# ps aux | grep mongo
root 23527 7.1 0.0 1022744 51024 ? Sl 09:01 0:01 ./mongod -f mongodb.conf
root 23556 0.0 0.0 103256 868 pts/2 S+ 09:01 0:00 grep mongo
[root@localhost bin]#