possibility of switching to generic ES-cluster if exist
when SL service defined, default OSS-ElasticSearch cluster turned off
and switched to SL Elasticsearch to avoid duplicating
related us: https://mirantis.jira.com/browse/PROD-14954
Change-Id: I32f2d982179a0f661f23edaaf672f035a16f0160
diff --git a/docker/swarm/stack/pushkin.yml b/docker/swarm/stack/pushkin.yml
index 892b4f9..3df931b 100644
--- a/docker/swarm/stack/pushkin.yml
+++ b/docker/swarm/stack/pushkin.yml
@@ -4,6 +4,7 @@
docker_image_pushkin: docker-prod-local.artifactory.mirantis.com/mirantis/oss/pushkin
pushkin_bind_host: pushkin-api
pushkin_bind_port: ${_param:haproxy_pushkin_bind_port}
+ pushkin_elasticsearch: ${_param:elasticsearch_bind_host}
pushkin_ssl:
enabled: false
pushkin_db: pushkin
@@ -24,7 +25,7 @@
POSTGRES_PASSWORD: ${_param:pushkin_db_user_password}
POSTGRES_DB: ${_param:pushkin_db}
PUSHKINDBHOST: ${_param:postgresql_bind_host}
- PUSHKINELASTICHOST: ${_param:elasticsearch_bind_host}
+ PUSHKINELASTICHOST: ${_param:pushkin_elasticsearch}
WEBHOOK_FROM: ${_param:webhook_from}
EMAIL_SENDER_PASSWORD: ${_param:pushkin_email_sender_password}
SMTP_HOST: ${_param:pushkin_smtp_host}
diff --git a/elasticsearch/client/init.yml b/elasticsearch/client/init.yml
index d0710ca..061cd6e 100644
--- a/elasticsearch/client/init.yml
+++ b/elasticsearch/client/init.yml
@@ -7,4 +7,4 @@
enabled: true
server:
host: ${_param:elasticsearch_client_host}
- port: ${_param:elasticsearch_client_port}
\ No newline at end of file
+ port: ${_param:elasticsearch_client_port}
diff --git a/elasticsearch/client/single.yml b/elasticsearch/client/single.yml
index d9ce432..c4e2b43 100644
--- a/elasticsearch/client/single.yml
+++ b/elasticsearch/client/single.yml
@@ -6,3 +6,4 @@
enabled: true
server:
host: ${_param:stacklight_log_address}
+ port: ${_param:haproxy_elasticsearch_http_bind_port}
diff --git a/elasticsearch/server/cluster.yml b/elasticsearch/server/cluster.yml
index 8f53f21..9be44ed 100644
--- a/elasticsearch/server/cluster.yml
+++ b/elasticsearch/server/cluster.yml
@@ -5,6 +5,7 @@
_param:
java_environment_version: "8"
java_environment_platform: openjdk
+ elasticsearch_cluster_name: elasticsearch
linux:
system:
sysctl:
@@ -15,6 +16,7 @@
headless: true
elasticsearch:
server:
+ name: ${_param:elasticsearch_cluster_name}
enabled: true
master: true
data: true
diff --git a/haproxy/proxy/listen/oss/elasticsearch.yml b/haproxy/proxy/listen/oss/elasticsearch.yml
index 3a4c98e..b3b7e64 100644
--- a/haproxy/proxy/listen/oss/elasticsearch.yml
+++ b/haproxy/proxy/listen/oss/elasticsearch.yml
@@ -60,4 +60,4 @@
- name: ${_param:cluster_node03_name}
host: ${_param:cluster_node03_address}
port: ${_param:haproxy_elasticsearch_binary_exposed_port}
- params: backup check
\ No newline at end of file
+ params: backup check
diff --git a/haproxy/proxy/listen/stacklight/elasticsearch.yml b/haproxy/proxy/listen/stacklight/elasticsearch.yml
index 531d647..582de6a 100644
--- a/haproxy/proxy/listen/stacklight/elasticsearch.yml
+++ b/haproxy/proxy/listen/stacklight/elasticsearch.yml
@@ -1,4 +1,10 @@
parameters:
+ _param:
+ haproxy_elasticsearch_bind_host: ${_param:cluster_vip_address}
+ haproxy_elasticsearch_http_bind_port: 9200
+ haproxy_elasticsearch_http_exposed_port: 9200
+ haproxy_elasticsearch_binary_bind_port: 9300
+ haproxy_elasticsearch_binary_exposed_port: 9300
haproxy:
proxy:
listen:
@@ -11,18 +17,40 @@
- dontlog-normal
balance: roundrobin
binds:
- - address: ${_param:cluster_vip_address}
- port: 9200
+ - address: ${_param:haproxy_elasticsearch_bind_host}
+ port: ${_param:haproxy_elasticsearch_http_bind_port}
servers:
- name: ${_param:cluster_node01_hostname}
host: ${_param:cluster_node01_address}
- port: 9200
+ port: ${_param:haproxy_elasticsearch_http_exposed_port}
params: 'check inter 10s fastinter 2s downinter 3s rise 3 fall 3'
- name: ${_param:cluster_node02_hostname}
host: ${_param:cluster_node02_address}
- port: 9200
+ port: ${_param:haproxy_elasticsearch_http_exposed_port}
params: 'check inter 10s fastinter 2s downinter 3s rise 3 fall 3'
- name: ${_param:cluster_node03_hostname}
host: ${_param:cluster_node03_address}
- port: 9200
+ port: ${_param:haproxy_elasticsearch_http_exposed_port}
params: 'check inter 10s fastinter 2s downinter 3s rise 3 fall 3'
+ elasticsearch_binary:
+ mode: tcp
+ options:
+ - tcpka
+ - tcplog
+ balance: source
+ binds:
+ - address: ${_param:cluster_vip_address}
+ port: ${_param:haproxy_elasticsearch_binary_bind_port}
+ servers:
+ - name: ${_param:cluster_node01_hostname}
+ host: ${_param:cluster_node01_address}
+ port: ${_param:haproxy_elasticsearch_binary_exposed_port}
+ params: 'check'
+ - name: ${_param:cluster_node02_hostname}
+ host: ${_param:cluster_node02_address}
+ port: ${_param:haproxy_elasticsearch_binary_exposed_port}
+ params: 'check'
+ - name: ${_param:cluster_node03_hostname}
+ host: ${_param:cluster_node03_address}
+ port: ${_param:haproxy_elasticsearch_binary_exposed_port}
+ params: 'check'