elasticsearch - 有没有办法更改elasticsearch 7的/etc/default/elasticsearch文件?

标签 elasticsearch

在Elasticsearch 7的文档中,它明确表示

For the package distributions, the config directory location defaults to /etc/elasticsearch . The location of the config directory can also be changed via the ES_PATH_CONF environment variable, but note that setting this in your shell is not sufficient. Instead, this variable is sourced from /etc/default/elasticsearch (for the Debian package) and /etc/sysconfig/elasticsearch (for the RPM package). You will need to edit the ES_PATH_CONF=/etc/elasticsearch entry in one of these files accordingly to change the config directory location.



有没有办法为软件包分发安装的其他/etc/default/elasticsearch文件指定我自己的路径?我已经尝试通过在我的systemd服务文件中添加以下内容来尝试该文件,该文件使用我想要的EnvironmentFile,但是在服务启动时仍使用/etc/default/elasticsearch
[Service]
...
EnvironmentFile=-/etc/default/elasticsearch-development

最佳答案

对此的答案(至少对于7.7.0版而言)是,由于没有提供任何选项或环境变量,因此无法无缝地执行此操作。但是,可以编辑软件包安装随附的/usr/share/elasticsearch/elasticsearch-env文件,并用以下内容替换第81行:

if [ ! -z "$ES_DEFAULT" ]; then
  source $ES_DEFAULT
else
  source /etc/default/elasticsearch
fi

然后可以在系统服务文件中将ES_DEFAULT设置为指向其他/etc/default文件。
[Service]
...
Environment=ES_DEFAULT=/etc/default/elasticsearch-development

关于elasticsearch - 有没有办法更改elasticsearch 7的/etc/default/elasticsearch文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62307901/

相关文章:

jdbc - ElasticSearch JDBC River创建重复项

elasticsearch - 带有边界框GeoLocation的 Elasticsearch 渗透在Lucene中引发NullPointerException

elasticsearch - 另存为字符串instanceof float,如何查询所有错误的文档

Elasticsearch 向下搜索 - SearchPhaseExecutionException

elasticsearch - 查询Kibana日志,其中消息包含子字符串

elasticsearch - 无痛脚本,以嵌套结构检索最新日期

elasticsearch - elasticsearch:重新启动单个节点集群时,所有主分片均变为非事件状态

python - 带分组依据的 Django haystack 自定义查询

curl - 如何使用curl为平面文件测试elasticsearch?

elasticsearch - 标准分词器在哪些字符上定界?