Skip to content

Commit

Permalink
OR-2136 Increase ES timeout and expose as env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Hamerling committed Mar 3, 2016
1 parent e29a913 commit e2af17a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 3 deletions.
25 changes: 25 additions & 0 deletions docker/doc/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,31 @@ Note that this will not append the container logs to the main docker-compose log
docker-compose restart esn
```

- **Data is not provisioned**

They may have some database connection timeout at startup and so no user is available and you can not connect to the application.
Try to relaunch the ESN service:

```
docker-compose restart esn
```

If it still does not work, restart all the services.

- **Elasticsearch errors**

If you have an error like:

```
wait-for-it.sh: timeout occurred after waiting 30 seconds for localhost:9200
```

It means that your docker-compose platform is quite slow. You can increase the timeout value by setting the ELASTICSEARCH_INIT_TIMEOUT environment variable.

```
ELASTICSEARCH_INIT_TIMEOUT=120 docker-compose ...
```

# Dev

All the OpenPaaS Dockerfiles and docker-compose descriptor heavily use environment variables to create required resources such as configuration files, endpoints, etc...
Expand Down
2 changes: 2 additions & 0 deletions docker/dockerfiles/dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ services:
image: linagora/esn-elasticsearch:latest
ports:
- "9200:9200"
environment:
- ELASTICSEARCH_INIT_TIMEOUT=${ELASTICSEARCH_INIT_TIMEOUT}

sabre:
image: linagora/esn-sabre:latest
Expand Down
2 changes: 1 addition & 1 deletion docker/dockerfiles/platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ docker-compose -f ./docker/dockerfiles/platform/docker-compose.yml build
or, to launch all from existing images (even the current node project):

```bash
PROVISION=true DOCKER_IP=<YOUR_DOCKER_IP> docker-compose -f ./docker/dockerfiles/platform/docker-compose-full.yml up
PROVISION=true DOCKER_IP=<YOUR_DOCKER_IP> docker-compose -f ./docker/dockerfiles/platform/docker-compose-images.yml up
```

Check the complete documentation on [../../doc/run.md](../../doc/run.md)
3 changes: 3 additions & 0 deletions docker/dockerfiles/platform/docker-compose-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ services:
- DAV_SERVER_PORT=80
- ELASTICSEARCH_HOST=elasticsearch
- ELASTICSEARCH_PORT=9200
- ELASTICSEARCH_INIT_TIMEOUT=${ELASTICSEARCH_INIT_TIMEOUT}
- JMAP_SERVER_HOST=${DOCKER_IP}
- JMAP_SERVER_PORT=1080

Expand All @@ -50,6 +51,8 @@ services:
image: linagora/esn-elasticsearch:latest
ports:
- "9200:9200"
environment:
- ELASTICSEARCH_INIT_TIMEOUT=${ELASTICSEARCH_INIT_TIMEOUT}

sabre:
image: linagora/esn-sabre
Expand Down
3 changes: 3 additions & 0 deletions docker/dockerfiles/platform/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ services:
- DAV_SERVER_PORT=80
- ELASTICSEARCH_HOST=elasticsearch
- ELASTICSEARCH_PORT=9200
- ELASTICSEARCH_INIT_TIMEOUT=${ELASTICSEARCH_INIT_TIMEOUT}
- JMAP_SERVER_HOST=${DOCKER_IP}
- JMAP_SERVER_PORT=1080

Expand All @@ -46,6 +47,8 @@ services:
image: linagora/esn-elasticsearch:latest
ports:
- "9200:9200"
environment:
- ELASTICSEARCH_INIT_TIMEOUT=${ELASTICSEARCH_INIT_TIMEOUT}

sabre:
image: linagora/esn-sabre
Expand Down
9 changes: 7 additions & 2 deletions docker/scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/bin/bash

if [ "$PROVISION" = true ] ; then
wait-for-it.sh $ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT -s -t 60 -- sh ./provision.sh

timeout=60;
[ -z "$ELASTICSEARCH_INIT_TIMEOUT" ] || timeout="$ELASTICSEARCH_INIT_TIMEOUT"
echo ${timeout}

wait-for-it.sh $ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT -s -t ${timeout} -- sh ./provision.sh
fi

echo 'Starting OpenPaaS ESN'
npm start
npm start

0 comments on commit e2af17a

Please sign in to comment.