From 53b2cb53b5b4d75abcc26862bf4f7d66b6cfeb1e Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Wed, 28 Jun 2017 16:15:35 +0200 Subject: [PATCH] Limiting metrics' JVM to match resource limits. Still getting OOMKilled though, but maybe half as often. --- README.md | 1 + zookeeper/51zoo.yml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 960de581..25ecff2e 100644 --- a/README.md +++ b/README.md @@ -69,3 +69,4 @@ kubectl exec -c broker kafka-0 -- /bin/sh -c 'apk add --no-cache curl && curl ht kubectl logs -c metrics zoo-0 kubectl exec -c zookeeper zoo-0 -- /bin/sh -c 'apk add --no-cache curl && curl http://localhost:5556/metrics' ``` +Metrics containers can't be used for the curl because they're too short on memory. diff --git a/zookeeper/51zoo.yml b/zookeeper/51zoo.yml index 856b2516..d43dc36f 100644 --- a/zookeeper/51zoo.yml +++ b/zookeeper/51zoo.yml @@ -21,6 +21,8 @@ spec: image: solsson/kafka-prometheus-jmx-exporter@sha256:1f7c96c287a2dbec1d909cd8f96c0656310239b55a9a90d7fd12c81f384f1f7d command: - java + - -Xms39M + - -Xmx99M - -jar - jmx_prometheus_httpserver.jar - "5556" @@ -41,9 +43,8 @@ spec: value: "5555" command: - /bin/bash - - -c + - -euc - > - set -e; export ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-} + 4)); echo "${ZOOKEEPER_SERVER_ID:-1}" | tee /var/lib/zookeeper/data/myid; sed -i "s/server\.$ZOOKEEPER_SERVER_ID\=[a-z0-9.-]*/server.$ZOOKEEPER_SERVER_ID=0.0.0.0/" config/zookeeper.properties;