Re: how can i get the column value? Need help!.. cassandra 1.28 and pig 0.11.1

2013-08-28 Thread Miguel Angel Martin junquera
hi all:


Regards

Still i can resolve this issue. .

does anybody have this issue or try to test this simple example?


i am stumped I can not find a solution working.

I appreciate any comment or help


2013/8/22 Miguel Angel Martin junquera mianmarjun.mailingl...@gmail.com

 hi all:




 I,m testing the new CqlStorage() with cassandra 1.28 and pig 0.11.1


 I am using this sample data test:


 http://frommyworkshop.blogspot.com.es/2013/07/hadoop-map-reduce-with-cassandra.html

 And I load and dump data Righ with this script:

 *rows = LOAD
 'cql://keyspace1/test?page_size=1split_size=4where_clause=age%3D30' USING
 CqlStorage();*
 *
 *
 *dump rows;*
 *describe rows;*
 *
 *

 *resutls:

 ((id,6),(age,30),(title,QA))

 ((id,5),(age,30),(title,QA))

 rows: {id: chararray,age: int,title: chararray}


 *


 But i can not  get  the column values

 I try to define   another schemas in Load like I used with
 cassandraStorage()


 http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Cassandra-and-Pig-how-to-get-column-values-td5641158.html


 example:

 *rows = LOAD
 'cql://keyspace1/test?page_size=1split_size=4where_clause=age%3D30' USING
 CqlStorage() AS (columns: bag {T: tuple(name, value)});*


 and I get this error:

 *2013-08-22 12:24:45,426 [main] ERROR org.apache.pig.tools.grunt.Grunt -
 ERROR 1031: Incompatable schema: left is
 columns:bag{T:tuple(name:bytearray,value:bytearray)}, right is
 id:chararray,age:int,title:chararray*




 I try to use, FLATTEN, SUBSTRING, SPLIT UDF`s but i have not get good
 result:

 Example:


- when I flatten , I get a set of tuples like

 *(title,QA)*

 *(title,QA)*

 *2013-08-22 12:42:20,673 [main] INFO
  org.apache.pig.backend.hadoop.executionengine.util.MapRedUtil - Total
 input paths to process : 1*

 *A: {title: chararray}*



 but i can get value QA

 Sustring only works with title



 example:

 *B = FOREACH A GENERATE SUBSTRING(title,2,5);*
 *
 *
 *dump B;*
 *describe B;*
 *
 *
 *
 *

 *results:*
 *
 *

 *(tle)*
 *(tle)*
 *B: {chararray}*




 i try, this like ERIC LEE inthe other mail  and have the same results:


  Anyways, what I really what is the column value, not the name. Is there a
 way to do that? I listed all of the failed attempts I made below.

- colnames = FOREACH cols GENERATE $1 and was told $1 was out of
bounds.
- casted = FOREACH cols GENERATE (tuple(chararray, chararray))$0; but
all I got back were empty tuples
- values = FOREACH cols GENERATE $0.$1; but I got an error telling me
data byte array can't be casted to tuple


 Please, I will appreciate any help


 Regards









-- 

Miguel Angel Martín Junquera
Analyst Engineer.
miguelangel.mar...@brainsins.com
Tel. / Fax: (+34) 91 485 56 66
*http://www.brainsins.com*
Smart eCommerce
*Madrid*: http://goo.gl/4B5kv
*London*: http://goo.gl/uIXdv
*Barcelona*: http://goo.gl/NZslW

Antes de imprimir este e-mail, piense si es necesario.
La legislación española ampara el secreto de las comunicaciones. Este
correo electrónico es estrictamente confidencial y va dirigido
exclusivamente a su destinatario/a. Si no es Ud., le rogamos que no difunda
ni copie la transmisión y nos lo notifique cuanto antes.


Re: how can i get the column value? Need help!.. cassandra 1.28 and pig 0.11.1

2013-08-28 Thread Miguel Angel Martin junquera
hi:

I can not understand why the schema is  define like
*id:chararray,age:int,title:chararray
 and it does not define like tuples or bag tuples,  if we have pair
key-values  columns*
*
*
*
*
*I try other time to change schema  but it does not work.*
*
*
*any ideas ...*
*
*
*perhaps, is the issue in the definition cql3 tables ?*
*
*
*regards*


2013/8/28 Miguel Angel Martin junquera mianmarjun.mailingl...@gmail.com

 hi all:


 Regards

 Still i can resolve this issue. .

 does anybody have this issue or try to test this simple example?


 i am stumped I can not find a solution working.

 I appreciate any comment or help


 2013/8/22 Miguel Angel Martin junquera mianmarjun.mailingl...@gmail.com

 hi all:




 I,m testing the new CqlStorage() with cassandra 1.28 and pig 0.11.1


 I am using this sample data test:


 http://frommyworkshop.blogspot.com.es/2013/07/hadoop-map-reduce-with-cassandra.html

 And I load and dump data Righ with this script:

 *rows = LOAD
 'cql://keyspace1/test?page_size=1split_size=4where_clause=age%3D30' USING
 CqlStorage();*
 *
 *
 *dump rows;*
 *describe rows;*
 *
 *

 *resutls:

 ((id,6),(age,30),(title,QA))

 ((id,5),(age,30),(title,QA))

 rows: {id: chararray,age: int,title: chararray}


 *


 But i can not  get  the column values

 I try to define   another schemas in Load like I used with
 cassandraStorage()


 http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Cassandra-and-Pig-how-to-get-column-values-td5641158.html


 example:

 *rows = LOAD
 'cql://keyspace1/test?page_size=1split_size=4where_clause=age%3D30' USING
 CqlStorage() AS (columns: bag {T: tuple(name, value)});*


 and I get this error:

 *2013-08-22 12:24:45,426 [main] ERROR org.apache.pig.tools.grunt.Grunt -
 ERROR 1031: Incompatable schema: left is
 columns:bag{T:tuple(name:bytearray,value:bytearray)}, right is
 id:chararray,age:int,title:chararray*




 I try to use, FLATTEN, SUBSTRING, SPLIT UDF`s but i have not get good
 result:

 Example:


