aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes
diff options
context:
space:
mode:
authorAvi Ziv <avi.ziv@amdocs.com>2018-03-15 13:21:44 +0200
committerMichael Lando <ml636r@att.com>2018-04-24 07:50:44 +0000
commitc175a0de2f05d37c1c774684318a525eb96bb59b (patch)
tree0c8bd736fdbcb512fefce93ec841fd3537336206 /catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes
parent08d85958f46d1de9aec9cf459632b5be040063be (diff)
Create on boarding docker
Add BE and Cassandra init docker images Change-Id: Id9d767c73fc946819cec821b4634ce650cbb22fd Issue-ID: SDC-781 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes')
-rw-r--r--catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb
index c04b11b815..3bad06f6fb 100644
--- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb
@@ -1,4 +1,13 @@
-replication_factor=1
+# Set the cassandra replica number
+cassandra_nodes = node['Nodes']['CS']
+if cassandra_nodes.length <=2
+ replication_factor=1
+elsif cassandra_nodes.length >2 && cassandra_nodes.length <=4
+ replication_factor=3
+else
+ replication_factor=4
+end
+
template "titan.properties" do
path "#{ENV['JETTY_BASE']}/config/catalog-be/titan.properties"
@@ -30,7 +39,7 @@ template "catalog-be-config" do
:catalog_port => node['BE'][:http_port],
:ssl_port => node['BE'][:https_port],
:cassandra_ip => node['Nodes']['CS'],
- :rep_factor => 1,
+ :rep_factor => replication_factor,
:DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment,
:titan_Path => "/var/lib/jetty/config/catalog-be/",
:socket_connect_timeout => node['cassandra']['socket_connect_timeout'],