-
Notifications
You must be signed in to change notification settings - Fork 1
/
startEsLocal.sh
executable file
·33 lines (24 loc) · 1.1 KB
/
startEsLocal.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
30
31
32
33
#!/bin/sh
# Start a local instance for development only, we should use Elastic.co for other env.
export UID=$(id -u)
export GID=$(id -g)
# If you see permission error on creating the cert in log, then there is a problem with the elasticdata,
# the elasticdata folder and it subdirectory needs to have $UID:$GID
# Create the folder if it doesn't exist
if [ ! -d "elasticdata" ]; then
mkdir -p "elasticdata"
chown $UID:$GID "elasticdata"
mkdir -p "elasticdata/certs"
chown $UID:$GID "elasticdata/certs"
mkdir -p "elasticdata/elasticsearch-data"
chown $UID:$GID "elasticdata/elasticsearch-data"
mkdir -p "elasticdata/kibana-data"
chown $UID:$GID "elasticdata/kibana-data"
mkdir -p "elasticdata/enterprisesearch-data"
chown $UID:$GID "elasticdata/enterprisesearch-data"
else
chown -R $UID:$GID "elasticdata"
fi
# If you run in EC2, you need to change the docker-es-compose.yml localhost in cert to the hostname of EC2 and install docker
# docker-compose and sudo chmod 666 /run/docker.sock
docker-compose -f docker-es-compose.yml up --detach --remove-orphans --force-recreate