Jan 27 11:20:08 VM-48-8-tencentos systemd[1]: Starting mongodb.service - mongodb-server... Jan 27 11:20:08 VM-48-8-tencentos mongod[50562]: {"t":{"$date":"2026-01-27T11:20:08.666+08:00"},"s":"I", "c":"-", "id":8991200, "ctx":"main","msg":"Shuffling initializers","a> Jan 27 11:20:08 VM-48-8-tencentos mongod[50562]: about to fork child process, waiting until server is ready for connections. Jan 27 11:20:08 VM-48-8-tencentos mongod[50564]: forked process: 50564 Jan 27 11:20:08 VM-48-8-tencentos mongod[50562]: child process started successfully, parent exiting Jan 27 11:20:08 VM-48-8-tencentos systemd[1]: Started mongodb.service - mongodb-server.
[root@lpc data]# mongosh Current Mongosh Log ID: 697830999368bd4d49ed1101 Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.6.0 Using MongoDB: 8.2.3 Using Mongosh: 2.6.0
For mongosh info see: https://www.mongodb.com/docs/mongodb-shell/
------ The server generated these startup warnings when booting 2026-01-27T11:20:08.785+08:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted 2026-01-27T11:20:08.785+08:00: You are running this process as the root user, which is not recommended 2026-01-27T11:20:08.785+08:00: Soft rlimits for open file descriptors too low 2026-01-27T11:20:08.785+08:00: For customers running the current memory allocator, we suggest changing the contents of the following sysfsFile 2026-01-27T11:20:08.785+08:00: For customers running the current memory allocator, we suggest changing the contents of the following sysfsFile 2026-01-27T11:20:08.785+08:00: We suggest setting the contents of sysfsFile to 0. 2026-01-27T11:20:08.785+08:00: Your system has glibc support for rseq built in, which is not yet supported by tcmalloc-google and has critical performance implications. Please set the environment variable GLIBC_TUNABLES=glibc.pthread.rseq=0 ------
test> db.version() 8.2.3
创建一个 root 用户:
1 2 3 4 5
test> use admin switched to db admin admin> db.createUser({user:"root", pwd:"**********", roles:[{role:"dbAdminAnyDatabase", db:"admin"}]}) { ok: 1 } admin> exit