From 0818dace550b3ea901924cd45e88b8dd2b77633f Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 2 Jun 2022 19:00:26 +0300 Subject: [PATCH] Enable TCP/IP keepalive for all ZK client connections in all components --- bin/pulsar | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/pulsar b/bin/pulsar index 78749334d9457..8389fd9ebe2a2 100755 --- a/bin/pulsar +++ b/bin/pulsar @@ -270,6 +270,8 @@ OPTS="$OPTS -Dlog4j.configurationFile=`basename $PULSAR_LOG_CONF`" # rarely needed when trying to list many z-nodes under a # directory) OPTS="$OPTS -Djute.maxbuffer=10485760 -Djava.net.preferIPv4Stack=true" +# Enable TCP keepalive for all Zookeeper client connections +OPTS="$OPTS -Dzookeeper.clientTcpKeepAlive=true" # Allow Netty to use reflection access OPTS="$OPTS -Dio.netty.tryReflectionSetAccessible=true" @@ -328,7 +330,7 @@ OPTS="$OPTS -Dpulsar.functions.extra.dependencies.dir=${FUNCTIONS_EXTRA_DEPS_DIR OPTS="$OPTS -Dpulsar.functions.instance.classpath=${PULSAR_CLASSPATH}" OPTS="$OPTS -Dpulsar.functions.log.conf=${FUNCTIONS_LOG_CONF}" -ZK_OPTS=" -Dzookeeper.4lw.commands.whitelist=* -Dzookeeper.snapshot.trust.empty=true -Dzookeeper.tcpKeepAlive=true -Dzookeeper.clientTcpKeepAlive=true" +ZK_OPTS=" -Dzookeeper.4lw.commands.whitelist=* -Dzookeeper.snapshot.trust.empty=true -Dzookeeper.tcpKeepAlive=true" LOG4J2_SHUTDOWN_HOOK_DISABLED="-Dlog4j.shutdownHookEnabled=false"