From 548e632f654b89e4e0790091583d9caf32059711 Mon Sep 17 00:00:00 2001 From: Matteo Merli Date: Thu, 9 Feb 2017 17:41:42 -0800 Subject: [PATCH] Prefer ipv4 in client connections --- bin/pulsar | 2 +- bin/pulsar-admin | 1 + bin/pulsar-client | 1 + bin/pulsar-perf | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/pulsar b/bin/pulsar index 884c44fdf6765..30238f8317f2f 100755 --- a/bin/pulsar +++ b/bin/pulsar @@ -168,7 +168,7 @@ OPTS="$OPTS -Dlog4j.configuration=`basename $PULSAR_LOG_CONF`" # Ensure we can read bigger content from ZK. (It might be # rarely needed when trying to list many z-nodes under a # directory) -OPTS="$OPTS -Djute.maxbuffer=10485760" +OPTS="$OPTS -Djute.maxbuffer=10485760 -Djava.net.preferIPv4Stack=true" OPTS="-cp $PULSAR_CLASSPATH $OPTS" diff --git a/bin/pulsar-admin b/bin/pulsar-admin index 2080b48275dfa..e32b2e3c5d643 100755 --- a/bin/pulsar-admin +++ b/bin/pulsar-admin @@ -86,6 +86,7 @@ fi PULSAR_CLASSPATH="$PULSAR_JAR:$PULSAR_CLASSPATH:$PULSAR_EXTRA_CLASSPATH" PULSAR_CLASSPATH="`dirname $PULSAR_LOG_CONF`:$PULSAR_CLASSPATH" OPTS="$OPTS -Dlog4j.configuration=`basename $PULSAR_LOG_CONF`" +OPTS="$OPTS -Djava.net.preferIPv4Stack=true" OPTS="-cp $PULSAR_CLASSPATH $OPTS" diff --git a/bin/pulsar-client b/bin/pulsar-client index 482883428fbbd..5a3b091527813 100755 --- a/bin/pulsar-client +++ b/bin/pulsar-client @@ -86,6 +86,7 @@ fi PULSAR_CLASSPATH="$PULSAR_JAR:$PULSAR_CLASSPATH:$PULSAR_EXTRA_CLASSPATH" PULSAR_CLASSPATH="`dirname $PULSAR_LOG_CONF`:$PULSAR_CLASSPATH" OPTS="$OPTS -Dlog4j.configuration=`basename $PULSAR_LOG_CONF`" +OPTS="$OPTS -Djava.net.preferIPv4Stack=true" OPTS="-cp $PULSAR_CLASSPATH $OPTS" diff --git a/bin/pulsar-perf b/bin/pulsar-perf index 5e0bbf1e32605..b64b046f10440 100755 --- a/bin/pulsar-perf +++ b/bin/pulsar-perf @@ -105,7 +105,7 @@ fi PULSAR_CLASSPATH="$PULSAR_JAR:$PULSAR_CLASSPATH:$PULSAR_EXTRA_CLASSPATH" PULSAR_CLASSPATH="`dirname $PULSAR_LOG_CONF`:$PULSAR_CLASSPATH" -OPTS="$OPTS -Dlog4j.configuration=`basename $PULSAR_LOG_CONF`" +OPTS="$OPTS -Dlog4j.configuration=`basename $PULSAR_LOG_CONF` -Djava.net.preferIPv4Stack=true" OPTS="-cp $PULSAR_CLASSPATH $OPTS" OPTS="$OPTS $PULSAR_EXTRA_OPTS"