- when I flatten , I get a set of tuples like

 *(title,QA)*

 *(title,QA)*

 *2013-08-22 12:42:20,673 [main] INFO
  org.apache.pig.backend.hadoop.executionengine.util.MapRedUtil - Total
 input paths to process : 1*

 *A: {title: chararray}*



 but i can get value QA

 Sustring only works with title



 example:

 *B = FOREACH A GENERATE SUBSTRING(title,2,5);*
 *
 *
 *dump B;*
 *describe B;*
 *
 *
 *
 *

 *results:*
 *
 *

 *(tle)*
 *(tle)*
 *B: {chararray}*




 i try, this like ERIC LEE inthe other mail  and have the same results:


  Anyways, what I really what is the column value, not the name. Is there
 a way to do that? I listed all of the failed attempts I made below.

- colnames = FOREACH cols GENERATE $1 and was told $1 was out of
bounds.
- casted = FOREACH cols GENERATE (tuple(chararray, chararray))$0; but
all I got back were empty tuples
- values = FOREACH cols GENERATE $0.$1; but I got an error telling me
data byte array can't be casted to tuple


 Please, I will appreciate any help


 Regards









 --

 Miguel Angel Martín Junquera
 Analyst Engineer.
 miguelangel.mar...@brainsins.com
 Tel. / Fax: (+34) 91 485 56 66
 *http://www.brainsins.com*
 Smart eCommerce
 *Madrid*: http://goo.gl/4B5kv
  *London*: http://goo.gl/uIXdv
  *Barcelona*: http://goo.gl/NZslW

 Antes de imprimir este e-mail, piense si es necesario.
 La legislación española ampara el secreto de las comunicaciones. Este
 correo electrónico es estrictamente confidencial y va dirigido
 exclusivamente a su destinatario/a. Si no es Ud., le rogamos que no difunda
 ni copie la transmisión y nos lo notifique cuanto antes.




-- 

Miguel Angel Martín Junquera
Analyst Engineer.
miguelangel.mar...@brainsins.com


CQL: Prepared statements

2013-08-28 Thread Jorge Bay Gondra
Hi,

I'm developing the Node.js CQL
Driverhttps://github.com/jorgebay/node-cassandra-cql and
I've just finished implementing prepared statements through the binary
protocol...

I would like to provide driver users some guidance (use prepared queries
when X / use normal queries when Y): Is there any good user documentation
on prepared statements that I could point to?

For me, I would recommend prepared statements because parameters are binary
encoded instead of being stringified as it happends while executing a
regular query. This is specially correct when dealing with blobs and other
binary data (blob bytes - string - bytes).

Thanks,
J


Re: CQL: Prepared statements

2013-08-28 Thread Vassilis Bekiaris
Hi,

I think the introductory paragraphs in the Java Driver documentation [1]
provide good justification on the use of prepared statements:

 ... but you can also use prepared statements, which only need to be
parsed once by the cluster, and then bind values to the variables and
execute the bound statement you read or write data to a cluster.

In the previous tutorial, you added a loadData method which creates a
new statement for each INSERT, but you may also use prepared statements
and bind new values to the columns each time before execution. Doing
this increases performance, especially for repeated queries.

Cheers!

[1]
http://www.datastax.com/documentation/developer/java-driver/1.0/webhelp/index.html#java-driver/quick_start/qsSimpleClientBoundStatements_t.html

On 28/8/13 13:45 , Jorge Bay Gondra wrote:
 Hi,

 I'm developing the Node.js CQL Driver
 https://github.com/jorgebay/node-cassandra-cql and I've just
 finished implementing prepared statements through the binary protocol... 

 I would like to provide driver users some guidance (use prepared
 queries when X / use normal queries when Y): Is there any good user
 documentation on prepared statements that I could point to?

 For me, I would recommend prepared statements because parameters are
 binary encoded instead of being stringified as it happends while
 executing a regular query. This is specially correct when dealing with
 blobs and other binary data (blob bytes - string - bytes). 

 Thanks,
 J



