Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 36434 invoked from network); 9 Sep 2010 08:11:49 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Sep 2010 08:11:49 -0000 Received: (qmail 18580 invoked by uid 500); 9 Sep 2010 08:11:48 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 18350 invoked by uid 500); 9 Sep 2010 08:11:45 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 18341 invoked by uid 99); 9 Sep 2010 08:11:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Sep 2010 08:11:44 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.215.44] (HELO mail-ew0-f44.google.com) (209.85.215.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Sep 2010 08:11:37 +0000 Received: by ewy22 with SMTP id 22so737868ewy.31 for ; Thu, 09 Sep 2010 01:11:16 -0700 (PDT) Received: by 10.216.187.143 with SMTP id y15mr1623056wem.74.1284019876204; Thu, 09 Sep 2010 01:11:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.3.129 with HTTP; Thu, 9 Sep 2010 01:10:56 -0700 (PDT) In-Reply-To: References: From: Benjamin Black Date: Thu, 9 Sep 2010 01:10:56 -0700 Message-ID: Subject: Re: Connect to localhost is ok,but the ip fails. To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Do you mean you are changing the yaml file? Does 'netstat -an | grep 9160' indicate cassandra is bound to ipv4 or ipv6 (tcp vs tcp6 in the netstat output)? b On Thu, Sep 9, 2010 at 1:06 AM, Ying Tang wrote: > I'm using cassandra 0.7 . > And in storage-conf . > > # The address to bind the Thrift RPC service to > rpc_address: localhost > # port for Thrift to listen on > rpc_port: 9160 > > In my client , the code below works successfully. > > =A0 =A0 =A0 =A0 TSocket socket =3D new TSocket("localhost", 9160); > =A0=A0=A0=A0=A0=A0=A0 TTransport trans =3D > Boolean.valueOf(System.getProperty("cassandra.framed", "true")) ? new > TFramedTransport( > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 socket) : socket; > =A0=A0=A0=A0=A0=A0=A0 trans.open(); > > But if i changed "localhost" to the localhost's ip , throws out the > "java.net.ConnectException: Connection refused". > > And the connecting to other ip also fails. > > -- > Best regards, > Ivy Tang > > >