查询mongodb启动
时间: 2023-11-25 10:46:41 浏览: 126
C# mongodb框架启动工具
在命令行中输入以下命令即可查询mongodb是否启动:
```
sudo systemctl status mongodb
```
如果mongodb已经启动,你会看到类似以下的输出:
```
● mongodb.service - High-performance, schema-free document-oriented database
Loaded: loaded (/etc/systemd/system/mongodb.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2021-08-10 14:22:22 UTC; 1 weeks 0 days ago
Docs: https://docs.mongodb.org/manual
Main PID: 1234 (mongod)
Tasks: 23 (limit: 4915)
Memory: 69.6M
CGroup: /system.slice/mongodb.service
└─1234 /usr/bin/mongod --quiet --config /etc/mongod.conf
```
如果mongodb没有启动,你会看到类似以下的输出:
```
● mongodb.service - High-performance, schema-free document-oriented database
Loaded: loaded (/etc/systemd/system/mongodb.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Tue 2021-08-10 14:22:22 UTC; 1 weeks 0 days ago
Docs: https://docs.mongodb.org/manual
Process: 1234 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (code=exited, status=0/SUCCESS)
Main PID: 1234 (code=exited, status=0/SUCCESS)
```
阅读全文