Re: CQL: Prepared statements

2013-08-28 Thread Jorge Bay Gondra
Nice!!!
Thanks!


2013/8/28 Vassilis Bekiaris bekiar...@iconplatforms.com

  Hi,

 I think the introductory paragraphs in the Java Driver documentation [1]
 provide good justification on the use of prepared statements:

  ... but you can also use prepared statements, which only need to be
 parsed once by the cluster, and then bind values to the variables and
 execute the bound statement you read or write data to a cluster.

 In the previous tutorial, you added a loadData method which creates a new
 statement for each INSERT, but you may also use prepared statements and
 bind new values to the columns each time before execution. Doing this
 increases performance, especially for repeated queries.

 Cheers!

 [1]
 http://www.datastax.com/documentation/developer/java-driver/1.0/webhelp/index.html#java-driver/quick_start/qsSimpleClientBoundStatements_t.html


 On 28/8/13 13:45 , Jorge Bay Gondra wrote:

 Hi,

 I'm developing the Node.js CQL 
 Driverhttps://github.com/jorgebay/node-cassandra-cql and
 I've just finished implementing prepared statements through the binary
 protocol...

  I would like to provide driver users some guidance (use prepared queries
 when X / use normal queries when Y): Is there any good user documentation
 on prepared statements that I could point to?

  For me, I would recommend prepared statements because parameters are
 binary encoded instead of being stringified as it happends while
 executing a regular query. This is specially correct when dealing with
 blobs and other binary data (blob bytes - string - bytes).

  Thanks,
 J





Re: How to perform range queries efficiently?

2013-08-28 Thread Sávio Teles
I can populate again. We are modelling the data yet! Tks.


2013/8/28 Vivek Mishra mishra.v...@gmail.com

 Just saw that you already have data populated, so i guess modifying for
 composite key may not work for you.

 -Vivek


 On Tue, Aug 27, 2013 at 11:55 PM, Sávio Teles savio.te...@lupa.inf.ufg.br
  wrote:

 Vivek, using a composite key, how would be the query?


 2013/8/27 Vivek Mishra mishra.v...@gmail.com

 For such queries, looks like you may create a composite key as
 (user_id,age, salary).

 Too much indexing always kills(irrespective of RDBMS or NoSQL). Remember
 every search request on secondary indexes will be passed on each node in
 ring.

 -Vivek


 On Tue, Aug 27, 2013 at 11:11 PM, Sávio Teles 
 savio.te...@lupa.inf.ufg.br wrote:

 Use a database that is designed for efficient range queries? ;D


 Is there no way to do this with Cassandra? Like using Hive, Sorl...


 2013/8/27 Robert Coli rc...@eventbrite.com

 On Fri, Aug 23, 2013 at 5:53 AM, Sávio Teles 
 savio.te...@lupa.inf.ufg.br wrote:

 I need to perform range query efficiently.

 ...

 This query takes a long time to run. Any ideas to perform it
 efficiently?


 Use a database that is designed for efficient range queries? ;D

 =Rob





 --
 Atenciosamente,
 Sávio S. Teles de Oliveira
 voice: +55 62 9136 6996
 http://br.linkedin.com/in/savioteles
  Mestrando em Ciências da Computação - UFG
 Arquiteto de Software
 Laboratory for Ubiquitous and Pervasive Applications (LUPA) - UFG





 --
 Atenciosamente,
 Sávio S. Teles de Oliveira
 voice: +55 62 9136 6996
 http://br.linkedin.com/in/savioteles
  Mestrando em Ciências da Computação - UFG
 Arquiteto de Software
 Laboratory for Ubiquitous and Pervasive Applications (LUPA) - UFG





-- 
Atenciosamente,
Sávio S. Teles de Oliveira
voice: +55 62 9136 6996
http://br.linkedin.com/in/savioteles
Mestrando em Ciências da Computação - UFG
Arquiteto de Software
Laboratory for Ubiquitous and Pervasive Applications (LUPA) - UFG


PendingTasks: What does it mean inside Cassandra?

2013-08-28 Thread Girish Kumar
Hi,

I have this problem of lots of pending tasks in Cassandra when I run
Cassandra with higher load. (Cassandra Stress threads set to 384).

The tpstat output shows high number Pending tasks  700.

When high number of Pending tasks are showing up what it means to
cassandra? What are the reasons for high number pending tasks?  Does that
mean Cassandra is overloaded ?

This question is in continuation with my earlier question on activecount
and pending task co-relation!!!

Thanks,
/BK


Re: How to perform range queries efficiently?

2013-08-28 Thread Vivek Mishra
Create a column family of compositeType (or PRIMARY KEY) as (user_id,age,
salary).

Then you will be able to query use eq operator  over partition key and as
well over clustering key:

