linux - 一旦在 Linux 服务器上崩溃,如何自动重启 elasticsearch 搜索?
问题描述
一旦我的弹性搜索在 linux 服务器上崩溃。它给了我以下错误:
Elasticsearch\Common\Exceptions\NoNodesAvailableException:/var/www/laravel/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php:51 No alive nodes found in your cluster
太解决这个我需要重置完整的服务器。
我想要解决方案,因为我的弹性搜索服务会在崩溃时自动重启。
我的服务器配置:
Linux name 3.10.0-514.21.1.el7.x86_64 #1 SMP Thu May 25 17:04:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
如何在崩溃时自动重启我的弹性搜索的服务器上设置一些东西。?
解决方案
崩溃或宕机后自动重启 elasticsearch 服务的步骤:
1)使用以下命令编辑elasticsearch服务单元文件
sudo systemctl edit elasticsearch.service
该命令将创建一个文件
/etc/systemd/system/elasticsearch.service.d/override.conf
2) 现在,在单元文件中添加以下行。
[Service]
Restart=always
3) 保存文件。
ctrl+x > Y > Enter
4) 使用命令刷新单元文件
sudo systemctl daemon-reload
5)可以使用命令检查更改
sudo systemctl cat elasticsearch.service
推荐阅读
- c# - 当尝试“提交所有并同步”时,会弹出一个错误:“Git failed with a fatal error。”
- apache-kafka - Kakfa broker v2.1.0 在 LeaderEpochCache 截断后进入卡住状态
- dax - 从现有日期列创建一个日期列作为一天减去现有日期列
- c# - UseOpenIdConnectAuthentication 的 CORS 问题
- python-3.x - Uncaught ReferenceError: False 未在 python django 模板中定义
- java - 使用默认设置时使用哪个 Spring Cloud Zuul 超时属性?
- python - 将两个变量分配给同一列表中的项目是访问这些项目并对其执行操作的最佳方式吗?
- kubernetes - 用户如何在不访问 Rancher GUI 的情况下获取其 kubeconfig
- vb.net - 在 type="date" 的 TextBox 中显示日期
- javascript - 如何在本机反应中将状态从兄弟姐妹发送或传递给兄弟姐妹?