【发布时间】:2017-06-03 04:07:00
【问题描述】:
我当前的脚本如下所示:
es_conf = elasticsearch_configure 'elasticsearch' do
allocated_memory '512m'
configuration ({
'http.port' => port,
'cluster.name' => cluster_name,
'node.name' => node_name,
'bootstrap.memory_lock' => false,
'discovery.zen.minimum_master_nodes' => 1
})
end
es_conf.path_data data_location if data_location
elasticsearch_plugin 'repository-s3' do
action :install
end
elasticsearch_plugin 'x-pack' do
action :install
end
elasticsearch_configure 'elasticsearch' do
configuration ({
'http.port' => port,
'cluster.name' => cluster_name,
'node.name' => node_name,
'bootstrap.memory_lock' => false,
'discovery.zen.minimum_master_nodes' => 1,
'xpack.monitoring.enabled' => true,
'xpack.graph.enabled' => false,
'xpack.watcher.enabled' => true
})
end
它目前对我有用(我的意思是它可以根据需要配置弹性搜索)。不过,我知道这还不够好。我的意思是,我使用了两次elasticsearch_configure。问题是我首先需要配置elasticsearch,然后我需要安装x-pack,然后使用特定的x-pack值配置elasticsearch。
有什么想法可以让它更优雅一点吗?
没错,我的意思是我应该如何更改es_conf?
【问题讨论】:
-
你不能安装插件调用然后用所有设置调用
elasticsearch_configure吗?另外,与问题无关,为什么不使用包含配置哈希的属性?
标签: chef-infra