You may also exclude salary as a secondary index rather than part of
cluster key(e.g. age,salary)

I am sure based on your query usage, you can opt for either a composite key
or may mix composite key with secondary index !

Have a look at:
http://www.datastax.com/dev/blog/introduction-to-composite-columns-part-1

Hope it helps.


-Vivek


On Wed, Aug 28, 2013 at 5:49 PM, Sávio Teles savio.te...@lupa.inf.ufg.brwrote:

 I can populate again. We are modelling the data yet! Tks.


 2013/8/28 Vivek Mishra mishra.v...@gmail.com

 Just saw that you already have data populated, so i guess modifying for
 composite key may not work for you.

 -Vivek


 On Tue, Aug 27, 2013 at 11:55 PM, Sávio Teles 
 savio.te...@lupa.inf.ufg.br wrote:

 Vivek, using a composite key, how would be the query?


 2013/8/27 Vivek Mishra mishra.v...@gmail.com

 For such queries, looks like you may create a composite key as
 (user_id,age, salary).

 Too much indexing always kills(irrespective of RDBMS or NoSQL).
 Remember every search request on secondary indexes will be passed on each
 node in ring.

 -Vivek


 On Tue, Aug 27, 2013 at 11:11 PM, Sávio Teles 
 savio.te...@lupa.inf.ufg.br wrote:

 Use a database that is designed for efficient range queries? ;D


 Is there no way to do this with Cassandra? Like using Hive, Sorl...


 2013/8/27 Robert Coli rc...@eventbrite.com

 On Fri, Aug 23, 2013 at 5:53 AM, Sávio Teles 
 savio.te...@lupa.inf.ufg.br wrote:

 I need to perform range query efficiently.

 ...

 This query takes a long time to run. Any ideas to perform it
 efficiently?


 Use a database that is designed for efficient range queries? ;D

 =Rob





 --
 Atenciosamente,
 Sávio S. Teles de Oliveira
 voice: +55 62 9136 6996
 http://br.linkedin.com/in/savioteles
  Mestrando em Ciências da Computação - UFG
 Arquiteto de Software
 Laboratory for Ubiquitous and Pervasive Applications (LUPA) - UFG





 --
 Atenciosamente,
 Sávio S. Teles de Oliveira
 voice: +55 62 9136 6996
 http://br.linkedin.com/in/savioteles
  Mestrando em Ciências da Computação - UFG
 Arquiteto de Software
 Laboratory for Ubiquitous and Pervasive Applications (LUPA) - UFG





 --
 Atenciosamente,
 Sávio S. Teles de Oliveira
 voice: +55 62 9136 6996
 http://br.linkedin.com/in/savioteles
  Mestrando em Ciências da Computação - UFG
 Arquiteto de Software
 Laboratory for Ubiquitous and Pervasive Applications (LUPA) - UFG



cassandra-stress Daemon Mode

2013-08-28 Thread Adam H
Greetings.

I'm just trying the cassandra-stressd daemon for the first time in 1.2.8.
When I try to start a stress session on it, I'm getting an exception on
startup of cassandra-stress:

% bin/cassandra-stress --nodesfile=nodes
--strategy-properties=datacenter1:3
--replication-strategy=NetworkTopologyStrategy --operation INSERT
--num-keys 100 -T 127.0.0.1
Exception in thread main java.io.NotSerializableException:
org.apache.cassandra.config.EncryptionOptions$ClientEncryptionOptions
...
at org.apache.cassandra.stress.Stress.main(Unknown Source)

Looking at the code, it looks like the Session object was made
unserializable as of this
changehttps://issues.apache.org/jira/browse/CASSANDRA-4239
.

Is this daemon no longer a supported mode of operation, or am I completely
missing something in how I'm using it?

Any insight would be appreciated.

Regards,
Adam


Re: CQL: Prepared statements

2013-08-28 Thread Alex Popescu
On Wed, Aug 28, 2013 at 4:01 AM, Vassilis Bekiaris 
bekiar...@iconplatforms.com wrote:

  Hi,

 I think the introductory paragraphs in the Java Driver documentation [1]
 provide good justification on the use of prepared statements:

  ... but you can also use prepared statements, which only need to be
 parsed once by the cluster, and then bind values to the variables and
 execute the bound statement you read or write data to a cluster.

 In the previous tutorial, you added a loadData method which creates a new
 statement for each INSERT, but you may also use prepared statements and
 bind new values to the columns each time before execution. Doing this
 increases performance, especially for repeated queries.

 Cheers!

 [1]
 http://www.datastax.com/documentation/developer/java-driver/1.0/webhelp/index.html#java-driver/quick_start/qsSimpleClientBoundStatements_t.html



I think PreparedStatements should almost always be the recommended way (no
stringification, performance, etc.).  Except maybe statements that you are
sure they'll be run only once,

:- a)


Alex Popescu
@al3xandru


configuring read write quorums in cassandra

