Skip to content

replace netcat with socat for liveness probe/metrics #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ARG GPG_KEY=C823E3E5B12AF29C67F81976F5CECB3CB5E9BD2D
ARG ZK_DIST=zookeeper-3.4.10
RUN set -x \
&& apt-get update \
&& apt-get install -y openjdk-8-jre-headless wget netcat-openbsd \
&& apt-get install -y openjdk-8-jre-headless wget socat \
&& wget -q "http://www.apache.org/dist/zookeeper/$ZK_DIST/$ZK_DIST.tar.gz" \
&& wget -q "http://www.apache.org/dist/zookeeper/$ZK_DIST/$ZK_DIST.tar.gz.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
Expand Down
2 changes: 1 addition & 1 deletion docker/scripts/zookeeper-metrics
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

echo mntr | nc localhost $1 >& 1
echo mntr | socat STDIO TCP:localhost:$1 >& 1
4 changes: 2 additions & 2 deletions docker/scripts/zookeeper-ready
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
# is health. The $? variable will be set to 0 if server responds that it is
# healthy, or 1 if the server fails to respond.

OK=$(echo ruok | nc 127.0.0.1 $1)
OK=$(echo ruok | socat STDIO TCP:127.0.0.1:$1)
if [ "$OK" == "imok" ]; then
exit 0
else
exit 1
fi
fi