Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D3CE81746B for ; Tue, 14 Apr 2015 19:34:59 +0000 (UTC) Received: (qmail 25787 invoked by uid 500); 14 Apr 2015 19:34:59 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 25756 invoked by uid 500); 14 Apr 2015 19:34:59 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 25745 invoked by uid 99); 14 Apr 2015 19:34:59 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2015 19:34:59 +0000 Date: Tue, 14 Apr 2015 19:34:59 +0000 (UTC) From: "Jonathan Ellis (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-9137) nodetool doesn't work when Cassandra run with the property java.net.preferIPv6Addresses=true MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-9137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jonathan Ellis updated CASSANDRA-9137: -------------------------------------- Assignee: Andrey Trubachev > nodetool doesn't work when Cassandra run with the property java.net.preferIPv6Addresses=true > -------------------------------------------------------------------------------------------- > > Key: CASSANDRA-9137 > URL: https://issues.apache.org/jira/browse/CASSANDRA-9137 > Project: Cassandra > Issue Type: Bug > Components: Core > Reporter: Andrey Trubachev > Assignee: Andrey Trubachev > Fix For: 2.0.15, 2.1.5 > > Attachments: cassandra-2.0.14-9137.txt, cassandra-2.1.4-9137.txt > > > nodetool doesn't work when Cassandra run with the property {{java.net.preferIPv6Addresses=true}}. > {noformat} > $ sudo netstat -tlpn | grep $(cat /var/run/cassandra/cassandra.pid) | grep 7199 > tcp6 0 0 ::1:7199 :::* LISTEN 27560/java > {noformat} > {noformat} > $ nodetool -h ::1 status > nodetool: Failed to connect to '::1:7199' - ConnectException: 'Connection refused'. > {noformat} > Hardcoded value of the property {{java.rmi.server.hostname}} (https://github.com/apache/cassandra/blob/cassandra-2.1.4/src/java/org/apache/cassandra/service/CassandraDaemon.java#L91) makes RMI returns the address {{127.0.0.1}} instead of {{::1}} that jmxServer listens to. > {noformat} > 21:52:26.300192 IP6 (hlim 64, next-header TCP (6) payload length: 259) ::1.7199 > ::1.58706: Flags [P.], cksum 0x010b (incorrect -> 0x6a57), seq 23:250, ack 88, win 2048, options [nop,nop,TS val 1833457 ecr 1833456], length 227 > `......@...................................R.4...../........... > ........Q....w..SZ.y...L.[....sr..javax.management.remote.rmi.RMIServerImpl_Stub...........pxr..java.rmi.server.RemoteStub......e....pxr..javSZ.y...L.[.....xoteObject.a...a3....pxpw4..UnicastRef2.. 127.0.0.1...(.L....d > 21:52:26.336400 IP6 (hlim 64, next-header TCP (6) payload length: 32) ::1.58706 > ::1.7199: Flags [.], cksum 0x0028 (incorrect -> 0xfe1c), seq 88, ack 250, win 2048, options [nop,nop,TS val 1833467 ecr 1833457], length 0 > `.... .@.................................R...../.4.......(..... > ........ > {noformat} > jmxServer listens to the an ip address that was resolved from {{localhost}} and it depends on value of the property {{java.net.preferIPv6Addresses}} or lack of it ( > https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/utils/RMIServerSocketFactoryImpl.java#L13). > This is a simple patch that works correctly with {{java.net.preferIPv6Addresses=(true|false)}} and {{java.net.preferIPv4Stack=(true|false)}}: > {code} > diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java b/src/java/org/apache/cassandra/service/CassandraDaemon.java > index 3e398bf..66e9cca 100644 > --- a/src/java/org/apache/cassandra/service/CassandraDaemon.java > +++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java > @@ -88,7 +88,7 @@ public class CassandraDaemon > } > else > { > - System.setProperty("java.rmi.server.hostname","127.0.0.1"); > + System.setProperty("java.rmi.server.hostname", InetAddress.getLoopbackAddress().getHostAddress()); > try > { > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)