2013-08-28 Thread Muntasir Raihan Rahman
Hello,

Are there any tools (e.g like nodetool) that could be used to change
the cassandra read and write quorums at run-time?

In general what is a good strategy of changing these system parameters
while cassandra is running?

Any pointers could be useful!

Thanks
Muntasir.


Re: configuring read write quorums in cassandra

2013-08-28 Thread Andrey Ilinykh
What do you mean to change the cassandra read and write quorums? Quorum
is quorum, 2 of 3 for example. What do you want to change?

Andrey


On Wed, Aug 28, 2013 at 1:33 PM, Muntasir Raihan Rahman 
muntasir.rai...@gmail.com wrote:

 Hello,

 Are there any tools (e.g like nodetool) that could be used to change
 the cassandra read and write quorums at run-time?

 In general what is a good strategy of changing these system parameters
 while cassandra is running?

 Any pointers could be useful!

 Thanks
 Muntasir.



Re: configuring read write quorums in cassandra

2013-08-28 Thread Muntasir Raihan Rahman
Sorry, let me clarify.

Let us say I set read consistency level = ONE, and I am running the
system for a while. Then I want to change the read consistency level
to TWO so that reads now wait to hear back from 2 replicas instead of
1 before responding to the client. I want to change this consistency
level, and then continue running the system.

Does that clarify my query?

Thanks
Muntasir.

On Wed, Aug 28, 2013 at 3:39 PM, Andrey Ilinykh ailin...@gmail.com wrote:
 What do you mean to change the cassandra read and write quorums? Quorum is
 quorum, 2 of 3 for example. What do you want to change?

 Andrey


 On Wed, Aug 28, 2013 at 1:33 PM, Muntasir Raihan Rahman
 muntasir.rai...@gmail.com wrote:

 Hello,

 Are there any tools (e.g like nodetool) that could be used to change
 the cassandra read and write quorums at run-time?

 In general what is a good strategy of changing these system parameters
 while cassandra is running?

 Any pointers could be useful!

 Thanks
 Muntasir.





-- 
Best Regards
Muntasir Raihan Rahman
Email: muntasir.rai...@gmail.com
Department of Computer Science,
University of Illinois Urbana Champaign,
3111 Siebel Center,
201 N. Goodwin Avenue,
Urbana, IL  61801


Re: configuring read write quorums in cassandra

2013-08-28 Thread Andrey Ilinykh
Each query has its own consistency level. It has nothing to do with
cassandra.


On Wed, Aug 28, 2013 at 1:48 PM, Muntasir Raihan Rahman 
muntasir.rai...@gmail.com wrote:

 Sorry, let me clarify.

 Let us say I set read consistency level = ONE, and I am running the
 system for a while. Then I want to change the read consistency level
 to TWO so that reads now wait to hear back from 2 replicas instead of
 1 before responding to the client. I want to change this consistency
 level, and then continue running the system.

 Does that clarify my query?

 Thanks
 Muntasir.

 On Wed, Aug 28, 2013 at 3:39 PM, Andrey Ilinykh ailin...@gmail.com
 wrote:
  What do you mean to change the cassandra read and write quorums?
 Quorum is
  quorum, 2 of 3 for example. What do you want to change?
 
  Andrey
 
 
  On Wed, Aug 28, 2013 at 1:33 PM, Muntasir Raihan Rahman
  muntasir.rai...@gmail.com wrote:
 
  Hello,
 
  Are there any tools (e.g like nodetool) that could be used to change
  the cassandra read and write quorums at run-time?
 
  In general what is a good strategy of changing these system parameters
  while cassandra is running?
 
  Any pointers could be useful!
 
  Thanks
  Muntasir.
 
 



 --
 Best Regards
 Muntasir Raihan Rahman
 Email: muntasir.rai...@gmail.com
 Department of Computer Science,
 University of Illinois Urbana Champaign,
 3111 Siebel Center,
 201 N. Goodwin Avenue,
 Urbana, IL  61801



Re: configuring read write quorums in cassandra

2013-08-28 Thread Robert Coli
On Wed, Aug 28, 2013 at 1:48 PM, Muntasir Raihan Rahman 
muntasir.rai...@gmail.com wrote:

 Let us say I set read consistency level = ONE, and I am running the
 system for a while. Then I want to change the read consistency level
 to TWO so that reads now wait to hear back from 2 replicas instead of
 1 before responding to the client.


In general, TWO is only for users who really know what they are doing. Most
users will use ONE or *_QUORUM.

But changing it is just a matter of changing the ConsistencyLevel of your
new requests, in your application code.

Changing *replication factor* is a bit more involved.

=Rob


Re: configuring read write quorums in cassandra

2013-08-28 Thread Muntasir Raihan Rahman
Thanks for clarifying that!

Muntasir.

