Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E93B3932B for ; Sat, 26 May 2012 14:08:08 +0000 (UTC) Received: (qmail 55631 invoked by uid 500); 26 May 2012 14:08:06 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 55604 invoked by uid 500); 26 May 2012 14:08:06 -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 55595 invoked by uid 99); 26 May 2012 14:08:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 May 2012 14:08:06 +0000 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS,TRACKER_ID X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of JEREMIAH.JORDAN@morningstar.com designates 64.18.2.217 as permitted sender) Received: from [64.18.2.217] (HELO exprod7og115.obsmtp.com) (64.18.2.217) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 May 2012 14:07:57 +0000 Received: from MSEXET82.morningstar.com ([216.228.224.46]) (using TLSv1) by exprod7ob115.postini.com ([64.18.6.12]) with SMTP ID DSNKT8DjqGZJgIfomiMz+2puSPqYc/adcDmw@postini.com; Sat, 26 May 2012 07:07:37 PDT Received: from MSEXCHM81.morningstar.com (172.28.13.41) by MSEXET82.morningstar.com (172.28.6.46) with Microsoft SMTP Server (TLS) id 14.2.298.4; Sat, 26 May 2012 09:07:35 -0500 Received: from MSEXCHM83.morningstar.com ([fe80::9529:19c5:7200:611e]) by MSEXCHM81.morningstar.com ([fe80::b102:6618:6e80:4bb8%22]) with mapi id 14.02.0298.004; Sat, 26 May 2012 09:07:35 -0500 From: Jeremiah Jordan To: "" Subject: Re: NetworkTopologyStrategy with 1 node Thread-Topic: NetworkTopologyStrategy with 1 node Thread-Index: AQHNOp6j9dMoBnv9b0y9h0qm+kQDCZbbg6eAgACccACAACYpAIAAKiCA Date: Sat, 26 May 2012 14:07:34 +0000 Message-ID: <35FB8C90-B09B-4978-8377-32948470718F@morningstar.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [71.201.190.179] Content-Type: multipart/alternative; boundary="_000_35FB8C90B09B4978837732948470718Fmorningstarcom_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_35FB8C90B09B4978837732948470718Fmorningstarcom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable What is the output of nodetool ring? Does the cluster actually think your = node is in DC1? -Jeremiah On May 26, 2012, at 6:36 AM, Cyril Auburtin wrote: I get the same issue on Cassandra 1.1: create keyspace ks with strategy_class =3D 'NetworkTopologyStrategy' AND st= rategy_options =3D{DC1:1}; then for example [default@ks] create column family rr WITH key_validation_class=3DUTF8Type a= nd comparator =3D UTF8Type and column_metadata =3D [{column_name: boo, vali= dation_class: UTF8Type}]; 5c6d0b86-86f2-3444-8335-fe4bdaa4745d Waiting for schema agreement... ... schemas agree across the cluster [default@ks] set rr['1']['boo'] =3D '1'; null UnavailableException() at org.apache.cassandra.thrift.Cassandra$insert_result.read(Cassandra.java:= 15898) at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78) at org.apache.cassandra.thrift.Cassandra$Client.recv_insert(Cassandra.java:= 788) at org.apache.cassandra.thrift.Cassandra$Client.insert(Cassandra.java:772) at org.apache.cassandra.cli.CliClient.executeSet(CliClient.java:896) at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:21= 3) at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.jav= a:219) at org.apache.cassandra.cli.CliMain.main(CliMain.java:346) 2012/5/26 Cyril Auburtin > thx, but still not I did: update keyspace ks with strategy_options =3D [{DC1:1}] and placement_strate= gy =3D 'org.apache.cassandra.locator.NetworkTopologyStrategy'; then in cassandra-cli : [default@ks] list Position; Using default limit of 100 Internal error processing get_range_slices and in cassandra console: INFO 11:10:52,680 Keyspace updated. Please perform any manual operations. ERROR 11:13:37,565 Internal error processing get_range_slices java.lang.IllegalStateException: datacenter (DC1) has no more endpoints, (1= ) replicas still needed at org.apache.cassandra.locator.NetworkTopologyStrategy.calculateNaturalEnd= points(NetworkTopologyStrategy.java:118) at org.apache.cassandra.locator.AbstractReplicationStrategy.getNaturalEndpo= ints(AbstractReplicationStrategy.java:101) at org.apache.cassandra.service.StorageService.getLiveNaturalEndpoints(Stor= ageService.java:1538) How do I have to set the cassndra-topology.properties for a single node in = ths DC? I will try to do the same thing with C1.1, it could work 2012/5/26 Edward Capriolo > replication_factor =3D 1 and strategy_options =3D [{DC1:0}] You should not be setting both of these. All you should need is: strategy_options =3D [{DC1:1}] On Fri, May 25, 2012 at 1:47 PM, Cyril Auburtin > wrote: > I was using a single node, on cassandra 0.7.10 > > with Network strategy =3D SimpleStrategy, and replication factor =3D 1, > everything is fine, I was using a consistency level of ONE, for > reading/writing > > I have updated the keyspace to > > update keyspace Mymed with replication_factor =3D 1 and strategy_options = =3D > [{DC1:0}] and placement_strategy =3D > 'org.apache.cassandra.locator.NetworkTopologyStrategy'; > > with conf/cassandra-topology.properties having just this for the moment: > > default=3DDC1:r1 > > the keyspace could update, I could use ks; also, but can't read anything > > even from Thrift using ConsistencyLevel.ONE; it will complain that this > strategy require Quorum > > I tried with ConsistencyLevel.LOCAL_QUORUM; but get an exception like : > > org.apache.thrift.TApplicationException: Internal error processing get_sl= ice > > and in cassandra console: > > DEBUG 19:45:02,013 Command/ConsistencyLevel is > SliceFromReadCommand(table=3D'Mymed', > key=3D'637972696c2e617562757274696e40676d61696c2e636f6d', > column_parent=3D'QueryPath(columnFamilyName=3D'Authentication', > superColumnName=3D'null', columnName=3D'null')', start=3D'', finish=3D'', > reversed=3Dfalse, count=3D100)/LOCAL_QUORUM > ERROR 19:45:02,014 Internal error processing get_slice > java.lang.NullPointerException > at > org.apache.cassandra.locator.NetworkTopologyStrategy.getReplicationFactor= (NetworkTopologyStrategy.java:139) > at > org.apache.cassandra.service.DatacenterReadCallback.determineBlockFor(Dat= acenterReadCallback.java:83) > at org.apache.cassandra.service.ReadCallback.(ReadCallback.java:77) > at > org.apache.cassandra.service.DatacenterReadCallback.(DatacenterRead= Callback.java:48) > at > org.apache.cassandra.service.StorageProxy.getReadCallback(StorageProxy.ja= va:461) > at > org.apache.cassandra.service.StorageProxy.fetchRows(StorageProxy.java:326= ) > at org.apache.cassandra.service.StorageProxy.read(StorageProxy.java:291) > > So probably I guess Network topology strategy can't work with just one no= de? > > thx for any feedback --_000_35FB8C90B09B4978837732948470718Fmorningstarcom_ Content-Type: text/html; charset="iso-8859-1" Content-ID: <5E5B35721EE6DA4BA6FA2A60EB078E1F@morningstar.com> Content-Transfer-Encoding: quoted-printable What is the output of nodetool ring?  Does the cluster actually think = your node is in DC1?

