1,mongdb的启动 [root@localhost mongodb]# mkdir /db [root@localhost mongodb]# mkdir /logs [root@localhost mongodb]# [root@localhost mongodb]# [root@localhost mongodb]# [root@localhost mongodb]# ./bin/mongod --dbpath /db --logpath=/logs --fork --port 27017 about to fork child process, waiting until server is ready for connections. forked process: 51520 ERROR: child process failed, exited with error number 1 To see additional information in this output, start without the "--fork" option. [root@localhost mongodb]# cd /logs/ [root@localhost logs]# ll 总用量 0 [root@localhost logs]# [root@localhost logs]# [root@localhost logs]# cd /usr/local/mongodb/ [root@localhost mongodb]# ll 总用量 120 drwxr-xr-x. 2 root root 231 8月 12 11:49 bin -rw-r--r--. 1 root root 34520 8月 4 01:43 GNU-AGPL-3.0 -rw-r--r--. 1 root root 2149 8月 4 01:43 LICENSE-Community.txt -rw-r--r--. 1 root root 16726 8月 4 01:43 MPL-2 -rw-r--r--. 1 root root 2195 8月 4 01:43 README -rw-r--r--. 1 root root 57190 8月 4 01:43 THIRD-PARTY-NOTICES [root@localhost mongodb]# ./bin/mongod --dbpath /db --logpath=/logs/log.log --fork --port 27017 about to fork child process, waiting until server is ready for connections. forked process: 51555 child process started successfully, parent exiting [root@localhost mongodb]# [root@localhost bin]# [root@localhost bin]# ./mongo MongoDB shell version v4.0.1 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 4.0.1 Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see http://docs.mongodb.org/ Questions? Try the support group http://groups.google.com/group/mongodb-user Server has startup warnings: 2018-08-12T12:35:58.091+0800 I CONTROL [initandlisten] 2018-08-12T12:35:58.091+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2018-08-12T12:35:58.091+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2018-08-12T12:35:58.091+0800 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended. 2018-08-12T12:35:58.091+0800 I CONTROL [initandlisten] 2018-08-12T12:35:58.091+0800 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost. 2018-08-12T12:35:58.091+0800 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server. 2018-08-12T12:35:58.091+0800 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP 2018-08-12T12:35:58.091+0800 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to 2018-08-12T12:35:58.091+0800 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the 2018-08-12T12:35:58.091+0800 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning. 2018-08-12T12:35:58.091+0800 I CONTROL [initandlisten] 2018-08-12T12:35:58.092+0800 I CONTROL [initandlisten] 2018-08-12T12:35:58.092+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always‘. 2018-08-12T12:35:58.092+0800 I CONTROL [initandlisten] ** We suggest setting it to ‘never‘ 2018-08-12T12:35:58.092+0800 I CONTROL [initandlisten] 2018-08-12T12:35:58.092+0800 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always‘. 2018-08-12T12:35:58.092+0800 I CONTROL [initandlisten] ** We suggest setting it to ‘never‘ 2018-08-12T12:35:58.092+0800 I CONTROL [initandlisten] >