On Wed, Aug 28, 2013 at 3:51 PM, Andrey Ilinykh ailin...@gmail.com wrote:
 Each query has its own consistency level. It has nothing to do with
 cassandra.


 On Wed, Aug 28, 2013 at 1:48 PM, Muntasir Raihan Rahman
 muntasir.rai...@gmail.com wrote:

 Sorry, let me clarify.

 Let us say I set read consistency level = ONE, and I am running the
 system for a while. Then I want to change the read consistency level
 to TWO so that reads now wait to hear back from 2 replicas instead of
 1 before responding to the client. I want to change this consistency
 level, and then continue running the system.

 Does that clarify my query?

 Thanks
 Muntasir.

 On Wed, Aug 28, 2013 at 3:39 PM, Andrey Ilinykh ailin...@gmail.com
 wrote:
  What do you mean to change the cassandra read and write quorums?
  Quorum is
  quorum, 2 of 3 for example. What do you want to change?
 
  Andrey
 
 
  On Wed, Aug 28, 2013 at 1:33 PM, Muntasir Raihan Rahman
  muntasir.rai...@gmail.com wrote:
 
  Hello,
 
  Are there any tools (e.g like nodetool) that could be used to change
  the cassandra read and write quorums at run-time?
 
  In general what is a good strategy of changing these system parameters
  while cassandra is running?
 
  Any pointers could be useful!
 
  Thanks
  Muntasir.
 
 



 --
 Best Regards
 Muntasir Raihan Rahman
 Email: muntasir.rai...@gmail.com
 Department of Computer Science,
 University of Illinois Urbana Champaign,
 3111 Siebel Center,
 201 N. Goodwin Avenue,
 Urbana, IL  61801





-- 
Best Regards
Muntasir Raihan Rahman
Email: muntasir.rai...@gmail.com
Department of Computer Science,
University of Illinois Urbana Champaign,
3111 Siebel Center,
201 N. Goodwin Avenue,
Urbana, IL  61801


Re: configuring read write quorums in cassandra

2013-08-28 Thread Muntasir Raihan Rahman
Thanks!

Muntasir.

On Wed, Aug 28, 2013 at 3:52 PM, Robert Coli rc...@eventbrite.com wrote:
 On Wed, Aug 28, 2013 at 1:48 PM, Muntasir Raihan Rahman
 muntasir.rai...@gmail.com wrote:

 Let us say I set read consistency level = ONE, and I am running the
 system for a while. Then I want to change the read consistency level
 to TWO so that reads now wait to hear back from 2 replicas instead of
 1 before responding to the client.


 In general, TWO is only for users who really know what they are doing. Most
 users will use ONE or *_QUORUM.

 But changing it is just a matter of changing the ConsistencyLevel of your
 new requests, in your application code.

 Changing *replication factor* is a bit more involved.

 =Rob




-- 
Best Regards
Muntasir Raihan Rahman
Email: muntasir.rai...@gmail.com
Department of Computer Science,
University of Illinois Urbana Champaign,
3111 Siebel Center,
201 N. Goodwin Avenue,
Urbana, IL  61801


Re: Setting up a multi-node cluster

2013-08-28 Thread John Pyeatt
Have you verified that your firewall is configured for the cassandra
traffic. At the very least you need to make certain the following ports are
open between nodes: 7000, 7001, 7199, 9160, 61620 and 61621.


On Wed, Aug 28, 2013 at 12:36 AM, Dinesh dinesh.gad...@gmail.com wrote:

 In my case rpc_address in both the nodes is set to 0.0.0.0 which means it
 listens on all interfaces. it has a larger scope (to listen on all
 localhost, ipv4, hostnames, ipv6 addresses) than providing just the
 hostname/ipv4 addresses

 anyway I initially checked that, but it's the same exception I got in this
 case also




 On Wed, Aug 28, 2013 at 10:40 AM, Naresh Yadav nyadav@gmail.comwrote:


 You would need to configure rpc_address also with hostname/ips on both
 the nodes.

 Naresh

 On Wed, Aug 28, 2013 at 10:15 AM, Dinesh dinesh.gad...@gmail.com wrote:

 Hi,

 I am trying to setup a two node Cassandra cluster

 Able to start the first node, but not seeing the following exception
 while starting the second node

 ERROR 17:31:34,315 Exception encountered during startup
 java.lang.IllegalStateException: Unable to contact any seeds!
 at
 org.apache.cassandra.service.StorageService.bootstrap(StorageService.java:947)
 at
 org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:716)
 at
 org.apache.cassandra.service.StorageService.initServer(StorageService.java:554)
 at
 org.apache.cassandra.service.StorageService.initServer(StorageService.java:451)
 at
 org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:348)
 at
 org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:447)
 at
 org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:490)
 java.lang.IllegalStateException: Unable to contact any seeds!
 at
 org.apache.cassandra.service.StorageService.bootstrap(StorageService.java:947)
 at
 org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:716)
 at
 org.apache.cassandra.service.StorageService.initServer(StorageService.java:554)
 at
 org.apache.cassandra.service.StorageService.initServer(StorageService.java:451)
 at
 org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:348)
 at
 org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:447)
 at
 org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:490)
 Exception encountered during startup: Unable to contact any seeds!
 ERROR 17:31:34,322 Exception in thread
 Thread[StorageServiceShutdownHook,5,main]
 java.lang.NullPointerException
 at
 org.apache.cassandra.service.StorageService.stopRPCServer(StorageService.java:321)
 at
 org.apache.cassandra.service.StorageService.shutdownClientServers(StorageService.java:370)
 at
 org.apache.cassandra.service.StorageService.access$000(StorageService.java:88)




 =
 My yaml configuration files have these modified


 first node yaml
 ---
 initial_token: -9223372036854775808 # generated this using tokengen tool
 seeds: 10.96.19.207 # which is the IP of first node
 listen_address: 10.96.19.207 # which is the IP of first node itself
 rpc_address: 0.0.0.0

 second node yaml
 
 initial_token: 0
 seeds: 10.96.19.207 # which is the IP of first node
 listen_address: 10.96.10.223 # which is the IP of second node
 rpc_address: 0.0.0.0


 ==

 Can anyone please help me what went wrong with my configuration?

 Regards
 Dinesh









 --
 Regards
 Dinesh




