We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c5e7be commit df9474fCopy full SHA for df9474f
3.4.9/docker-entrypoint.sh
@@ -27,6 +27,12 @@ fi
27
28
# Write myid only if it doesn't exist
29
if [ ! -f "$ZOO_DATA_DIR/myid" ]; then
30
+ if [ -z "$ZOO_MY_ID" ]; then
31
+ ZOO_MY_ID=$(($(hostname | sed s/.*-//) + 1))
32
+ echo "Guessed server id: $ZOO_MY_ID"
33
+ # Tries to bind to it's own server entry, which won't work with names ("Exception while listening java.net.SocketException: Unresolved address")
34
+ sed -i s/server\.$ZOO_MY_ID\=[a-z0-9.-]*/server.$ZOO_MY_ID=0.0.0.0/ "$ZOO_CONF_DIR/zoo.cfg"
35
+ fi
36
echo "${ZOO_MY_ID:-1}" > "$ZOO_DATA_DIR/myid"
37
fi
38
0 commit comments