Temporary fix for Elastic 7 cluster

This commit is contained in:
Jesús Ángel
2019-05-14 15:03:20 +02:00
parent 4adb9741e4
commit 5799998308
+6 -7
View File
@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Wazuh App Copyright (C) 2019 Wazuh Inc. (License GPLv2) # Wazuh Docker Copyright (C) 2019 Wazuh Inc. (License GPLv2)
elastic_config_file="/usr/share/elasticsearch/config/elasticsearch.yml" elastic_config_file="/usr/share/elasticsearch/config/elasticsearch.yml"
@@ -10,7 +10,7 @@ then
# Set the cluster.name and discovery.zen.minimun_master_nodes variables # Set the cluster.name and discovery.zen.minimun_master_nodes variables
sed -i 's:cluster.name\: "docker-cluster":cluster.name\: "'$CLUSTER_NAME'":g' $elastic_config_file sed -i 's:cluster.name\: "docker-cluster":cluster.name\: "'$CLUSTER_NAME'":g' $elastic_config_file
sed -i 's:discovery.zen.minimum_master_nodes\: 1:discovery.zen.minimum_master_nodes\: '$CLUSTER_NUMBER_OF_MASTERS':g' $elastic_config_file #sed -i 's:discovery.zen.minimum_master_nodes\: 1:discovery.zen.minimum_master_nodes\: '$CLUSTER_NUMBER_OF_MASTERS':g' $elastic_config_file
# Add the cluster configuration # Add the cluster configuration
echo " echo "
@@ -24,10 +24,9 @@ node:
bootstrap: bootstrap:
memory_lock: ${CLUSTER_MEMORY_LOCK} memory_lock: ${CLUSTER_MEMORY_LOCK}
discovery:
zen:
ping.unicast.hosts: ${CLUSTER_DISCOVERY_SERVICE}
" >> $elastic_config_file " >> $elastic_config_file
else
echo 'cluster.initial_master_nodes: ["elasticsearch"]' >> $elastic_config_file
fi fi