-- 
John Pyeatt
Singlewire Software, LLC
www.singlewire.com
--
608.661.1184
john.pye...@singlewire.com


How many seed nodes should I use?

2013-08-28 Thread Ike Walker
What is the best practice for how many seed nodes to have in a Cassandra 
cluster? I remember reading a recommendation of 2 seeds per datacenter in 
Datastax documentation for 0.7, but I'm interested to know what other people 
are doing these days, especially in AWS.

I'm running a cluster of 12 nodes at AWS. Each node runs Cassandra 1.2.5 on an 
m1.xlarge EC2 instance, and they are spread across 3 availability zones within 
a single region.

To keep things simple I currently have all 12 nodes listed as seeds. That seems 
like overkill to me, but I don't know the pros and cons of too many or too few 
seeds.

Any advice is appreciated.

Thanks!

-Ike Walker

Re: Setting up a multi-node cluster

2013-08-28 Thread Dinesh
Hi John,

I had my firewall disabled in both the nodes
To make sure. I checked it
# rcSuSEfirewall2 status
Checking the status of SuSEfirewall2
 unused

if it's, on it says running

Please suggest the further steps, where to look and troubleshoot, if you
have any idea






On Thu, Aug 29, 2013 at 2:34 AM, John Pyeatt john.pye...@singlewire.comwrote:

 Have you verified that your firewall is configured for the cassandra
 traffic. At the very least you need to make certain the following ports are
 open between nodes: 7000, 7001, 7199, 9160, 61620 and 61621.


 On Wed, Aug 28, 2013 at 12:36 AM, Dinesh dinesh.gad...@gmail.com wrote:

 In my case rpc_address in both the nodes is set to 0.0.0.0 which means it
 listens on all interfaces. it has a larger scope (to listen on all
 localhost, ipv4, hostnames, ipv6 addresses) than providing just the
 hostname/ipv4 addresses

 anyway I initially checked that, but it's the same exception I got in
 this case also




 On Wed, Aug 28, 2013 at 10:40 AM, Naresh Yadav nyadav@gmail.comwrote:


 You would need to configure rpc_address also with hostname/ips on both
 the nodes.

 Naresh

 On Wed, Aug 28, 2013 at 10:15 AM, Dinesh dinesh.gad...@gmail.comwrote:

 Hi,

 I am trying to setup a two node Cassandra cluster

 Able to start the first node, but not seeing the following exception
 while starting the second node

 ERROR 17:31:34,315 Exception encountered during startup
 java.lang.IllegalStateException: Unable to contact any seeds!
 at
 org.apache.cassandra.service.StorageService.bootstrap(StorageService.java:947)
 at
 org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:716)
 at
 org.apache.cassandra.service.StorageService.initServer(StorageService.java:554)
 at
 org.apache.cassandra.service.StorageService.initServer(StorageService.java:451)
 at
 org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:348)
 at
 org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:447)
 at
 org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:490)
 java.lang.IllegalStateException: Unable to contact any seeds!
 at
 org.apache.cassandra.service.StorageService.bootstrap(StorageService.java:947)
 at
 org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:716)
 at
 org.apache.cassandra.service.StorageService.initServer(StorageService.java:554)
 at
 org.apache.cassandra.service.StorageService.initServer(StorageService.java:451)
 at
 org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:348)
 at
 org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:447)
 at
 org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:490)
 Exception encountered during startup: Unable to contact any seeds!
 ERROR 17:31:34,322 Exception in thread
 Thread[StorageServiceShutdownHook,5,main]
 java.lang.NullPointerException
 at
 org.apache.cassandra.service.StorageService.stopRPCServer(StorageService.java:321)
 at
 org.apache.cassandra.service.StorageService.shutdownClientServers(StorageService.java:370)
 at
 org.apache.cassandra.service.StorageService.access$000(StorageService.java:88)




 =
 My yaml configuration files have these modified


 first node yaml
 ---
 initial_token: -9223372036854775808 # generated this using tokengen tool
 seeds: 10.96.19.207 # which is the IP of first node
 listen_address: 10.96.19.207 # which is the IP of first node itself
 rpc_address: 0.0.0.0

 second node yaml
 
 initial_token: 0
 seeds: 10.96.19.207 # which is the IP of first node
 listen_address: 10.96.10.223 # which is the IP of second node
 rpc_address: 0.0.0.0


 ==

 Can anyone please help me what went wrong with my configuration?

 Regards
 Dinesh









 --
 Regards
 Dinesh




 --
 John Pyeatt
 Singlewire Software, LLC
 www.singlewire.com
 --
 608.661.1184
 john.pye...@singlewire.com




