我正在docker容器中运行elasticsearch.
在为ssl和shield配置elasticsearch时,我的elasticsearch.yml
文件被非法输入,TAB
而不是a space
.
现在我的docker容器没有启动并出现以下错误:
{1.4.4}: Setup Failed ... - SettingsException[Failed to load settings from [file:/elasticsearch/config/elasticsearch.yml]] IOException[Tabs are illegal in YAML. Did you mean to use whitespace character instead?] org.elasticsearch.common.settings.SettingsException: Failed to load settings from [file:/elasticsearch/config/elasticsearch.yml] at org.elasticsearch.common.settings.ImmutableSettings$Builder.loadFromStream(ImmutableSettings.java:947) at org.elasticsearch.common.settings.ImmutableSettings$Builder.loadFromUrl(ImmutableSettings.java:931) at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareSettings(InternalSettingsPreparer.java:77) at org.elasticsearch.bootstrap.Bootstrap.initialSettings(Bootstrap.java:106) at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:177) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32) Caused by: java.io.IOException: Tabs are illegal in YAML. Did you mean to use whitespace character instead? at org.elasticsearch.common.settings.loader.YamlSettingsLoader.load(YamlSettingsLoader.java:44) at org.elasticsearch.common.settings.ImmutableSettings$Builder.loadFromStream(ImmutableSettings.java:944) ... 5 more
如何elasticsearch.yml
在不丢失数据或替换elasticsearch.yml
现有容器中的文件的情况下编辑或替换它?
您可以将文件复制出来,然后将其复制回容器(即使容器已停止)docker cp $cont_name:/path/in/container /path/on/host
,然后复制出来然后复制出来docker cp /path/on/host $cont_name:/path/in/container
.