Skip to content

Commit fe60278

Browse files
committed
Add a touchfile so the host can determine cluster availability.
1 parent a108022 commit fe60278

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ This container stores its state (e.g., mongod data files) under `/data`.
4141
To introspect that state outside the container, mount a volume to that path
4242
in the container.
4343

44+
## Readiness checks
45+
To check whether the cluster is ready, `exec` into the container and check if the
46+
`ready` file exists. For example:
47+
```
48+
while ! docker exec my-container-name [ -e ready ]; do
49+
echo "Still waiting for cluster to be ready …"
50+
done
51+
```
52+
4453
## Caveats
4554
- You **MUST** anticipate the bound ports and export them.
4655
- The container’s platform will dictate server version availability. For example,

entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ mlaunch "$@" --bind_ip_all
1717
echo
1818
./print_connstrs.py < data/.mlaunch_startup
1919

20+
touch ready
21+
2022
# Hang forever:
2123
tail -f /dev/null

0 commit comments

Comments
 (0)