[root@ip-10-157-172-54 ~]# systemctl start mongod
|
[root@ip-10-157-172-54 ~]# systemctl status mongod
|
● mongod.service - High-performance, schema-free document-oriented database
|
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
|
Active: active (running) since Wed 2018-01-10 20:20:10 UTC; 10min ago
|
Docs: https://docs.mongodb.org/manual
|
Process: 11990 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS)
|
Process: 11987 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
|
Process: 11984 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
|
Process: 11981 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)
|
Main PID: 11992 (mongod)
|
CGroup: /system.slice/mongod.service
|
└─11992 /usr/bin/mongod -f /etc/mongod.conf
|
|
Jan 10 20:20:00 ip-10-157-172-54.ec2.internal systemd[1]: Starting High-performance, schema-free document-oriented database...
|
Jan 10 20:20:00 ip-10-157-172-54.ec2.internal mongod[11990]: about to fork child process, waiting until server is ready for connections.
|
Jan 10 20:20:00 ip-10-157-172-54.ec2.internal mongod[11990]: forked process: 11992
|
Jan 10 20:20:10 ip-10-157-172-54.ec2.internal mongod[11990]: child process started successfully, parent exiting
|
Jan 10 20:20:10 ip-10-157-172-54.ec2.internal systemd[1]: Started High-performance, schema-free document-oriented database.
|
[root@ip-10-157-172-54 ~]# mongo --eval 'db.getSiblingDB("admin").shutdownServer()'
|
MongoDB shell version v3.6.2
|
connecting to: mongodb://127.0.0.1:27017
|
MongoDB server version: 3.6.2
|
server should be down...
|
[root@ip-10-157-172-54 ~]# systemctl status mongod
|
● mongod.service - High-performance, schema-free document-oriented database
|
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
|
Active: inactive (dead) since Wed 2018-01-10 20:31:16 UTC; 4s ago
|
Docs: https://docs.mongodb.org/manual
|
Process: 11990 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS)
|
Process: 11987 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
|
Process: 11984 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
|
Process: 11981 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)
|
Main PID: 11992 (code=exited, status=0/SUCCESS)
|
|
Jan 10 20:20:00 ip-10-157-172-54.ec2.internal systemd[1]: Starting High-performance, schema-free document-oriented database...
|
Jan 10 20:20:00 ip-10-157-172-54.ec2.internal mongod[11990]: about to fork child process, waiting until server is ready for connections.
|
Jan 10 20:20:00 ip-10-157-172-54.ec2.internal mongod[11990]: forked process: 11992
|
Jan 10 20:20:10 ip-10-157-172-54.ec2.internal mongod[11990]: child process started successfully, parent exiting
|
Jan 10 20:20:10 ip-10-157-172-54.ec2.internal systemd[1]: Started High-performance, schema-free document-oriented database.
|
[root@ip-10-157-172-54 ~]# ls /var/run/mongodb/
|
[root@ip-10-157-172-54 ~]# systemctl start mongod
|
[root@ip-10-157-172-54 ~]# ps -ef | grep mongo
|
mongod 12074 1 5 20:31 ? 00:00:00 /usr/bin/mongod -f /etc/mongod.conf
|
root 12102 11560 0 20:31 pts/0 00:00:00 grep --color=auto mongo
|
[root@ip-10-157-172-54 ~]# mongo
|
MongoDB shell version v3.6.2
|
connecting to: mongodb://127.0.0.1:27017
|
MongoDB server version: 3.6.2
|
Server has startup warnings:
|
2018-01-10T20:31:41.189+0000 I STORAGE [initandlisten]
|
2018-01-10T20:31:41.189+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
|
2018-01-10T20:31:41.189+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
|
2018-01-10T20:31:45.903+0000 I CONTROL [initandlisten]
|
2018-01-10T20:31:45.903+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
|
2018-01-10T20:31:45.903+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
|
2018-01-10T20:31:45.903+0000 I CONTROL [initandlisten]
|
2018-01-10T20:31:45.903+0000 I CONTROL [initandlisten]
|
2018-01-10T20:31:45.903+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
|
2018-01-10T20:31:45.903+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
|
2018-01-10T20:31:45.903+0000 I CONTROL [initandlisten]
|
2018-01-10T20:31:45.903+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
|
2018-01-10T20:31:45.903+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
|
2018-01-10T20:31:45.903+0000 I CONTROL [initandlisten]
|
> show dbs
|
admin 0.000GB
|
config 0.000GB
|
local 0.000GB
|
>
|
bye
|