File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ WORKDIR /opt/zookeeper
1818
1919# Only checks if server is up and listening, not quorum.
2020# See https://zookeeper.apache.org/doc/r3.4.13/zookeeperAdmin.html#sc_zkCommands
21- HEALTHCHECK CMD [ $(echo ruok | nc 127.0.0.1:2181) == "imok" ] || exit 1
21+ COPY healthcheck /healthcheck
22+ HEALTHCHECK CMD /healthcheck
2223
2324VOLUME ["/opt/zookeeper/conf" , "/tmp/zookeeper" ]
2425
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Read bound host and port from the config file (if any)
3+ set -e
4+
5+ CFG=/opt/zookeeper/conf/zoo.cfg
6+ if [ -e " $CFG " ]; then
7+ H=" $( awk -F= ' /^clientPortAddress=/{ print $2 }' " $CFG " ) "
8+ P=" $( awk -F= ' /^clientPort=/{ print $2 }' " $CFG " ) "
9+ fi
10+
11+ [ " $( echo ruok | nc " ${H:- 127.0.01} " " ${P:- 2181} " ) " == " imok" ] || exit 1
You can’t perform that action at this time.
0 commit comments