-- 
Regards
Dinesh


Re: Setting up a multi-node cluster

2013-08-28 Thread Andrey Ilinykh
To be sure ports are open try to connect from one node to  another:

telnet node ip 7000

try all ports.

Andrey


On Wed, Aug 28, 2013 at 10:41 PM, Dinesh dinesh.gad...@gmail.com wrote:

 Hi John,

 I had my firewall disabled in both the nodes
 To make sure. I checked it
 # rcSuSEfirewall2 status
 Checking the status of SuSEfirewall2
  unused

 if it's, on it says running

 Please suggest the further steps, where to look and troubleshoot, if you
 have any idea






 On Thu, Aug 29, 2013 at 2:34 AM, John Pyeatt 
 john.pye...@singlewire.comwrote:

 Have you verified that your firewall is configured for the cassandra
 traffic. At the very least you need to make certain the following ports are
 open between nodes: 7000, 7001, 7199, 9160, 61620 and 61621.


 On Wed, Aug 28, 2013 at 12:36 AM, Dinesh dinesh.gad...@gmail.com wrote:

 In my case rpc_address in both the nodes is set to 0.0.0.0 which means
 it listens on all interfaces. it has a larger scope (to listen on all
 localhost, ipv4, hostnames, ipv6 addresses) than providing just the
 hostname/ipv4 addresses

 anyway I initially checked that, but it's the same exception I got in
 this case also




 On Wed, Aug 28, 2013 at 10:40 AM, Naresh Yadav nyadav@gmail.comwrote:


 You would need to configure rpc_address also with hostname/ips on both
 the nodes.

 Naresh

 On Wed, Aug 28, 2013 at 10:15 AM, Dinesh dinesh.gad...@gmail.comwrote:

 Hi,

 I am trying to setup a two node Cassandra cluster

 Able to start the first node, but not seeing the following exception
 while starting the second node

 ERROR 17:31:34,315 Exception encountered during startup
 java.lang.IllegalStateException: Unable to contact any seeds!
 at
 org.apache.cassandra.service.StorageService.bootstrap(StorageService.java:947)
 at
 org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:716)
 at
 org.apache.cassandra.service.StorageService.initServer(StorageService.java:554)
 at
 org.apache.cassandra.service.StorageService.initServer(StorageService.java:451)
 at
 org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:348)
 at
 org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:447)
 at
 org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:490)
 java.lang.IllegalStateException: Unable to contact any seeds!
 at
 org.apache.cassandra.service.StorageService.bootstrap(StorageService.java:947)
 at
 org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:716)
 at
 org.apache.cassandra.service.StorageService.initServer(StorageService.java:554)
 at
 org.apache.cassandra.service.StorageService.initServer(StorageService.java:451)
 at
 org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:348)
 at
 org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:447)
 at
 org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:490)
 Exception encountered during startup: Unable to contact any seeds!
 ERROR 17:31:34,322 Exception in thread
 Thread[StorageServiceShutdownHook,5,main]
 java.lang.NullPointerException
 at
 org.apache.cassandra.service.StorageService.stopRPCServer(StorageService.java:321)
 at
 org.apache.cassandra.service.StorageService.shutdownClientServers(StorageService.java:370)
 at
 org.apache.cassandra.service.StorageService.access$000(StorageService.java:88)




 =
 My yaml configuration files have these modified


 first node yaml
 ---
 initial_token: -9223372036854775808 # generated this using tokengen
 tool
 seeds: 10.96.19.207 # which is the IP of first node
 listen_address: 10.96.19.207 # which is the IP of first node itself
 rpc_address: 0.0.0.0

 second node yaml
 
 initial_token: 0
 seeds: 10.96.19.207 # which is the IP of first node
 listen_address: 10.96.10.223 # which is the IP of second node
 rpc_address: 0.0.0.0


 ==

 Can anyone please help me what went wrong with my configuration?

 Regards
 Dinesh









 --
 Regards
 Dinesh




 --
 John Pyeatt
 Singlewire Software, LLC
 www.singlewire.com
 --
 608.661.1184
 john.pye...@singlewire.com




 --
 Regards
 Dinesh