-Jeremiah

On May 26, 2012, at 6:36 AM, Cyril Auburtin wrote:

I get the same issue on Cassandra 1.1:

create keyspace ks with strategy_class =3D 'NetworkTopologyStrategy' A= ND strategy_options =3D{DC1:1};

then for example

[default@ks] create column family rr WITH key_validation_class=3DUTF8T= ype and comparator =3D UTF8Type and column_metadata =3D [{column_name: boo,= validation_class: UTF8Type}]; 
5c6d0b86-86f2-3444-8335-fe4bdaa4745d
Waiting for schema agreement...
... schemas agree across the cluster
[default@ks] set rr['1']['boo'] =3D '1';
null
UnavailableException()
at org.apache.cassandra.th= rift.Cassandra$insert_result.read(Cassandra.java:15898)
at org.apache.thrift.TServ= iceClient.receiveBase(TServiceClient.java:78)
at org.apache.cassandra.th= rift.Cassandra$Client.recv_insert(Cassandra.java:788)
at org.apache.cassandra.th= rift.Cassandra$Client.insert(Cassandra.java:772)
at org.apache.cassandra.cl= i.CliClient.executeSet(CliClient.java:896)
at org.apache.cassandra.cl= i.CliClient.executeCLIStatement(CliClient.java:213)
at org.apache.cassandra.cl= i.CliMain.processStatementInteractive(CliMain.java:219)
at org.apache.cassandra.cl= i.CliMain.main(CliMain.java:346)



