linux查看es是否启动
时间: 2023-09-29 12:05:51 浏览: 83
可以通过以下命令来检查 Elasticsearch 是否正在运行:
```
systemctl status elasticsearch.service
```
如果 Elasticsearch 已经启动,则会看到类似以下内容的输出:
```
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2021-10-12 14:53:44 CST; 2 days ago
Docs: http://www.elastic.co
Main PID: 12345 (java)
Tasks: 124 (limit: 4915)
Memory: 2.0G
CGroup: /system.slice/elasticsearch.service
├─12345 /usr/share/elasticsearch/jdk/bin/java -Xms1g -Xmx1g...
└─67890 /usr/share/elasticsearch/modules/x-pack-ml/platform/...
```
如果 Elasticsearch 没有启动,则会看到类似以下内容的输出:
```
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Tue 2021-10-12 14:53:44 CST; 2 days ago
Docs: http://www.elastic.co
Process: 12345 ExecStart=/usr/share/elasticsearch/bin/systemd-entry...
Main PID: 12345 (code=exited, status=1/FAILURE)
```
阅读全文