forked from pires/docker-elasticsearch-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·29 lines (24 loc) · 873 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
# provision elasticsearch user
addgroup sudo
adduser -D -g '' elasticsearch
adduser elasticsearch sudo
chown -R elasticsearch /elasticsearch /data
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# set environment
export CLUSTER_NAME=${CLUSTER_NAME:-elasticsearch-default}
export NODE_MASTER=${NODE_MASTER:-true}
export NODE_DATA=${NODE_DATA:-true}
export HTTP_ENABLE=${HTTP_ENABLE:-true}
export NETWORK_HOST=${NETWORK_HOST:-_site_}
export ES_HEAP_SIZE=${ES_HEAP_SIZE:-512m}
export NUMBER_OF_SHARDS=${NUMBER_OF_SHARDS:-1}
export NUMBER_OF_REPLICAS=${NUMBER_OF_REPLICAS:-0}
export NUMBER_OF_MASTERS=${NUMBER_OF_MASTERS:-1}
# Kubernetes stuff
export NAMESPACE=${NAMESPACE:-default}
export DISCOVERY_SERVICE=${DISCOVERY_SERVICE:-elasticsearch-discovery}
# allow for memlock
ulimit -l unlimited
# run
sudo -E -u elasticsearch /elasticsearch/bin/elasticsearch