From c033cdce906efc3b6ccd1d2f45544af47e328ed4 Mon Sep 17 00:00:00 2001 From: "Areli, Fuss (af732p)" Date: Tue, 24 Apr 2018 13:59:00 +0300 Subject: Add cluster resiliance support Add configuration support for CS/ES cluster and add truststore default files to support ssl connection Change-Id: Icc2831704e8a3c55ce9b380a39001891ce8d41ab Issue-ID: SDC-1254 Signed-off-by: Areli, Fuss (af732p) --- .../sdc-elasticsearch/recipes/ES_1_setup_elasticsearch.rb | 10 +++++++++- .../templates/default/ES-elasticsearch.yml.erb | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'sdc-os-chef/sdc-elasticsearch/chef-repo') 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 %> -- cgit 1.2.3-korg