Skip to content

Commit 3bc2bdb

Browse files
committed
BOOKKEEPER-66: use IPv4 for builds (mmorel via ivank)
git-svn-id: https://svn.apache.org/repos/asf/zookeeper/bookkeeper/trunk@1208472 13f79535-47bb-0310-9956-ffa450edef68
1 parent 9794cc0 commit 3bc2bdb

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Release 4.0.0 - 2011-11-30
3939
BOOKKEEPER-122: Review BookKeeper server documentation (fpj & ivank)
4040

4141
BOOKKEEPER-130: Add developer KEYS file to svn (ivank)
42+
43+
BOOKKEEPER-66: use IPv4 for builds (mmorel via ivank)
4244

4345
bookkeeper-server/
4446

bookkeeper-server/bin/bookkeeper

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
# * limitations under the License.
2121
# */
2222

23+
# check if net.ipv6.bindv6only is set to 1
24+
bindv6only=$(/sbin/sysctl -n net.ipv6.bindv6only 2> /dev/null)
25+
if [ -n "$bindv6only" ] && [ "$bindv6only" -eq "1" ]
26+
then
27+
echo "Error: \"net.ipv6.bindv6only\" is set to 1 - Java networking could be broken"
28+
echo "For more info (the following page also applies to bookkeeper): http://wiki.apache.org/hadoop/HadoopIPv6"
29+
exit 1
30+
fi
31+
2332
BINDIR=`dirname "$0"`
2433
BK_HOME=`cd $BINDIR/..;pwd`
2534

@@ -108,6 +117,9 @@ OPTS="-cp $BOOKIE_CLASSPATH $OPTS $BOOKIE_EXTRA_OPTS"
108117

109118
OPTS="$OPTS $BOOKIE_EXTRA_OPTS"
110119

120+
# Disable ipv6 as it can cause issues
121+
OPTS="$OPTS -Djava.net.preferIPv4Stack=true"
122+
111123
if [ $COMMAND == "bookie" ]; then
112124
exec java $OPTS org.apache.bookkeeper.proto.BookieServer --conf $BOOKIE_CONF $@
113125
elif [ $COMMAND == "localbookie" ]; then

hedwig-server/bin/hedwig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
# * limitations under the License.
2121
# */
2222

23+
# check if net.ipv6.bindv6only is set to 1
24+
bindv6only=$(/sbin/sysctl -n net.ipv6.bindv6only 2> /dev/null)
25+
if [ -n "$bindv6only" ] && [ "$bindv6only" -eq "1" ]
26+
then
27+
echo "Error: \"net.ipv6.bindv6only\" is set to 1 - Java networking could be broken"
28+
echo "For more info (the following page also applies to hedwig): http://wiki.apache.org/hadoop/HadoopIPv6"
29+
exit 1
30+
fi
31+
2332
BINDIR=`dirname "$0"`
2433
HW_HOME=`cd $BINDIR/..;pwd`
2534

@@ -104,6 +113,9 @@ if [ "$HEDWIG_LOG_CONF" != "" ]; then
104113
fi
105114
OPTS="-cp $HEDWIG_CLASSPATH $OPTS $HEDWIG_EXTRA_OPTS"
106115

116+
# Disable ipv6 as it can cause issues
117+
OPTS="$OPTS -Djava.net.preferIPv4Stack=true"
118+
107119
if [ $COMMAND == "server" ]; then
108120
exec java $OPTS org.apache.hedwig.server.netty.PubSubServer $HEDWIG_SERVER_CONF $@
109121
elif [ $COMMAND == "help" ]; then

pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
<groupId>org.apache.maven.plugins</groupId>
5757
<artifactId>maven-surefire-plugin</artifactId>
5858
<version>2.9</version>
59+
<configuration>
60+
<argLine>-Djava.net.preferIPv4Stack=true</argLine>
61+
</configuration>
5962
</plugin>
6063
<plugin>
6164
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)