所以我试图设置模板,而弹性search不可用于networking的其余部分,然后以可用于networking其余部分的模式重新启动elasticsearch。 当弹性search重新启动时,模板消失,失败的目的。 这里发生了什么?
我这样做的原因是因为我想确保Elasticsearch中的所有内容都设置为1个分片和0个副本。 如果我不限制对Elasticsearch的networking访问,Filebeat和Kibana将不断尝试联系Elasticsearch,有时会跳入并在我的模板应用之前创build一个不是1个碎片和0个副本的索引。 所以这是我现在的解决scheme。 如果有人有任何想法,我很乐意听到他们。 使用iptables不是一个选项。
Elasticsearch 2.3.3 – 升级目前不是一个选项。 在Docker上运行CentOS 6。
Bash脚本,一切:
set -m su -c "/opt/elasticsearch/bin/elasticsearch -Des.default.path.home=/opt/elasticsearch \ -Des.default.path.logs=/opt/elasticsearch/logs \ -Des.default.path.data=/opt/elasticsearch/data \ -Des.default.path.work=/opt/elasticsearch/tmp \ -Des.discovery.zen.ping.multicast.enabled=false \ -Des.threadpool.bulk.queue_size=500 \ -Des.node.name=localNode \ -Des.network.host=_local_" elasticsearch & curl -XPUT 'http://elasticsearch:9200/_template/global_1' -H 'Content-Type: application/json' -d' { "template": "*", "order": 9, "settings": { "number_of_shards": 1, "number_of_replicas": 0 } } ' curl -XPUT 'http://elasticsearch:9200/_template/kibana_1' -H 'Content-Type: application/json' -d' { "template": ".kibana", "order": 10, "settings": { "number_of_shards": 1, "number_of_replicas": 0 } } ' kill $! echo "Elasticsearch Init Complete - switching Elasticsearch to foreground and opening up to the world" su -c "/opt/elasticsearch/bin/elasticsearch -Des.default.path.home=/opt/elasticsearch \ -Des.default.path.logs=/opt/elasticsearch/logs \ -Des.default.path.data=/opt/elasticsearch/data \ -Des.default.path.work=/opt/elasticsearch/tmp \ -Des.discovery.zen.ping.multicast.enabled=false \ -Des.threadpool.bulk.queue_size=500 \ -Des.node.name=localNode \ -Des.network.host=_local_,_site_" elasti
交叉张贴在弹性论坛