2012/5/26 Cyril Auburtin <<= a href=3D"mailto:cyril.auburtin@gmail.com" target=3D"_blank">cyril.auburtin= @gmail.com>
thx, but still not 

I did:

update keyspace ks with strategy_options =3D [{DC1:1}] and placement_s= trategy =3D 'org.apache.cassandra.locator.NetworkTopologyStrategy';

then in cassandra-cli :

[default@ks] list Position;
Using default limit of 100
Internal error processing get_range_slices

and in cassandra console:

 INFO 11:10:52,680 Keyspace updated. Plea= se perform any manual operations.
ERROR 11:13:37,565 Internal error processing g= et_range_slices
java.lang.IllegalStateException: datacenter (D= C1) has no more endpoints, (1) replicas still needed
at= org.apache.cassandra.locator.NetworkTopologyStrategy.calculateNaturalEndpo= ints(NetworkTopologyStrategy.java:118)
at= org.apache.cassandra.locator.AbstractReplicationStrategy.getNaturalEndpoin= ts(AbstractReplicationStrategy.java:101)
at= org.apache.cassandra.service.StorageService.getLiveNaturalEndpoints(Storag= eService.java:1538)

How do I have to set the cassndra-topology.properties for a single nod= e in ths DC?
I will try to do the same thing with C1.1, it could work

2012/5/26 Edward Capriolo <= edlinuxguru@gmai= l.com>
replication_factor =3D 1 and strategy_options =3D [{DC1:0}]

You should not be setting both of these.

All you should need is:
strategy_options =3D [{DC1:1}]

On Fri, May 25, 2012 at 1:47 PM, Cyril Auburtin
<cyril.aub= urtin@gmail.com> wrote:
> I was using a single node, on cassandra 0.7.10
>
> with Network strategy =3D SimpleStrategy, and replication factor =3D 1= ,
> everything is fine, I was using a consistency level of ONE, for
> reading/writing
>
> I have updated the keyspace to
>
> update keyspace Mymed with replication_factor =3D 1 and strategy_optio= ns =3D
> [{DC1:0}] and placement_strategy =3D
> 'org.apache.cassandra.locator.NetworkTopologyStrategy';
>
> with conf/cassandra-topology.properties having just this for the momen= t:
>
> default=3DDC1:r1
>
> the keyspace could update, I could use ks; also, but can't read anythi= ng
>
> even from Thrift using ConsistencyLevel.ONE; it will complain tha= t this
> strategy require Quorum
>
> I tried with  ConsistencyLevel.LOCAL_QUORUM;  but get an exc= eption like :
>
> org.apache.thrift.TApplicationException: Internal error processing get= _slice
>
> and in cassandra console:
>
> DEBUG 19:45:02,013 Command/ConsistencyLevel is
> SliceFromReadCommand(table=3D'Mymed',
> key=3D'637972696c2e617562757274696e40676d61696c2e636f6d',
> column_parent=3D'QueryPath(columnFamilyName=3D'Authentication',
> superColumnName=3D'null', columnName=3D'null')', start=3D'', finish=3D= '',
> reversed=3Dfalse, count=3D100)/LOCAL_QUORUM
> ERROR 19:45:02,014 Internal error processing get_slice
> java.lang.NullPointerException
> at
> org.apache.cassandra.locator.NetworkTopologyStrategy.getReplicationFac= tor(NetworkTopologyStrategy.java:139)
> at
> org.apache.cassandra.service.DatacenterReadCallback.determineBlockFor(= DatacenterReadCallback.java:83)
> at org.apache.cassandra.service.ReadCallback.<init>(ReadCallback= .java:77)
> at
> org.apache.cassandra.service.DatacenterReadCallback.<init>(Datac= enterReadCallback.java:48)
> at
> org.apache.cassandra.service.StorageProxy.getReadCallback(StorageProxy= .java:461)
> at
> org.apache.cassandra.service.StorageProxy.fetchRows(StorageProxy.java:= 326)
> at org.apache.cassandra.service.StorageProxy.read(StorageProxy.java:29= 1)
>
> So probably I guess Network topology strategy can't work with just one= node?
>
> thx for any feedback



--_000_35FB8C90B09B4978837732948470718Fmorningstarcom_--