aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/sdc-backend
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/sdc-backend')
-rw-r--r--catalog-be/sdc-backend/Dockerfile4
-rw-r--r--catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb13
-rw-r--r--catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb7
-rw-r--r--catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb2
4 files changed, 15 insertions, 11 deletions
diff --git a/catalog-be/sdc-backend/Dockerfile b/catalog-be/sdc-backend/Dockerfile
index 20a4624a49..ed54c8a443 100644
--- a/catalog-be/sdc-backend/Dockerfile
+++ b/catalog-be/sdc-backend/Dockerfile
@@ -4,12 +4,8 @@ COPY chef-solo /root/chef-solo/
COPY chef-repo/cookbooks/. /root/chef-solo/cookbooks/
-ADD onboarding-be-*.war ${JETTY_BASE}/webapps/
-
ADD catalog-be-*.war ${JETTY_BASE}/webapps/
-ADD api-docs.war ${JETTY_BASE}/webapps/
-
USER root
RUN chown -R jetty:jetty ${JETTY_BASE}/webapps
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'],
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
index a35896afe6..a390a80441 100644
--- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
@@ -553,14 +553,13 @@ heatEnvArtifactHeader: ""
heatEnvArtifactFooter: ""
onboarding:
+ host: <%= node['ONBOARDING_BE_VIP'] %>
<% if node[:disableHttp] -%>
protocol: https
- host: <%= @catalog_ip %>
- port: <%= node['BE'][:https_port] %>
+ port: <%= node['ONBOARDING_BE'][:https_port] %>
<% else %>
protocol: http
- host: <%= @catalog_ip %>
- port: <%= node['BE'][:http_port] %>
+ port: <%= node['ONBOARDING_BE'][:http_port] %>
<% end -%>
downloadCsarUri: "/onboarding-api/v1.0/vendor-software-products/packages"
healthCheckUri: "/onboarding-api/v1.0/healthcheck"
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb
index 84d1c6f08f..9da843152c 100644
--- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb
@@ -2,7 +2,7 @@
health_Check_http_code=$(curl --max-time 5 -o /dev/null -w '%{http_code}' http://127.0.0.1:8080/sdc2/rest/healthCheck)
if [[ "$health_Check_http_code" -eq 200 ]]; then
- exit 200
+ exit 0
else
exit $health_Check_http_code
fi