mirror of
https://github.com/wazuh/wazuh-docker.git
synced 2025-10-23 04:51:57 +00:00
Added more fixes to configuration files
This commit is contained in:
@@ -12,22 +12,33 @@ services:
|
|||||||
- "514:514/udp"
|
- "514:514/udp"
|
||||||
- "55000:55000"
|
- "55000:55000"
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
image: wazuh/wazuh-elasticsearch:3.9.2_7.1.1
|
build: elasticsearch
|
||||||
hostname: elasticsearch
|
hostname: elasticsearch
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "9200:9200"
|
- "9200:9200"
|
||||||
environment:
|
environment:
|
||||||
- node.name=node-1
|
|
||||||
- cluster.name=wazuh
|
|
||||||
- network.host=0.0.0.0
|
|
||||||
- bootstrap.memory_lock=true
|
|
||||||
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
|
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
|
||||||
|
- ELASTIC_CLUSTER=true
|
||||||
|
- CLUSTER_NODE_MASTER=true
|
||||||
|
- CLUSTER_MASTER_NODE_NAME=es01
|
||||||
|
|
||||||
|
es02:
|
||||||
|
build: elasticsearch
|
||||||
|
hostname: es02
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
|
||||||
|
- ELASTIC_CLUSTER=true
|
||||||
|
- CLUSTER_MASTER_NODE_NAME=elasticsearch
|
||||||
|
- CLUSTER_NODE_NAME=es02
|
||||||
ulimits:
|
ulimits:
|
||||||
memlock:
|
memlock:
|
||||||
soft: -1
|
soft: -1
|
||||||
hard: -1
|
hard: -1
|
||||||
mem_limit: 2g
|
mem_limit: 2g
|
||||||
|
|
||||||
|
|
||||||
kibana:
|
kibana:
|
||||||
image: wazuh/wazuh-kibana:3.9.2_7.1.1
|
image: wazuh/wazuh-kibana:3.9.2_7.1.1
|
||||||
hostname: kibana
|
hostname: kibana
|
||||||
|
@@ -22,10 +22,11 @@ ARG TEMPLATE_VERSION=v3.9.2
|
|||||||
# CLUSTER_INITIAL_MASTER_NODES set to own node by default.
|
# CLUSTER_INITIAL_MASTER_NODES set to own node by default.
|
||||||
ENV ELASTIC_CLUSTER="false" \
|
ENV ELASTIC_CLUSTER="false" \
|
||||||
CLUSTER_NAME="wazuh" \
|
CLUSTER_NAME="wazuh" \
|
||||||
CLUSTER_NODE_MASTER="true" \
|
CLUSTER_NODE_MASTER="false" \
|
||||||
CLUSTER_NODE_DATA="true" \
|
CLUSTER_NODE_DATA="true" \
|
||||||
CLUSTER_NODE_INGEST="true" \
|
CLUSTER_NODE_INGEST="true" \
|
||||||
CLUSTER_NODE_NAME="wazuh-elasticsearch" \
|
CLUSTER_NODE_NAME="wazuh-elasticsearch" \
|
||||||
|
CLUSTER_MASTER_NODE_NAME="master-node" \
|
||||||
CLUSTER_MEMORY_LOCK="true" \
|
CLUSTER_MEMORY_LOCK="true" \
|
||||||
CLUSTER_DISCOVERY_SERVICE="wazuh-elasticsearch" \
|
CLUSTER_DISCOVERY_SERVICE="wazuh-elasticsearch" \
|
||||||
CLUSTER_NUMBER_OF_MASTERS="2" \
|
CLUSTER_NUMBER_OF_MASTERS="2" \
|
||||||
@@ -33,8 +34,6 @@ ENV ELASTIC_CLUSTER="false" \
|
|||||||
CLUSTER_DELAYED_TIMEOUT="1m" \
|
CLUSTER_DELAYED_TIMEOUT="1m" \
|
||||||
CLUSTER_INITIAL_MASTER_NODES="wazuh-elasticsearch"
|
CLUSTER_INITIAL_MASTER_NODES="wazuh-elasticsearch"
|
||||||
|
|
||||||
ADD https://raw.githubusercontent.com/wazuh/wazuh/$TEMPLATE_VERSION/extensions/elasticsearch/7.x/wazuh-template.json /usr/share/elasticsearch/config
|
|
||||||
|
|
||||||
COPY config/entrypoint.sh /entrypoint.sh
|
COPY config/entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
RUN chmod 755 /entrypoint.sh
|
RUN chmod 755 /entrypoint.sh
|
||||||
|
@@ -10,25 +10,41 @@ remove_single_node_conf(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
# If Elasticsearch cluster is enable, then set up the elasticsearch.yml
|
# If Elasticsearch cluster is enable, then set up the elasticsearch.yml
|
||||||
if [[ $ELASTIC_CLUSTER == "true" && $CLUSTER_NODE_MASTER != "" && $CLUSTER_NODE_DATA != "" && $CLUSTER_NODE_INGEST != "" ]];then
|
if [[ $ELASTIC_CLUSTER == "true" && $CLUSTER_NODE_MASTER != "" && $CLUSTER_NODE_DATA != "" && $CLUSTER_NODE_INGEST != "" && $CLUSTER_MASTER_NODE_NAME != "" ]]; then
|
||||||
|
|
||||||
remove_single_node_conf $elastic_config_file
|
remove_single_node_conf $elastic_config_file
|
||||||
|
|
||||||
# Remove the old configuration
|
# Remove the old configuration
|
||||||
sed -i '/# cluster node/,/# end cluster config/d' $elastic_config_file
|
sed -i '/# cluster node/,/# end cluster config/d' $elastic_config_file
|
||||||
|
|
||||||
# Add the current cluster configuration
|
if [[ $CLUSTER_NODE_MASTER == "true" ]]; then
|
||||||
|
# Add the master configuration
|
||||||
|
# cluster.initial_master_nodes for bootstrap the cluster
|
||||||
|
cat > $elastic_config_file << EOF
|
||||||
|
# cluster node
|
||||||
|
network.host: 0.0.0.0
|
||||||
|
node.name: $CLUSTER_MASTER_NODE_NAME
|
||||||
|
node.master: $CLUSTER_NODE_MASTER
|
||||||
|
cluster.initial_master_nodes:
|
||||||
|
- $CLUSTER_MASTER_NODE_NAME
|
||||||
|
# end cluster config"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
elif [[ $CLUSTER_NODE_NAME != "" ]];then
|
||||||
|
|
||||||
|
sed -i '/# cluster node/,/# end cluster config/d' $elastic_config_file
|
||||||
|
|
||||||
cat > $elastic_config_file << EOF
|
cat > $elastic_config_file << EOF
|
||||||
# cluster node
|
# cluster node
|
||||||
network.host: 0.0.0.0
|
network.host: 0.0.0.0
|
||||||
node.name: $CLUSTER_NODE_NAME
|
node.name: $CLUSTER_NODE_NAME
|
||||||
node.master: $CLUSTER_NODE_MASTER
|
node.master: false
|
||||||
|
discovery.seed_hosts:
|
||||||
cluster.initial_master_nodes:
|
- $CLUSTER_MASTER_NODE_NAME
|
||||||
- $CLUSTER_INITIAL_MASTER_NODES
|
- $CLUSTER_NODE_NAME
|
||||||
# end cluster config"
|
# end cluster config"
|
||||||
EOF
|
EOF
|
||||||
|
fi
|
||||||
# If the cluster is disabled, then set a single-node configuration
|
# If the cluster is disabled, then set a single-node configuration
|
||||||
else
|
else
|
||||||
sed -i '/# cluster node/,/# end cluster config/d' $elastic_config_file
|
sed -i '/# cluster node/,/# end cluster config/d' $elastic_config_file
|
||||||
|
Reference in New Issue
Block a user