summaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/sdc-elasticsearch
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-os-chef/sdc-elasticsearch')
-rw-r--r--sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_1_setup_elasticsearch.rb10
-rw-r--r--sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ES-elasticsearch.yml.erb4
2 files changed, 11 insertions, 3 deletions
diff --git a/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_1_setup_elasticsearch.rb b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_1_setup_elasticsearch.rb
index 68c1154ec6..f32e736f53 100644
--- a/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_1_setup_elasticsearch.rb
+++ b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_1_setup_elasticsearch.rb
@@ -1,3 +1,10 @@
+elasticsearch_list = ''
+
+node['Nodes']['ES'].each do |item|
+ elasticsearch_list += "- " + item + ":9300\n"
+end
+
+
template "/usr/share/elasticsearch/config/elasticsearch.yml" do
source "ES-elasticsearch.yml.erb"
owner "elasticsearch"
@@ -6,7 +13,8 @@ template "/usr/share/elasticsearch/config/elasticsearch.yml" do
variables({
:cluster_name => node['elasticsearch'][:cluster_name]+node.chef_environment,
:node_name => node[:hostname],
- :ES_IP => node['Nodes']['ES'],
+ :es_ip_list => "#{elasticsearch_list}",
+ :es_ip_list_XXX => node['Nodes']['ES'],
:num_of_shards => node['elasticsearch'][:num_of_shards],
:num_of_replicas => node['elasticsearch'][:num_of_replicas]
})
diff --git a/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ES-elasticsearch.yml.erb b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ES-elasticsearch.yml.erb
index 613e6b046b..0a2057dca6 100644
--- a/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ES-elasticsearch.yml.erb
+++ b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ES-elasticsearch.yml.erb
@@ -1,14 +1,14 @@
network.host: 0.0.0.0
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.enabled: true
-#discovery.zen.ping.unicast.hosts: <%= @ES_IP %>
+#discovery.zen.ping.unicast.hosts: <%= @es_ip_list_XXXXX %>
cluster.name: <%= @cluster_name %>
node.name: <%= @node_name %>
elasticSearch.transportclient: true
transport.client.initial_nodes:
- - <%= @ES_IP %>:9300
+<%= @es_ip_list %>
index.number_of_shards: <%= @num_of_shards %>
index.number_of_replicas: <%= @num_of_replicas %>