aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/sdc-elasticsearch/chef-repo
diff options
context:
space:
mode:
authorAreli, Fuss (af732p) <af732p@intl.att.com>2018-04-24 13:59:00 +0300
committerAreli, Fuss (af732p) <af732p@att.com>2018-04-24 14:59:09 +0300
commitc033cdce906efc3b6ccd1d2f45544af47e328ed4 (patch)
tree40c4657a73d9a52f5f2784cff9a3dcb1833467ce /sdc-os-chef/sdc-elasticsearch/chef-repo
parentc175a0de2f05d37c1c774684318a525eb96bb59b (diff)
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) <af732p@intl.att.com>
Diffstat (limited to 'sdc-os-chef/sdc-elasticsearch/chef-repo')
-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 %>