Re: Memory overhead of vector clocks…. how often are they pruned?

2011-08-24 Thread Radim Kolar
From my point vector clocks is too much overhead. If you sync clocks in 
your cluster using NTP (which you should do anyway) you will get clock 
precision < 1/1000s which is good enough.


all my machines running NTP has offset < 1/1000s. They are FreeBSD, 
Linux is not that precise in clock syncing.


 remote   local  st poll reach  delay   offsetdisp
===
*barricade.rack9 64.6.104.18  2   64  377 0.06187  0.000996 0.05093


Re: preloading entire CF with SEQ access on startup

2011-08-24 Thread aaron morton
Nothing automatic, you can do it by using range slices that request 0 columns. 

Once you have a hot cache it will be automatically saved a re-loaded at startup 
if you have enabled row_cache_save_period or key_cache_save_period for the CF. 

Cheers

-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 23/08/2011, at 8:15 PM, Radim Kolar wrote:

> Is there way to preload entire CF into cache with seq access when server 
> starts?
> 
> I think that standard cache preloader is using random access and because of 
> that its so slow that we cant use it.



Re: multi-node cassandra config doubt

2011-08-24 Thread aaron morton
Did you get this sorted ? 

At a guess I would say there are no nodes listed in the Hadoop JobConf.

Cheers

-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 23/08/2011, at 9:51 PM, Thamizh wrote:

> Hi All,
> 
> This is regarding multi-node cluster configuration doubt.
> 
> I have configured 3 nodes of cluster using Cassandra-0.8.4 and getting error 
> when I ran Map/Reduce job which uploads records from HDFS to Cassandra.
> 
> Here are my 3 nodes cluster config file (cassandra.yaml) for Cassandra:
> 
> node01:
> seeds: "node01,node02,node03"
> auto_bootstrap: false
> listen_address: 192.168.0.1
> rpc_address: 192.168.0.1
> 
> 
> node02:
> 
> seeds: "node01,node02,node03"
> auto_bootstrap: true
> listen_address: 192.168.0.2
> rpc_address: 192.168.0.2
> 
> 
> node03:
> seeds: "node01,node02,node03"
> auto_bootstrap: true
> listen_address: 192.168.0.3
> rpc_address: 192.168.0.3
> 
> When I ran M/R program, I am getting below error
> 11/08/23 04:37:00 INFO mapred.JobClient:  map 100% reduce 11%
> 11/08/23 04:37:06 INFO mapred.JobClient:  map 100% reduce 22%
> 11/08/23 04:37:09 INFO mapred.JobClient:  map 100% reduce 33%
> 11/08/23 04:37:14 INFO mapred.JobClient: Task Id : 
> attempt_201104211044_0719_r_00_0, Status : FAILED
> java.lang.NullPointerException
> at org.apache.cassandra.client.RingCache.getRange(RingCache.java:130)
> at 
> org.apache.cassandra.hadoop.ColumnFamilyRecordWriter.write(ColumnFamilyRecordWriter.java:125)
> at 
> org.apache.cassandra.hadoop.ColumnFamilyRecordWriter.write(ColumnFamilyRecordWriter.java:60)
> at 
> org.apache.hadoop.mapreduce.TaskInputOutputContext.write(TaskInputOutputContext.java:80)
> at CassTblUploader$TblUploadReducer.reduce(CassTblUploader.java:90)
> at CassTblUploader$TblUploadReducer.reduce(CassTblUploader.java:1)
> at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:174)
> at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:563)
> at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:408)
> at org.apache.hadoop.mapred.Child.main(Child.java:170)
> 
> 
> Is anything wrong on my cassandra.yaml file?
> 
> I followed http://wiki.apache.org/cassandra/MultinodeCluster for cluster 
> configuration.
> 
> Regards,
> Thamizhannal



Re: run Cassandra tutorial example

2011-08-24 Thread aaron morton
HColumn(city=Austin) 
Is the data you are after. 

Have a look in src/main/resources/log4j.properties if you want to change the 
logging settings. 

Have fun. 
-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 24/08/2011, at 4:06 AM, Alvin UW wrote:

> Thanks.
> 
> By your solution, the problem is fixed.
> But my output is like this.
> I don't understand what's the meaning of " Error stacktraces are turned on." 
> And I hope only the results are outputted, not the INFO.
> 
>  mvn -e exec:java -Dexec.args="get" 
> -Dexec.mainClass="com.datastax.tutorial.TutorialRunner"
> + Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [INFO] 
> 
> [INFO] Building cassandra-tutorial
> [INFO]task-segment: [exec:java]
> [INFO] 
> 
> [INFO] Preparing exec:java
> [INFO] No goals needed for project - skipping
> [INFO] [exec:java {execution: default-cli}]
> HColumn(city=Austin)
> [INFO] 
> 
> [INFO] BUILD SUCCESSFUL
> [INFO] 
> 
> [INFO] Total time: 1 second
> [INFO] Finished at: Tue Aug 23 12:02:27 EDT 2011
> [INFO] Final Memory: 11M/100M
> 
> 
> 2011/8/23 aaron morton 
> Did you sort this out ? The #cassandra IRC room is a good place to get help 
> as well.
> 
> I tried to build it first using 
> mvn compile and got this different error 
> "[ERROR] Failed to execute goal on project cassandra-tutorial: Could not 
> resolve dependencies for project 
> com.datastax.tutorial:cassandra-tutorial:jar:1.0-SNAPSHOT: Could not find 
> artifact me.prettyprint:hector-core:jar:0.8.0-2-SNAPSHOT -> [Help 1]"
> 
> There is a fix here...
> https://github.com/zznate/cassandra-tutorial/pull/1
> 
> After than I did mvn compile and it worked. 
> 
> So added the schema…
> path-to-cassandra/bin/cassandra-cli --host localhost < 
> ~/code/github/datastax/cassandra-tutorial/npanxx_script.txt 
> 
> And ran 
> mvn -e exec:java -Dexec.args="get" 
> -Dexec.mainClass="com.datastax.tutorial.TutorialRunner"
> 
> Which outputted 
> HColumn(city=Austin)
> 
> Hope that helps. 
> 
> -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
> 
> On 23/08/2011, at 10:30 AM, Alvin UW wrote:
> 
>> Hello,
>> 
>> I'd like to try the cassandra tutorial example: 
>> https://github.com/zznate/cassandra-tutorial
>>  by following the readme.
>> 
>> After typing  mvn -e exec:java -Dexec.args="get" 
>> -Dexec.mainClass="com.datastax.tutorial.TutorialRunner"
>> I got the following errors.
>> Should I do something before the above command?
>> Thanks.
>> 
>> + Error stacktraces are turned on.
>> [INFO] Scanning for projects...
>> [INFO] 
>> 
>> [INFO] Building cassandra-tutorial
>> [INFO]task-segment: [exec:java]
>> [INFO] 
>> 
>> [INFO] Preparing exec:java
>> [INFO] No goals needed for project - skipping
>> [INFO] [exec:java {execution: default-cli}]
>> [INFO] 
>> 
>> [ERROR] BUILD ERROR
>> [INFO] 
>> 
>> [INFO] An exception occured while executing the Java class. 
>> com.datastax.tutorial.TutorialRunner
>> 
>> [INFO] 
>> 
>> [INFO] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: An exception occured 
>> while executing the Java class. com.datastax.tutorial.TutorialRunner
>> at 
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
>> at 
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
>> at 
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
>> at 
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
>> at 
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
>> at 
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>> at 
>> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeM

Re: Customized Secondary Index Schema

2011-08-24 Thread aaron morton
IMHO it's only a scalability problem if those nodes have trouble handling the 
throughput. The load will go all all replicas, not one, unless you turn off 
Read Repair. 

If it is a problem then you could manually partition the index into multiple 
rows, bit of a pain thought. I'd wait and see, or crunch some numbers before 
hand. 

Cheers

-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 24/08/2011, at 5:03 AM, Alvin UW wrote:

> Hello,
> 
> As mentioned by Ed Anuff in his blog and slides, one way to build customized 
> secondary index is:
> We use one CF, each row to represent a secondary index, with the secondary 
> index name as row key.
> For example,
> 
> Indexes = {
> "User_Keys_By_Last_Name" : {
> "adams" : "e5d61f2b-…",
> "alden" : "e80a17ba-…",
> "anderson" : "e5d61f2b-…",
> "davis" : "e719962b-…",
> "doe" : "e78ece0f-…",
> "franks" : "e66afd40-…",
> … : …,
> }
> }
> 
> But the whole secondary index is partitioned into a single node, because of 
> the row key.
> All the queries against this secondary index will go to this node. Of course, 
> there are some replica nodes.
> 
> Do you think this is a scalability problem, or any better solution to solve 
> it?
> Thanks.
> 
> 
> 
> 



Re: checksumming

2011-08-24 Thread aaron morton
At the file level see https://issues.apache.org/jira/browse/CASSANDRA-674

At the higher level there is node tool repair 
http://wiki.apache.org/cassandra/AntiEntropy. 

Cheers

-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 24/08/2011, at 11:04 AM, Bill Hastings wrote:

> Are checksum errors detected in Cassandra and if so how are they resolved?



Re: Could Not connect to cassandra-cli on windows

2011-08-24 Thread aaron morton
Not off the top of my head. 

Can you get 0.7.8 running with a pre-packaged client ? 

Cheers

-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 24/08/2011, at 12:16 PM, Alaa Zubaidi wrote:

> Hi Aaron,
> We are using Thrift 5..
>TSocket _tr = new TSocket(server.Host, server.Port);//"localhost", 
> 9160);
>_transport = new TFramedTransport(_tr);
>_protocol = new TBinaryProtocol(_transport);
>_client = new Cassandra.Client(_protocol);
> 
> Do you have any clue on what could cause the first exception?
> 
> Thanks and Regards.
> Alaa
> 
> On 8/18/2011 3:59 AM, aaron morton wrote:
>> IIRC cassandra 0.7 needs thrift 0.5, are you using that version ?
>> 
>> Perhaps try grabbing the cassandra 0.7 version for one of the pre built 
>> clients (pycassa, hector etc) to check things work and then check you are 
>> using the same thrift version.
>> 
>> Cheers
>> 
>> -
>> Aaron Morton
>> Freelance Cassandra Developer
>> @aaronmorton
>> http://www.thelastpickle.com
>> 
>> On 18/08/2011, at 4:03 PM, Alaa Zubaidi wrote:
>> 
>>> Hi Aaron,
>>> Thanks for the reply.
>>> I am running 0.7.4 and NO client.
>>> The error was reported by the application where it fails to connect and it 
>>> happens that 2 threads are trying to connect at the same time. and when I 
>>> checked the cassandra log I found these errors??
>>> 
>>> Thanks
>>> Alaa
>>> 
>>> On 8/17/2011 4:29 PM, aaron morton wrote:
 What client, what version, what version of cassandra are you using ?
 
 Looks like you are connecting with an old version of thrift, like the 
 message says. Check the client you are using was made for cassandra 0.8.
 
 Cheers
 
 -
 Aaron Morton
 Freelance Cassandra Developer
 @aaronmorton
 http://www.thelastpickle.com
 
 On 18/08/2011, at 7:27 AM, Alaa Zubaidi wrote:
 
> Hi,
> 
> I se this error while the application tries to connect to cassandra at 
> the same time from 2 different threads: any clues:
> 
> ERROR [pool-1-thread-13] 2011-07-29 06:46:45,718 
> CustomTThreadPoolServer.java (line 222) Error occurred during processing 
> of message.
> java.lang.StringIndexOutOfBoundsException: String index out of range: 
> -2147418111
>at java.lang.String.checkBounds(String.java:397)
>at java.lang.String.(String.java:442)
>at 
> org.apache.thrift.protocol.TBinaryProtocol.readString(TBinaryProtocol.java:339)
>at 
> org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:210)
>at 
> org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2543)
>at 
> org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:206)
>at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>at java.lang.Thread.run(Thread.java:662)
> ERROR [pool-1-thread-11] 2011-07-29 06:53:21,921 
> CustomTThreadPoolServer.java (line 218) Thrift error occurred during 
> processing of message.
> org.apache.thrift.protocol.TProtocolException: Missing version in 
> readMessageBegin, old client?
>at 
> org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:213)
>at 
> org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2543)
>at 
> org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:206)
>at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>at java.lang.Thread.run(Thread.java:662)
> 
> Thanks,
> Alaa
> 
 
>>> -- 
>>> Alaa Zubaidi
>>> PDF Solutions, Inc.
>>> 333 West San Carlos Street, Suite 700
>>> San Jose, CA 95110  USA
>>> Tel: 408-283-5639 (or 408-280-7900 x5639)
>>> fax: 408-938-6479
>>> email: alaa.zuba...@pdf.com
>>> 
>>> 
>> 
>> 
> 
> -- 
> Alaa Zubaidi
> PDF Solutions, Inc.
> 333 West San Carlos Street, Suite 700
> San Jose, CA 95110  USA
> Tel: 408-283-5639 (or 408-280-7900 x5639)
> fax: 408-938-6479
> email: alaa.zuba...@pdf.com
> 
> 



Re: cassandra unexpected shutdown

2011-08-24 Thread aaron morton
First thing is are you on 0.8 ? It has some automagical memory management that 
is both automatic and magical 
http://thelastpickle.com/2011/05/04/How-are-Memtables-measured/

Secondly if you are OOM'ing you need to look at how much memory your schema is 
taking. See the link above, or just use 0.8

Thirdly, try to reduce the cache as Adi noted. 

Finally try to work out when it's OOM'ing. Is it during a compaction, a repair, 
during peak load or just regular operations. With 1TB of data i'd be taking a 
look at the compaction or repair processes to see whats happening GC wise. Also 
check the GC settings as described in cassandra-env.sh

Hope that helps. 
 
-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 24/08/2011, at 12:38 PM, Ernst D Schoen-René wrote:

> Thanks,
>We had already been running cassandra with a larger heap size, but it 
> meant that java took way too long between garbage collections.  The advice 
> I'd found was to set the heap size at the 8 we're running at.  It was ok for 
> a while, but now some nodes crash.  It's definitely our experience that 
> adding more memory per node actually makes things worse eventually, as java 
> starts eating up too many resources for it to handle.
> 
> 
> On 8/23/11 5:28 PM, Adi wrote:
>> 2011/8/23 Ernst D Schoen-René:
>>> Hi,
>>>  I'm running a 16-node cassandra cluster, with a reasonably large amount of
>>> data per node (~1TB).  Nodes have 16G ram, but heap is set to 8G.
>>> 
>>> The nodes keep stopping with this output in the log.  Any ideas?
>>> 
>>> ERROR [Thread-85] 2011-08-23 21:00:38,723 AbstractCassandraDaemon.java (line
>>> 113) Fatal exception in thread Thread[Thread-85,5,main]
>>> java.lang.OutOfMemoryError: Java heap space
>>> ERROR [ReadStage:568] 2011-08-23 21:00:38,723 AbstractCassandraDaemon.java
>>> (line 113) Fatal exception in thread Thread[ReadStage:568,5,main]
>>> java.lang.OutOfMemoryError: Java heap space
>>>  INFO [HintedHandoff:1] 2011-08-23 21:00:38,720 HintedHandOffManager.java
>>> (line 320) Started hinted handoff for endpoint /10.28.0.184
>>>  INFO [GossipStage:2] 2011-08-23 21:00:50,751 Gossiper.java (line 606)
>>> InetAddress /10.29.20.67 is now UP
>>> ERROR [Thread-34] 2011-08-23 21:00:50,525 AbstractCassandraDaemon.java (line
>>> 113) Fatal exception in thread Thread[Thread-34,5,main]
>>> java.util.concurrent.RejectedExecutionException: ThreadPoolExecutor has shut
>>> down
>>>at
>>> org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor$1.rejectedExecution(DebuggableThreadPoolExecutor.java:73)
>>>at
>>> java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
>>>at
>>> java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
>>>at
>>> org.apache.cassandra.net.MessagingService.receive(MessagingService.java:444)
>>>at
>>> org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:117)
>>> ERROR [Thread-36] 2011-08-23 21:00:50,518 AbstractCassandraDaemon.java (line
>>> 113) Fatal exception in thread Thread[Thread-36,5,main]
>>> java.util.concurrent.RejectedExecutionException: ThreadPoolExecutor has shut
>>> down
>>>at
>>> org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor$1.rejectedExecution(DebuggableThreadPoolExecutor.java:73)
>>>at
>>> java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
>>>at
>>> java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
>>>at
>>> org.apache.cassandra.net.MessagingService.receive(MessagingService.java:444)
>>>at
>>> org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:117)
>>>  INFO [GossipTasks:1] 2011-08-23 21:00:50,466 Gossiper.java (line 620)
>>> InetAddress /10.29.20.67 is now dead.
>>>  INFO [HintedHandoff:1] 2011-08-23 21:00:50,751 HintedHandOffManager.java
>>> (line 376) Finished hinted handoff of 0 rows to endpoint /10.28.0.184
>>> ERROR [Thread-33] 2011-08-23 21:01:05,048 AbstractCassandraDaemon.java (line
>>> 113) Fatal exception in thread Thread[Thread-33,5,main]
>>> java.util.concurrent.RejectedExecutionException: ThreadPoolExecutor has shut
>>> down
>>>at
>>> org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor$1.rejectedExecution(DebuggableThreadPoolExecutor.java:73)
>>>at
>>> java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
>>>at
>>> java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
>>>at
>>> org.apache.cassandra.net.MessagingService.receive(MessagingService.java:444)
>>>at
>>> org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:117)
>>> ERROR [Thread-128] 2011-08-23 21:01:05,048 AbstractCassandraDaemon.java
>>> (line 113) Fatal exception in thread Thread[Thread-128,5,main]
>>> java.util.concurrent.RejectedExecutionException: ThreadPoolExecutor has shut
>>> down
>>>at
>>> org.apache.cassandra.concurrent.DebuggableThreadPoo

Cassandra-CLI does not allow list 1105115; with Syntax error

2011-08-24 Thread Renato Bacelar da Silveira

 Hi All

Good day,

A question concerning Cassandra-Cli.

I have a Column Family named 11001500.

I have inserted the CF with Hector, and it did not
throw any exception concerning the name of the
column.

If I am issuing the command

list 1105115;

I incur the following error:

[default@unknown] list 1105115;
Syntax error at position 5: mismatched input '1105115' expecting Identifier
*
I presume we are not to name CFs as integers?*

 Or is there something I am missing from
the bellow help content:

[default@unknown] help list;
list ;
list [:];
list [:];
list [:] limit ;

List a range of rows, and all of their columns, in the specified column
family.

The order of rows returned is dependant on the Partitioner in use.

Required Parameters:
- cf: Name of the column family to list rows from.

Optional Parameters:
- endKey: Key to end the range at. The end key will be included
in the result. Defaults to an empty byte array.

- limit: Number of rows to return. Default is 100.

- startKey: Key start the range from. The start key will be
included in the result. Defaults to an empty byte array.

Examples:
list Standard1;
list Super1[j:];
list Standard1[j:k] limit 40;



Renato da Silveira
Senior Developer
www.indabamobile.co.za


Cassandra-CLI does not allow list 1105115; with Syntax error

2011-08-24 Thread Renato Bacelar da Silveira

Just some information about the Column family in question:

ColumnFamily: 1105100
  Key Validation Class: org.apache.cassandra.db.marshal.BytesType
  Default column value validator: 
org.apache.cassandra.db.marshal.BytesType

  Columns sorted by: org.apache.cassandra.db.marshal.AsciiType
  Row cache size / save period in seconds: 0.0/0
  Key cache size / save period in seconds: 20.0/14400
  Memtable thresholds: 0.5203125/111/1440 (millions of ops/MB/minutes)
  GC grace seconds: 864000
  Compaction min/max thresholds: 4/32
  Read repair chance: 1.0
  Replicate on write: true
  Built indexes: []

I do observe that the Key Validation is BytesType, so I also tried 
(giddily)


[default@unknown] list bytes(1105100);
Syntax error at position 10: missing EOF at '('

which confirmed that perhaps I should change the ColumFamily name?

Regards.

 Original Message 
Subject:Cassandra-CLI does not allow list 1105115; with Syntax error
Date:   Wed, 24 Aug 2011 12:11:09 +0200
From:   Renato Bacelar da Silveira 
Reply-To:   user@cassandra.apache.org
To: user@cass 



 Hi All

Good day,

A question concerning Cassandra-Cli.

I have a Column Family named 11001500.

I have inserted the CF with Hector, and it did not
throw any exception concerning the name of the
column.

If I am issuing the command

list 1105115;

I incur the following error:

[default@unknown] list 1105115;
Syntax error at position 5: mismatched input '1105115' expecting Identifier
*
I presume we are not to name CFs as integers?*

 Or is there something I am missing from
the bellow help content:

[default@unknown] help list;
list ;
list [:];
list [:];
list [:] limit ;

List a range of rows, and all of their columns, in the specified column
family.

The order of rows returned is dependant on the Partitioner in use.

Required Parameters:
- cf: Name of the column family to list rows from.

Optional Parameters:
- endKey: Key to end the range at. The end key will be included
in the result. Defaults to an empty byte array.

- limit: Number of rows to return. Default is 100.

- startKey: Key start the range from. The start key will be
included in the result. Defaults to an empty byte array.

Examples:
list Standard1;
list Super1[j:];
list Standard1[j:k] limit 40;



Renato da Silveira
Senior Developer
www.indabamobile.co.za



nodetool repair does not return...

2011-08-24 Thread Boris Yen
Hi,

In our testing environment, we got two nodes with RF=2 running 0.8.4. We
tried to test the repair functions of cassandra, however, every once a
while, the "nodetool repair" never returns. We have checked the system.log,
nothing seems to be out of ordinary, no errors, no exceptions. The data is
only 50 mb, and it is consistently updated.

Shutting down one node during the repair process could cause similar
symptom. So, our original thought is that maybe one of the TreeRequest is
not sent to the other node correctly, that might cause the repair to run
forever. However, I did not see any relative log msg to support that. I am
kind of running out of idea about this... Does anyone also has this problem?

Regards
Boris


Re: multi-node cassandra config doubt

2011-08-24 Thread Thamizh
Hi Aaron,

This is yet to be resolved. 

I have set-up Cassandra multi node clustering and facing issues in pushing HDFS 
data to Cassandra. When I ran "MapReduce" progrma I am getting 
UnknownHostException.

In hadoop(0.20.1), I have configured node01-as master and node01, node02 & 
node03 as slaves.

In Cassandra(0.8.4), the installation & configurations has been done. when I 
issue nodetool ring command I could see the ring and also the KEYSPACES & 
COLUMNFAMILYS have got distributed.

o/p: nodetool
$bin/nodetool -h node02 ring
Address DC  Rack    Status State   Load    Owns    
Token   
   
161930152162677484001961360738128229499 
198.168.0.1 datacenter1 rack1   Up Normal  132.28 MB   12.48%  
13027320554261208311902766005835168982  
198.168.0.2 datacenter1 rack1   Up Normal  99.34 MB    75.07%  
140745249930211229277235689500208693608 
198.168.0.3 datacenter1 rack1   Up Normal  66.21 KB    12.45%  
161930152162677484001961360738128229499 
nutch@lab02:/code/apache-cassandra-0.8.4$ 


Here are the hadoop config.

        job4.setOutputFormatClass(ColumnFamilyOutputFormat.class);
        ConfigHelper.setOutputColumnFamily(job4.getConfiguration(), 
KEYSPACE,COLUMN_FAMILY );
        ConfigHelper.setRpcPort(job4.getConfiguration(), ""9160);
        ConfigHelper.setInitialAddress(job4.getConfiguration(), "node01");
        ConfigHelper.setPartitioner(job4.getConfiguration(), 
"org.apache.cassandra.dht.RandomPartitioner");

Bleow is an exception message:

Error: java.net.UnknownHostException: /198.168.0.3
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849)
    at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1200)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1153)
    at java.net.InetAddress.getAllByName(InetAddress.java:1083)
    at java.net.InetAddress.getAllByName(InetAddress.java:1019)
    at java.net.InetAddress.getByName(InetAddress.java:969)
    at 
org.apache.cassandra.client.RingCache.refreshEndpointMap(RingCache.java:93)
    at org.apache.cassandra.client.RingCache.(RingCache.java:67)
    at 
org.apache.cassandra.hadoop.ColumnFamilyRecordWriter.(ColumnFamilyRecordWriter.java:98)
    at 
org.apache.cassandra.hadoop.ColumnFamilyRecordWriter.(ColumnFamilyRecordWriter.java:92)
    at 
org.apache.cassandra.hadoop.ColumnFamilyOutputFormat.getRecordWriter(ColumnFamilyOutputFormat.java:132)
    at 
org.apache.cassandra.hadoop.ColumnFamilyOutputFormat.getRecordWriter(ColumnFamilyOutputFormat.java:62)
    at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:553)
    at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:408)
    at org.apache.hadoop.mapred.Child.main(Child.java:170)

note: Same /etc/hosts file has been used across all the nodes.

Kindly help me to resolve this issue?


Regards,

  Thamizhannal P

--- On Wed, 24/8/11, aaron morton  wrote:

From: aaron morton 
Subject: Re: multi-node cassandra config doubt
To: user@cassandra.apache.org
Date: Wednesday, 24 August, 2011, 2:40 PM

Did you get this sorted ? 
At a guess I would say there are no nodes listed in the Hadoop JobConf.
Cheers

-Aaron MortonFreelance Cassandra 
Developer@aaronmortonhttp://www.thelastpickle.com



On 23/08/2011, at 9:51 PM, Thamizh wrote:
Hi All,

This is regarding multi-node cluster configuration doubt.

I have configured 3 nodes of cluster using Cassandra-0.8.4 and getting error 
when I ran Map/Reduce job which uploads records from HDFS to Cassandra.

Here are my 3 nodes cluster config file (cassandra.yaml) for Cassandra:

node01:
    seeds: "node01,node02,node03"
    auto_bootstrap: false
    listen_address: 192.168.0.1
    rpc_address: 192.168.0.1


node02:

seeds: "node01,node02,node03"
auto_bootstrap: true
listen_address: 192.168.0.2
rpc_address: 192.168.0.2


node03:
seeds: "node01,node02,node03"
auto_bootstrap: true
listen_address: 192.168.0.3
rpc_address: 192.168.0.3

When I ran M/R program, I am getting below error
11/08/23 04:37:00 INFO
 mapred.JobClient:  map 100% reduce 11%
11/08/23 04:37:06 INFO mapred.JobClient:  map 100% reduce 22%
11/08/23 04:37:09 INFO mapred.JobClient:  map 100% reduce 33%
11/08/23 04:37:14 INFO mapred.JobClient: Task Id : 
attempt_201104211044_0719_r_00_0, Status : FAILED
java.lang.NullPointerException
    at org.apache.cassandra.client.RingCache.getRange(RingCache.java:130)
    at 
org.apache.cassandra.hadoop.ColumnFamilyRecordWriter.write(ColumnFamilyRecordWriter.java:125)
    at 
org.apache.cassandra.hadoop.ColumnFamilyRecordWriter.write(ColumnFamilyRecordWriter.java:60)
    at 
org.apache.hadoop.mapreduce.TaskInputOutputContext.write(TaskInputOutputContext.java:80)
    at CassTblUploader$TblUploadReducer.reduce(CassTblUploader.jav

Re: help creating data model

2011-08-24 Thread Helder Oliveira
Thanks Indranath Ghosh for your tip!

I will continue here the question.

Aaron, i have read your suggestion and tried to design your suggestion and i 
have one question regarding it.

Let's forget for now the Requests and Events!

Just keep the Visitants and the Sessions.

My goal is when having a visitant get all informations about him, in this case 
all his past sessions so i can create a profile using his past.

You have suggested 3 CF's

Visitants CF
key: id
cn: pn
cv: pv

Visitant Sessions CF
key: visitant id
cn: session id
cv: none

Sessions CF
key: session id
cn: pn
cv: pv

When i need to know everything about one visitant, i need to query "Visitant 
Sessions CF" to get all keys, and then query "Sessions CF" for all keys 
properties.

In this case, applying a Super Column Family to the "Sessions" isn't better ?

I mean something like:

{
  "sessions": {

"visitant id 1": {
  "session id 1": {
"p1": {"p1": "v1"},
"p2": {"jira": "v2"}
  },
  "session id 2": {
"p1": {"p1": "v1"}
  }
}

"visitant id 2": {
  "session id 3": {
"p1": {"p1": "v1"},
"p2": {"jira": "v2"}
  },
  "session id 4": {
"p1": {"p1": "v1"}
  }
}
  }
}

Using this, i can get all sessions in the second query, instead of having all 
sessions only at third query.

Regarding your notes, the Visitant CF will be almost unchangeable since the 
beginning of his creation, the sessions will be added every time a known user 
visits back, ceasing a new sessions.

Thanks a lot for you help guys, and i hope i was not saying crazy things :D

On Aug 22, 2011, at 11:23 PM, aaron morton wrote:

> Lets start with something quick and simple, all standard Column Families…
> 
> Visitant CF
> key: id 
> column name: property name
> column value: property value 
> 
> Visitant Sessions CF
> key: visitant id 
> column name: session id
> column value: none
> 
> Session CF
> 
> key: session_id
> column_name: property value 
> column_value: property value 
> 
> key: session_id/requests
> column_name: request_id
> column_value: none
> 
> key: session_id/events
> column_name: event_id
> column_value: none
> 
> Requests CF
> 
> key: request_id
> column_name: property name
> column_value: property value
> 
> Event CF
> 
> key: event_id
> column_name: property name
> column_value: property value
> 
> 
> Notes:
> 
> * assuming the Visitant CF is slowing changing i kept it in it's own cf.  
> * using compound keys to keep information related to sessions in the same CF. 
> These could be diff CF's,or in the Request or Event CF. 
> * the best model is the one that allows you to do your reads by getting one 
> or a few rows from a single cf. 
> * you could collapse the Request and Event CF's into one. 
> 
> If the event and request data is immutable (or there is no issues with 
> concurrent modifications) I would recommend this…
> 
> Request / Event CF:
> 
> key: session_id/events or session_id/requests
> column_name: event_id or session_id
> column_value: data
> 
> 
> Start with the simple model and then make changes to better handle your read 
> queries.
> 
> Have fun :)
> 
> 
> 
> -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
> 
> On 22/08/2011, at 11:13 PM, Helder Oliveira wrote:
> 
>> Hello all,
>> 
>> i have a SQL structure like this:
>> 
>> Visitant ( has several properties )
>> Visitant has many Sessions
>> Sessions ( has several properties )
>> Sessions has many Requests ( has several properties )
>> Sessions has many Events ( has several properties )
>> 
>> 
>> i have read a lot and still confused how to put this on cassandra, can 
>> someone give me a idea ?
> 



Re: Customized Secondary Index Schema

2011-08-24 Thread Alvin UW
Thanks.

2011/8/24 aaron morton 

> IMHO it's only a scalability problem if those nodes have trouble handling
> the throughput. The load will go all all replicas, not one, unless you turn
> off Read Repair.
>
> If it is a problem then you could manually partition the index into
> multiple rows, bit of a pain thought. I'd wait and see, or crunch some
> numbers before hand.
>
> Cheers
>
> -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 24/08/2011, at 5:03 AM, Alvin UW wrote:
>
> > Hello,
> >
> > As mentioned by Ed Anuff in his blog and slides, one way to build
> customized secondary index is:
> > We use one CF, each row to represent a secondary index, with the
> secondary index name as row key.
> > For example,
> >
> > Indexes = {
> > "User_Keys_By_Last_Name" : {
> > "adams" : "e5d61f2b-…",
> > "alden" : "e80a17ba-…",
> > "anderson" : "e5d61f2b-…",
> > "davis" : "e719962b-…",
> > "doe" : "e78ece0f-…",
> > "franks" : "e66afd40-…",
> > … : …,
> > }
> > }
> >
> > But the whole secondary index is partitioned into a single node, because
> of the row key.
> > All the queries against this secondary index will go to this node. Of
> course, there are some replica nodes.
> >
> > Do you think this is a scalability problem, or any better solution to
> solve it?
> > Thanks.
> >
> >
> >
> >
>
>


Re: checksumming

2011-08-24 Thread Jonathan Ellis
https://issues.apache.org/jira/browse/CASSANDRA-1717 added block level
checksums.

On Wed, Aug 24, 2011 at 4:28 AM, aaron morton  wrote:
> At the file level see https://issues.apache.org/jira/browse/CASSANDRA-674
> At the higher level there is node tool
> repair http://wiki.apache.org/cassandra/AntiEntropy.
> Cheers
> -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
> On 24/08/2011, at 11:04 AM, Bill Hastings wrote:
>
> Are checksum errors detected in Cassandra and if so how are they resolved?
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com


Re: Could Not connect to cassandra-cli on windows

2011-08-24 Thread Alaa Zubaidi

Hi Aaron,
I cannot at this point of time..

Thanks for your help..
Alaa

On 8/24/2011 2:30 AM, aaron morton wrote:

Not off the top of my head.

Can you get 0.7.8 running with a pre-packaged client ?

Cheers

-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 24/08/2011, at 12:16 PM, Alaa Zubaidi wrote:


Hi Aaron,
We are using Thrift 5..
TSocket _tr = new TSocket(server.Host, server.Port);//"localhost", 
9160);
_transport = new TFramedTransport(_tr);
_protocol = new TBinaryProtocol(_transport);
_client = new Cassandra.Client(_protocol);

Do you have any clue on what could cause the first exception?

Thanks and Regards.
Alaa

On 8/18/2011 3:59 AM, aaron morton wrote:

IIRC cassandra 0.7 needs thrift 0.5, are you using that version ?

Perhaps try grabbing the cassandra 0.7 version for one of the pre built clients 
(pycassa, hector etc) to check things work and then check you are using the 
same thrift version.

Cheers

-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 18/08/2011, at 4:03 PM, Alaa Zubaidi wrote:


Hi Aaron,
Thanks for the reply.
I am running 0.7.4 and NO client.
The error was reported by the application where it fails to connect and it 
happens that 2 threads are trying to connect at the same time. and when I 
checked the cassandra log I found these errors??

Thanks
Alaa

On 8/17/2011 4:29 PM, aaron morton wrote:

What client, what version, what version of cassandra are you using ?

Looks like you are connecting with an old version of thrift, like the message 
says. Check the client you are using was made for cassandra 0.8.

Cheers

-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 18/08/2011, at 7:27 AM, Alaa Zubaidi wrote:


Hi,

I se this error while the application tries to connect to cassandra at the same 
time from 2 different threads: any clues:

ERROR [pool-1-thread-13] 2011-07-29 06:46:45,718 CustomTThreadPoolServer.java 
(line 222) Error occurred during processing of message.
java.lang.StringIndexOutOfBoundsException: String index out of range: 
-2147418111
at java.lang.String.checkBounds(String.java:397)
at java.lang.String.(String.java:442)
at 
org.apache.thrift.protocol.TBinaryProtocol.readString(TBinaryProtocol.java:339)
at 
org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:210)
at 
org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2543)
at 
org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:206)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
ERROR [pool-1-thread-11] 2011-07-29 06:53:21,921 CustomTThreadPoolServer.java 
(line 218) Thrift error occurred during processing of message.
org.apache.thrift.protocol.TProtocolException: Missing version in 
readMessageBegin, old client?
at 
org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:213)
at 
org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2543)
at 
org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:206)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

Thanks,
Alaa


--
Alaa Zubaidi
PDF Solutions, Inc.
333 West San Carlos Street, Suite 700
San Jose, CA 95110  USA
Tel: 408-283-5639 (or 408-280-7900 x5639)
fax: 408-938-6479
email: alaa.zuba...@pdf.com





--
Alaa Zubaidi
PDF Solutions, Inc.
333 West San Carlos Street, Suite 700
San Jose, CA 95110  USA
Tel: 408-283-5639 (or 408-280-7900 x5639)
fax: 408-938-6479
email: alaa.zuba...@pdf.com







--
Alaa Zubaidi
PDF Solutions, Inc.
333 West San Carlos Street, Suite 700
San Jose, CA 95110  USA
Tel: 408-283-5639 (or 408-280-7900 x5639)
fax: 408-938-6479
email: alaa.zuba...@pdf.com




Re: Commit log fills up in less than a minute

2011-08-24 Thread Anand Somani
So, I restarted the cluster (not rolling), but it is still maintaining hints
for the IP's that are no longer part of the ring. nodetool ring shows things
correctly (as only 3 nodes).
When I check thru the jmx hintedhandoff manager, it shows it is maintaining
the hints for those non existent IP's. So the question is
 - How can I remove these IP permanently, so hints do not get saved?
 - Not all nodes see the same list of IP's



On Sun, Aug 21, 2011 at 3:10 PM, aaron morton wrote:

> Yup, you can check the what HH is doing via JMX.
>
> there is a bug in 0.7 that can result in log files not been deleted
> https://issues.apache.org/jira/browse/CASSANDRA-2829
>
> Cheers
>
> -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 22/08/2011, at 4:56 AM, Anand Somani wrote:
>
> We have a lot of space on /data, and looks like it was flushing data fine
> from file timestamps.
>
> We did have a bit of goofup with IP's when bringing up a down node (and the
> commit files have been around since then). Wonder if that is what triggered
> it and we have a bunch of hinted handoff's being backed up.
>
> For hinted hand off - how do I check if the nodes are collecting hints ( I
> do have it turned on). I noticed console bean HintedHandManager, is that the
> only way to find out.
>
> On Sun, Aug 21, 2011 at 9:20 AM, Peter Schuller <
> peter.schul...@infidyne.com> wrote:
>
>> > When does the actual commit-data file get deleted.
>> >
>> > The flush interval on all my memtables is 60 minutes
>>
>> They *should* be getting deleted when they no longer contain any data
>> that has not been flushed to disk. Are flushes definitely still
>> happening? Is it possible flushing has started failing (e.g. out of
>> disk)?
>>
>> The only way I can think of over nodes directly affecting the commit
>> log size on your node would be e.g. hinted handoff resulting in burst
>> of writes.
>>
>> --
>> / Peter Schuller (@scode on twitter)
>>
>
>
>


Re: Commit log fills up in less than a minute

2011-08-24 Thread Anand Somani
So I have looked at the cluster from

   - Cassandra-client - describe cluster => shows correctly - 3 nodes
   - used the StorageService - JMX bean =>UnreachableNodes - shows 0


If all these show the correct ring state, why are hints being maintained,
looks like that is the only way to find out about "phantom" nodes.

On Wed, Aug 24, 2011 at 8:01 AM, Anand Somani  wrote:

> So, I restarted the cluster (not rolling), but it is still maintaining
> hints for the IP's that are no longer part of the ring. nodetool ring shows
> things correctly (as only 3 nodes).
> When I check thru the jmx hintedhandoff manager, it shows it is maintaining
> the hints for those non existent IP's. So the question is
>  - How can I remove these IP permanently, so hints do not get saved?
>  - Not all nodes see the same list of IP's
>
>
>
>
> On Sun, Aug 21, 2011 at 3:10 PM, aaron morton wrote:
>
>> Yup, you can check the what HH is doing via JMX.
>>
>> there is a bug in 0.7 that can result in log files not been deleted
>> https://issues.apache.org/jira/browse/CASSANDRA-2829
>>
>> Cheers
>>
>>  -
>> Aaron Morton
>> Freelance Cassandra Developer
>> @aaronmorton
>> http://www.thelastpickle.com
>>
>> On 22/08/2011, at 4:56 AM, Anand Somani wrote:
>>
>> We have a lot of space on /data, and looks like it was flushing data fine
>> from file timestamps.
>>
>> We did have a bit of goofup with IP's when bringing up a down node (and
>> the commit files have been around since then). Wonder if that is what
>> triggered it and we have a bunch of hinted handoff's being backed up.
>>
>> For hinted hand off - how do I check if the nodes are collecting hints ( I
>> do have it turned on). I noticed console bean HintedHandManager, is that the
>> only way to find out.
>>
>> On Sun, Aug 21, 2011 at 9:20 AM, Peter Schuller <
>> peter.schul...@infidyne.com> wrote:
>>
>>> > When does the actual commit-data file get deleted.
>>> >
>>> > The flush interval on all my memtables is 60 minutes
>>>
>>> They *should* be getting deleted when they no longer contain any data
>>> that has not been flushed to disk. Are flushes definitely still
>>> happening? Is it possible flushing has started failing (e.g. out of
>>> disk)?
>>>
>>> The only way I can think of over nodes directly affecting the commit
>>> log size on your node would be e.g. hinted handoff resulting in burst
>>> of writes.
>>>
>>> --
>>> / Peter Schuller (@scode on twitter)
>>>
>>
>>
>>
>


Re: cassandra unexpected shutdown

2011-08-24 Thread Ernst D Schoen-René
If by magical, you mean magically shuts down randomly, then yes, that is 
magical.


We're on 8, but we discovered that 8 has an undocumented feature where 
turning off the commitlog doesn't work, so we're upgrading to 8.1 or 
whatever is current.


It doesn't seem to be tied to high or low load, repair or compaction.  
Major compaction isn't possible any more on our cluster, too much data.


I'll try reducing the cache, but what's strange is that only nodes 1,3,5 
and 9 seem to ever crash.  the rest are stable, and all are identical.


On 8/24/11 2:38 AM, aaron morton wrote:
First thing is are you on 0.8 ? It has some automagical memory 
management that is both automatic and magical 
http://thelastpickle.com/2011/05/04/How-are-Memtables-measured/


Secondly if you are OOM'ing you need to look at how much memory your 
schema is taking. See the link above, or just use 0.8


Thirdly, try to reduce the cache as Adi noted.

Finally try to work out when it's OOM'ing. Is it during a compaction, 
a repair, during peak load or just regular operations. With 1TB of 
data i'd be taking a look at the compaction or repair processes to see 
whats happening GC wise. Also check the GC settings as described in 
cassandra-env.sh


Hope that helps.
-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 24/08/2011, at 12:38 PM, Ernst D Schoen-René wrote:


Thanks,
   We had already been running cassandra with a larger heap size, but 
it meant that java took way too long between garbage collections. 
 The advice I'd found was to set the heap size at the 8 we're running 
at.  It was ok for a while, but now some nodes crash.  It's 
definitely our experience that adding more memory per node actually 
makes things worse eventually, as java starts eating up too many 
resources for it to handle.



On 8/23/11 5:28 PM, Adi wrote:
2011/8/23 Ernst D Schoen-René>:

Hi,
 I'm running a 16-node cassandra cluster, with a reasonably large 
amount of

data per node (~1TB).  Nodes have 16G ram, but heap is set to 8G.

The nodes keep stopping with this output in the log.  Any ideas?

ERROR [Thread-85] 2011-08-23 21:00:38,723 
AbstractCassandraDaemon.java (line

113) Fatal exception in thread Thread[Thread-85,5,main]
java.lang.OutOfMemoryError: Java heap space
ERROR [ReadStage:568] 2011-08-23 21:00:38,723 
AbstractCassandraDaemon.java

(line 113) Fatal exception in thread Thread[ReadStage:568,5,main]
java.lang.OutOfMemoryError: Java heap space
 INFO [HintedHandoff:1] 2011-08-23 21:00:38,720 
HintedHandOffManager.java

(line 320) Started hinted handoff for endpoint /10.28.0.184
 INFO [GossipStage:2] 2011-08-23 21:00:50,751 Gossiper.java (line 606)
InetAddress /10.29.20.67 is now UP
ERROR [Thread-34] 2011-08-23 21:00:50,525 
AbstractCassandraDaemon.java (line

113) Fatal exception in thread Thread[Thread-34,5,main]
java.util.concurrent.RejectedExecutionException: ThreadPoolExecutor 
has shut

down
   at
org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor$1.rejectedExecution(DebuggableThreadPoolExecutor.java:73)
   at
java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
   at
java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
   at
org.apache.cassandra.net.MessagingService.receive(MessagingService.java:444)
   at
org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:117)
ERROR [Thread-36] 2011-08-23 21:00:50,518 
AbstractCassandraDaemon.java (line

113) Fatal exception in thread Thread[Thread-36,5,main]
java.util.concurrent.RejectedExecutionException: ThreadPoolExecutor 
has shut

down
   at
org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor$1.rejectedExecution(DebuggableThreadPoolExecutor.java:73)
   at
java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
   at
java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
   at
org.apache.cassandra.net.MessagingService.receive(MessagingService.java:444)
   at
org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:117)
 INFO [GossipTasks:1] 2011-08-23 21:00:50,466 Gossiper.java (line 620)
InetAddress /10.29.20.67 is now dead.
 INFO [HintedHandoff:1] 2011-08-23 21:00:50,751 
HintedHandOffManager.java

(line 376) Finished hinted handoff of 0 rows to endpoint /10.28.0.184
ERROR [Thread-33] 2011-08-23 21:01:05,048 
AbstractCassandraDaemon.java (line

113) Fatal exception in thread Thread[Thread-33,5,main]
java.util.concurrent.RejectedExecutionException: ThreadPoolExecutor 
has shut

down
   at
org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor$1.rejectedExecution(DebuggableThreadPoolExecutor.java:73)
   at
java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
   at
java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
   at
org.apache.cassandra.net.MessagingService.receive(MessagingService.java:444)
   at
org.apache.

Re: Memory overhead of vector clocks…. how often are they pruned?

2011-08-24 Thread Ryan King
On Tue, Aug 23, 2011 at 7:58 PM, Kevin Burton  wrote:

> I had a thread going the other day about vector clock memory usage and that
> it is a series of (clock id, clock):ts and the ability to prune old entries
> … I'm specifically curious here how often old entries are pruned.
>
> If you're storing small columns within cassandra.  Say just an integer.
>  The vector clock overhead could easily use up far more data than is
> actually in your database.
>
> However, if they are pruned, then this shouldn't really be a problem.
>
> How much memory is this wasting?
>

I think there is some confusion here– cassandra doesn't use vector clocks.

-ryan


> Thoughts?
>
>
> Jonathan Ellis jbel...@gmail.com to user
>  show details Aug 19 (4 days ago)
>  The problem with naive last write wins is that writes don't always
> arrive at each replica in the same order.  So no, that's a
> non-starter.
>
> Vector clocks are a series of (client id, clock) entries, and usually
> a timestamp so you can prune old entries.  Obviously implementations
> can vary, but to pick a specific example, Voldemort [1] uses 2 bytes
> per client id, a variable number (at least one) of bytes for the
> clock, and 8 bytes for the timestamp.
>
> [1]
> https://github.com/voldemort/voldemort/blob/master/src/java/voldemort/versioning/VectorClock.java
>
>
> --
>
> Founder/CEO Spinn3r.com
>
> Location: *San Francisco, CA*
> Skype: *burtonator*
>
> Skype-in: *(415) 871-0687*
>
>


Cassandra-cli not able to find CF after fresh CF insert.

2011-08-24 Thread Renato Bacelar da Silveira

Hi All

Good day,

I have again come across a situation where the CF is not being found by 
the list command... it would
be too painful at this stage to restart the node just to be able to 
query the CF...


*ColumnFamily: a1307*
  Key Validation Class: org.apache.cassandra.db.marshal.BytesType
  Default column value validator: 
org.apache.cassandra.db.marshal.BytesType

  Columns sorted by: org.apache.cassandra.db.marshal.AsciiType
  Row cache size / save period in seconds: 0.0/0
  Key cache size / save period in seconds: 20.0/14400
  Memtable thresholds: 0.5203125/111/1440 (millions of ops/MB/minutes)
  GC grace seconds: 864000
  Compaction min/max thresholds: 4/32
  Read repair chance: 1.0
  Replicate on write: true
  Built indexes: []


[default@MyKeyspace] list a1307;
*a1307 not found in current keyspace.*


I am not sure how this is being caused, but if I add a CF and list it
immediately after, it does not find the CF.

I had to change my CF names to have a char in it, because I suspect CF names
may not be integer only, not yet proven on that though.

I am using Cassandra 0.8.* ---

Any ideas?



--



Re: Memory overhead of vector clocks…. how often are they pruned?

2011-08-24 Thread Kevin Burton
This is really interesting… I can track it down but there are a number of
references to Cassandra HAVING vector clocks … which would make sense that I
can't find out how much memory they are using :-P

"Cassandra: The Definitive Guide" … which I was reading the other night says
that they were introduced in 0.7 but that they're still figuring out what to
do with them:

http://books.google.com/books?id=MKGSbCbEdg0C&pg=PA50&lpg=PA50&dq=Cassandra's+clock+was+introduced+in+version+0.7,+but+its+fate+is+uncertain&source=bl&ots=XoQz3tFa1C&sig=Lhdu5j1xRcTPmP4-YQONhxzfRTU&hl=en&ei=MzdVTurWEJTSiAKU5vXoDA&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBkQ6AEwAA#v=onepage&q&f=false

… so… are 'timestamps' pruned?

Even this mechanism seems like it will dominate the amount of memory used in
Cassandra.  I could see many installs requiring 2-3x more memory to run
Cassandra unless there is a pruning mechanism or some way to minimize their
use.

Kevin


On Wed, Aug 24, 2011 at 9:05 AM, Ryan King  wrote:

> On Tue, Aug 23, 2011 at 7:58 PM, Kevin Burton  wrote:
>
>> I had a thread going the other day about vector clock memory usage and
>> that it is a series of (clock id, clock):ts and the ability to prune old
>> entries … I'm specifically curious here how often old entries are pruned.
>>
>> If you're storing small columns within cassandra.  Say just an integer.
>>  The vector clock overhead could easily use up far more data than is
>> actually in your database.
>>
>> However, if they are pruned, then this shouldn't really be a problem.
>>
>> How much memory is this wasting?
>>
>
> I think there is some confusion here– cassandra doesn't use vector clocks.
>
> -ryan
>
>
>> Thoughts?
>>
>>
>> Jonathan Ellis jbel...@gmail.com to user
>>  show details Aug 19 (4 days ago)
>>  The problem with naive last write wins is that writes don't always
>> arrive at each replica in the same order.  So no, that's a
>> non-starter.
>>
>> Vector clocks are a series of (client id, clock) entries, and usually
>> a timestamp so you can prune old entries.  Obviously implementations
>> can vary, but to pick a specific example, Voldemort [1] uses 2 bytes
>> per client id, a variable number (at least one) of bytes for the
>> clock, and 8 bytes for the timestamp.
>>
>> [1]
>> https://github.com/voldemort/voldemort/blob/master/src/java/voldemort/versioning/VectorClock.java
>>
>>
>> --
>>
>> Founder/CEO Spinn3r.com
>>
>> Location: *San Francisco, CA*
>> Skype: *burtonator*
>>
>> Skype-in: *(415) 871-0687*
>>
>>
>


-- 

Founder/CEO Spinn3r.com

Location: *San Francisco, CA*
Skype: *burtonator*

Skype-in: *(415) 871-0687*


Re: Memory overhead of vector clocks…. how often are they pruned?

2011-08-24 Thread Jeremy Hanna
At the point that book was written (about a year ago it was finalized), vector 
clocks were planned.  In August or September of last year, they were removed.  
0.7 was released in January.  The ticket for vector clocks is here and you can 
see the reasoning for not using them at the bottom.  
https://issues.apache.org/jira/browse/CASSANDRA-580

On Aug 24, 2011, at 12:41 PM, Kevin Burton wrote:

> This is really interesting… I can track it down but there are a number of 
> references to Cassandra HAVING vector clocks … which would make sense that I 
> can't find out how much memory they are using :-P
> 
> "Cassandra: The Definitive Guide" … which I was reading the other night says 
> that they were introduced in 0.7 but that they're still figuring out what to 
> do with them:
> 
> http://books.google.com/books?id=MKGSbCbEdg0C&pg=PA50&lpg=PA50&dq=Cassandra's+clock+was+introduced+in+version+0.7,+but+its+fate+is+uncertain&source=bl&ots=XoQz3tFa1C&sig=Lhdu5j1xRcTPmP4-YQONhxzfRTU&hl=en&ei=MzdVTurWEJTSiAKU5vXoDA&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBkQ6AEwAA#v=onepage&q&f=false
> 
> … so… are 'timestamps' pruned?  
> 
> Even this mechanism seems like it will dominate the amount of memory used in 
> Cassandra.  I could see many installs requiring 2-3x more memory to run 
> Cassandra unless there is a pruning mechanism or some way to minimize their 
> use.
> 
> Kevin
> 
> 
> On Wed, Aug 24, 2011 at 9:05 AM, Ryan King  wrote:
> On Tue, Aug 23, 2011 at 7:58 PM, Kevin Burton  wrote:
> I had a thread going the other day about vector clock memory usage and that 
> it is a series of (clock id, clock):ts and the ability to prune old entries … 
> I'm specifically curious here how often old entries are pruned.
> 
> If you're storing small columns within cassandra.  Say just an integer.  The 
> vector clock overhead could easily use up far more data than is actually in 
> your database.
> 
> However, if they are pruned, then this shouldn't really be a problem.  
> 
> How much memory is this wasting?
> 
> I think there is some confusion here– cassandra doesn't use vector clocks.
> 
> -ryan
>  
> Thoughts?
> 
> 
> Jonathan Ellis jbel...@gmail.com to user
> show details Aug 19 (4 days ago)
> The problem with naive last write wins is that writes don't always
> arrive at each replica in the same order.  So no, that's a
> non-starter.
> 
> Vector clocks are a series of (client id, clock) entries, and usually
> a timestamp so you can prune old entries.  Obviously implementations
> can vary, but to pick a specific example, Voldemort [1] uses 2 bytes
> per client id, a variable number (at least one) of bytes for the
> clock, and 8 bytes for the timestamp.
> 
> [1] 
> https://github.com/voldemort/voldemort/blob/master/src/java/voldemort/versioning/VectorClock.java
> 
> 
> -- 
> Founder/CEO Spinn3r.com
> 
> Location: San Francisco, CA
> Skype: burtonator
> Skype-in: (415) 871-0687
> 
> 
> 
> 
> 
> -- 
> Founder/CEO Spinn3r.com
> 
> Location: San Francisco, CA
> Skype: burtonator
> Skype-in: (415) 871-0687
> 



how to migrate?

2011-08-24 Thread William Oberman
I was hoping to transition my "simple" cassandra cluster (where each node is a 
cassandra + hadoop tasktracker) to a cluster with two virtual datacenters 
(vanilla cassandra vs. cassandra + hadoop tasktracker), based on this:
http://wiki.apache.org/cassandra/HadoopSupport#ClusterConfig
The problem I'm having is my hadoop jobs are getting heavy enough it's 
affecting my user facing performance on my cluster.

Right now I'm in AWS, and I have 4 nodes in us-east split over two availability 
zones ("us-east-1c" that I'll call "c" and "us-east-1d" that I'll call "d"), 
setup with this keyspace:
create keyspace civicscience with replication_factor=3 and strategy_options = 
[{us-east:3}] and 
placement_strategy='org.apache.cassandra.locator.NetworkTopologyStrategy';
And I'm using the Ec2Snitch.

I'm wondering if I write my own snitch that extends Ec2Snitch with overrides as 
follows:
getDC = if(AZ == c || d) return return us-east (to keep current nodes the same) 
else return us-east-hadoop;
getRack = return super(); (returning a,b,c,d seems ok)

Then, if I boot N new nodes into us-east-1[a,b] they will be "hadoop" nodes 
because of the snitch.  I'll obviously have to change my home brew cassandra + 
hadoop instances to selectively run task trackers or not (a/b = yes, and c/d = 
no).

But:
-Is the overall RF=3 still ok?
-What is the recommended split between "normal" and "hadoop" in terms of 
strategy_options (assuming RF=3)?  2/1?  
-Can I (how do I safely) change the keyspace strategy_options from 
[{us-east:3}] to [{us-east:2, us-east-hadoop:1}]   This seems like the 
riskiest/most complicated step of everything I've proposed...
-After I change the options, what (if anything) would I have to do to migrate 
data around?  

One final question: should I add new nodes as Brisk instances instead of my 
home brew cassandra + hadoop nodes?  I've obviously already put in the 
pain/effort of learning how to run hadoop + cassandra...

Thanks for any help/advice!

will



Re: cassandra unexpected shutdown

2011-08-24 Thread Ernst D Schoen-René

So, we're on 8, so I don't think there's a key cache setting.  Am I wrong?

here's my newest crash log:

ERROR [Thread-210] 2011-08-24 06:29:53,247 AbstractCassandraDaemon.java 
(line 113) Fatal exception in thread Thread[Thread-210,5,main]
java.util.concurrent.RejectedExecutionException: ThreadPoolExecutor has 
shut down
at 
org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor$1.rejectedExecution(DebuggableThreadPoolExecutor.java:73)
at 
java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
at 
java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
at 
org.apache.cassandra.net.MessagingService.receive(MessagingService.java:444)
at 
org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:117)
 INFO [ScheduledTasks:1] 2011-08-24 06:29:53,249 StatusLogger.java 
(line 65) InternalResponseStage 0 0
 INFO [ScheduledTasks:1] 2011-08-24 06:29:53,250 StatusLogger.java 
(line 65) HintedHandoff 116
 INFO [ScheduledTasks:1] 2011-08-24 06:29:53,250 StatusLogger.java 
(line 69) CompactionManager   n/a  1298
 INFO [ScheduledTasks:1] 2011-08-24 06:29:53,250 StatusLogger.java 
(line 81) MessagingServicen/a   1,0
 INFO [ScheduledTasks:1] 2011-08-24 06:29:53,250 StatusLogger.java 
(line 85) ColumnFamilyMemtable ops,data  Row cache 
size/cap  Key cache size/cap




On 8/24/11 2:38 AM, aaron morton wrote:
First thing is are you on 0.8 ? It has some automagical memory 
management that is both automatic and magical 
http://thelastpickle.com/2011/05/04/How-are-Memtables-measured/


Secondly if you are OOM'ing you need to look at how much memory your 
schema is taking. See the link above, or just use 0.8


Thirdly, try to reduce the cache as Adi noted.

Finally try to work out when it's OOM'ing. Is it during a compaction, 
a repair, during peak load or just regular operations. With 1TB of 
data i'd be taking a look at the compaction or repair processes to see 
whats happening GC wise. Also check the GC settings as described in 
cassandra-env.sh


Hope that helps.
-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 24/08/2011, at 12:38 PM, Ernst D Schoen-René wrote:


Thanks,
   We had already been running cassandra with a larger heap size, but 
it meant that java took way too long between garbage collections. 
 The advice I'd found was to set the heap size at the 8 we're running 
at.  It was ok for a while, but now some nodes crash.  It's 
definitely our experience that adding more memory per node actually 
makes things worse eventually, as java starts eating up too many 
resources for it to handle.



On 8/23/11 5:28 PM, Adi wrote:
2011/8/23 Ernst D Schoen-René>:

Hi,
 I'm running a 16-node cassandra cluster, with a reasonably large 
amount of

data per node (~1TB).  Nodes have 16G ram, but heap is set to 8G.

The nodes keep stopping with this output in the log.  Any ideas?

ERROR [Thread-85] 2011-08-23 21:00:38,723 
AbstractCassandraDaemon.java (line

113) Fatal exception in thread Thread[Thread-85,5,main]
java.lang.OutOfMemoryError: Java heap space
ERROR [ReadStage:568] 2011-08-23 21:00:38,723 
AbstractCassandraDaemon.java

(line 113) Fatal exception in thread Thread[ReadStage:568,5,main]
java.lang.OutOfMemoryError: Java heap space
 INFO [HintedHandoff:1] 2011-08-23 21:00:38,720 
HintedHandOffManager.java

(line 320) Started hinted handoff for endpoint /10.28.0.184
 INFO [GossipStage:2] 2011-08-23 21:00:50,751 Gossiper.java (line 606)
InetAddress /10.29.20.67 is now UP
ERROR [Thread-34] 2011-08-23 21:00:50,525 
AbstractCassandraDaemon.java (line

113) Fatal exception in thread Thread[Thread-34,5,main]
java.util.concurrent.RejectedExecutionException: ThreadPoolExecutor 
has shut

down
   at
org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor$1.rejectedExecution(DebuggableThreadPoolExecutor.java:73)
   at
java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
   at
java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
   at
org.apache.cassandra.net.MessagingService.receive(MessagingService.java:444)
   at
org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:117)
ERROR [Thread-36] 2011-08-23 21:00:50,518 
AbstractCassandraDaemon.java (line

113) Fatal exception in thread Thread[Thread-36,5,main]
java.util.concurrent.RejectedExecutionException: ThreadPoolExecutor 
has shut

down
   at
org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor$1.rejectedExecution(DebuggableThreadPoolExecutor.java:73)
   at
java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
   at
java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
   at
org.apache.cassandra.net.MessagingService.receive(MessagingService.java:444)
   at
org.apache.cassandra.net.Inc

question about cassandra.in.sh

2011-08-24 Thread Koert Kuipers
i have an existing cassandra instance on my machine, it came with brisk and
lives in /usr/share/brisk/cassandra. it also created /usr/share/cassandra/
cassandra.in.sh

now i wanted to run another instance of cassandra (i needed a 0.7 version
for compatibility reasons), so i downloaded it from apache cassandra website
and installed it in /usr/share/cassandra-0.7

my problem is that the scripts for my cassandra 0.7 instance don't work
properly. the problem lies in the code snippets below. when i run the
scripts they source /usr/share/cassandra/cassandra.in.sh, which has the
wrong settings (it now loads all the jars from
/usr/share/brisk/cassandra/lib). i know i can fix it by settings
CASSANDRA_INCLUDE but i think thats not a very nice solution.

why was the decision made that the central "casssandra.in.sh" should have
higher priority than the local one? doesn't that break local installs?
wouldnt it make more sense if scripts assumed they were in SOMEDIR/bin and
then tried to load casssandra.in.sh from SOMEDIR first with the highest
priority?

best, koert


code snippet:
if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
# Locations (in order) to use when searching for an include file.
for include in /usr/share/cassandra/cassandra.in.sh \
   /usr/local/share/cassandra/cassandra.in.sh \
   /opt/cassandra/cassandra.in.sh \
   ~/.cassandra.in.sh \
   `dirname $0`/cassandra.in.sh; do
if [ -r $include ]; then
. $include
break
fi
done


Cassandra Node Requirements

2011-08-24 Thread Jacob, Arun
I'm trying to determine a node configuration for Cassandra. From what I've been 
able to determine from reading around:


 1.  we need to cap data size at 50% of total node storage capacity for 
compaction
 2.  with RF=3, that means that I need to effectively assume that I have 1/6th 
of total storage capacity.
 3.  SSDs are preferred, but of course  reduce storage capacity
 4.  using standard storage means you bump up your RAM to keep as much in 
memory as possible.

Right now we are looking at storage requirements of 42 – 60TB, assuming a 
baseline of 3TB/day and expiring data after 14-20 days (depending on use case), 
 I would assume based on above that we need 252- 360TB total storage max.

My questions:

 1.  is 8TB (meaning 1.33 actual TB storage/node) a reasonable per node storage 
size for Cassandra? I don’t want to use SSDs due to reduced storage capacity -- 
I don't want to buy 100s of nodes to support that reduced storage capacity of 
SSDs.  Given that I will be using standard drives, what is a 
reasonable/effective per node storage capacity?
 2.  other than splitting the commit log onto a separate drive, is there any 
other drive allocation I should be doing?
 3.  Assuming I'm not using SSDs, what would be a good memory size for a node? 
I've heard anything from 32-48 GB, but need more guidance.

Anything else that anyone has run into? What are common configurations being 
used by others?

Thanks in advance,

-- Arun




Re: Cassandra-CLI does not allow list 1105115; with Syntax error

2011-08-24 Thread aaron morton
Similar to https://issues.apache.org/jira/browse/CASSANDRA-3054

can you create a new ticket and link to that one.


-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 24/08/2011, at 10:33 PM, Renato Bacelar da Silveira wrote:

> Just some information about the Column family in question:
> 
> ColumnFamily: 1105100
>   Key Validation Class: org.apache.cassandra.db.marshal.BytesType
>   Default column value validator: 
> org.apache.cassandra.db.marshal.BytesType
>   Columns sorted by: org.apache.cassandra.db.marshal.AsciiType
>   Row cache size / save period in seconds: 0.0/0
>   Key cache size / save period in seconds: 20.0/14400
>   Memtable thresholds: 0.5203125/111/1440 (millions of ops/MB/minutes)
>   GC grace seconds: 864000
>   Compaction min/max thresholds: 4/32
>   Read repair chance: 1.0
>   Replicate on write: true
>   Built indexes: []
> 
> I do observe that the Key Validation is BytesType, so I also tried (giddily) 
> 
> [default@unknown] list bytes(1105100);  
> Syntax error at position 10: missing EOF at '('
> 
> which confirmed that perhaps I should change the ColumFamily name?
> 
> Regards.
> 
>  Original Message 
> Subject:  Cassandra-CLI does not allow list 1105115; with Syntax error
> Date: Wed, 24 Aug 2011 12:11:09 +0200
> From: Renato Bacelar da Silveira 
> Reply-To: user@cassandra.apache.org
> To:   user@cass 
> 
>  Hi All
> 
> Good day,
> 
> A question concerning Cassandra-Cli.
> 
> I have a Column Family named 11001500.
> 
> I have inserted the CF with Hector, and it did not 
> throw any exception concerning the name of the
> column.
> 
> If I am issuing the command
> 
> list 1105115;
> 
> I incur the following error:
> 
> [default@unknown] list 1105115;
> Syntax error at position 5: mismatched input '1105115' expecting Identifier
> 
> I presume we are not to name CFs as integers?
> 
>  Or is there something I am missing from
> the bellow help content:
> 
> [default@unknown] help list;
> list ;
> list [:];
> list [:];
> list [:] limit ;
> 
> List a range of rows, and all of their columns, in the specified column
> family.
> 
> The order of rows returned is dependant on the Partitioner in use.
> 
> Required Parameters:
> - cf: Name of the column family to list rows from.
> 
> Optional Parameters:
> - endKey: Key to end the range at. The end key will be included
> in the result. Defaults to an empty byte array.
> 
> - limit: Number of rows to return. Default is 100.
> 
> - startKey: Key start the range from. The start key will be
> included in the result. Defaults to an empty byte array.
> 
> Examples:
> list Standard1;
> list Super1[j:];
> list Standard1[j:k] limit 40;
> 
> 
> 
> Renato da Silveira
> Senior Developer
> www.indabamobile.co.za
> 



Re: Cassandra Node Requirements

2011-08-24 Thread Edward Capriolo
On Wed, Aug 24, 2011 at 2:54 PM, Jacob, Arun  wrote:

> I'm trying to determine a node configuration for Cassandra. From what I've
> been able to determine from reading around:
>
>
>1. we need to cap data size at 50% of total node storage capacity for
>compaction
>2. with RF=3, that means that I need to effectively assume that I have
>1/6th of total storage capacity.
>3. SSDs are preferred, but of course  reduce storage capacity
>4. using standard storage means you bump up your RAM to keep as much in
>memory as possible.
>
> Right now we are looking at storage requirements of 42 – 60TB, assuming a
> baseline of 3TB/day and expiring data after 14-20 days (depending on use
> case),  I would assume based on above that we need 252- 360TB total storage
> max.
>
> My questions:
>
>1. is 8TB (meaning 1.33 actual TB storage/node) a reasonable per node
>storage size for Cassandra? I don’t want to use SSDs due to reduced storage
>capacity -- I don't want to buy 100s of nodes to support that reduced
>storage capacity of SSDs.  Given that I will be using standard drives, what
>is a reasonable/effective per node storage capacity?
>2. other than splitting the commit log onto a separate drive, is there
>any other drive allocation I should be doing?
>3. Assuming I'm not using SSDs, what would be a good memory size for a
>node? I've heard anything from 32-48 GB, but need more guidance.
>
>
> Anything else that anyone has run into? What are common configurations
> being used by others?
>
> Thanks in advance,
>
> -- Arun
>
>
>

I would suggest checking out:
http://wiki.apache.org/cassandra/CassandraHardware
http://wiki.apache.org/cassandra/LargeDataSetConsiderations
http://www.slideshare.net/edwardcapriolo/real-world-capacity

1. we need to cap data size at 50% of total node storage capacity for
compaction

False. You need 50% the capacity of your largest column family free with
some other room for overhead. This changes all your numbers.

3. SSDs are preferred, but of course  reduce storage capacity

Avoid generalizations. Many use cases may get little benefit from SSD disks.

4. using standard storage means you bump up your RAM to keep as much in
memory as possible.

In most cases you want to maintain some RAM / Hard disk ratio. SSD setups
still likely need sizable RAM.

Your 3 questions are hard to answer because what hardware you need workload
dependent. If really depends on active set, what percent of the data is
active at any time. It also depends on your latency requirements, if you are
modeling something like the way-back machine, that has different usage
profile then a stock ticker application, that is again different from the
usage patterns of an email system.

Generally people come to Cassandra because they are looking for low latency
access to read and write data. This is hard to achieve on 8TB of disk. The
size of the bloom filters and index files are themselves substantial with
8TB of data. You will also require a large amount of RAM on this disk to
minimize disk seeks (or a super like SSD raid-0 (does this sound like a bad
idea to you? It does to me :))

The only way to answer the question of how much hardware your need is with
load testing. The Yahoo Cloud Serving Benchmark can help you fill up a node
and test it with different load patterns to see how it performs.


Re: Memory overhead of vector clocks…. how often are they pruned?

2011-08-24 Thread Ryan King
We did have a Clock construct for awhile, but it never made it into a
released version (afaik). We though about using them for counters.

Timestamps are endemic to the data model and therefore can never be
pruned. Cassandra basically trades memory for availability here.

-ryan

On Wed, Aug 24, 2011 at 10:54 AM, Jeremy Hanna
 wrote:
> At the point that book was written (about a year ago it was finalized), 
> vector clocks were planned.  In August or September of last year, they were 
> removed.  0.7 was released in January.  The ticket for vector clocks is here 
> and you can see the reasoning for not using them at the bottom.  
> https://issues.apache.org/jira/browse/CASSANDRA-580
>
> On Aug 24, 2011, at 12:41 PM, Kevin Burton wrote:
>
>> This is really interesting… I can track it down but there are a number of 
>> references to Cassandra HAVING vector clocks … which would make sense that I 
>> can't find out how much memory they are using :-P
>>
>> "Cassandra: The Definitive Guide" … which I was reading the other night says 
>> that they were introduced in 0.7 but that they're still figuring out what to 
>> do with them:
>>
>> http://books.google.com/books?id=MKGSbCbEdg0C&pg=PA50&lpg=PA50&dq=Cassandra's+clock+was+introduced+in+version+0.7,+but+its+fate+is+uncertain&source=bl&ots=XoQz3tFa1C&sig=Lhdu5j1xRcTPmP4-YQONhxzfRTU&hl=en&ei=MzdVTurWEJTSiAKU5vXoDA&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBkQ6AEwAA#v=onepage&q&f=false
>>
>> … so… are 'timestamps' pruned?
>>
>> Even this mechanism seems like it will dominate the amount of memory used in 
>> Cassandra.  I could see many installs requiring 2-3x more memory to run 
>> Cassandra unless there is a pruning mechanism or some way to minimize their 
>> use.
>>
>> Kevin
>>
>>
>> On Wed, Aug 24, 2011 at 9:05 AM, Ryan King  wrote:
>> On Tue, Aug 23, 2011 at 7:58 PM, Kevin Burton  wrote:
>> I had a thread going the other day about vector clock memory usage and that 
>> it is a series of (clock id, clock):ts and the ability to prune old entries 
>> … I'm specifically curious here how often old entries are pruned.
>>
>> If you're storing small columns within cassandra.  Say just an integer.  The 
>> vector clock overhead could easily use up far more data than is actually in 
>> your database.
>>
>> However, if they are pruned, then this shouldn't really be a problem.
>>
>> How much memory is this wasting?
>>
>> I think there is some confusion here– cassandra doesn't use vector clocks.
>>
>> -ryan
>>
>> Thoughts?
>>
>>
>> Jonathan Ellis jbel...@gmail.com to user
>> show details Aug 19 (4 days ago)
>> The problem with naive last write wins is that writes don't always
>> arrive at each replica in the same order.  So no, that's a
>> non-starter.
>>
>> Vector clocks are a series of (client id, clock) entries, and usually
>> a timestamp so you can prune old entries.  Obviously implementations
>> can vary, but to pick a specific example, Voldemort [1] uses 2 bytes
>> per client id, a variable number (at least one) of bytes for the
>> clock, and 8 bytes for the timestamp.
>>
>> [1] 
>> https://github.com/voldemort/voldemort/blob/master/src/java/voldemort/versioning/VectorClock.java
>>
>>
>> --
>> Founder/CEO Spinn3r.com
>>
>> Location: San Francisco, CA
>> Skype: burtonator
>> Skype-in: (415) 871-0687
>>
>>
>>
>>
>>
>> --
>> Founder/CEO Spinn3r.com
>>
>> Location: San Francisco, CA
>> Skype: burtonator
>> Skype-in: (415) 871-0687
>>
>
>


Re: multi-node cassandra config doubt

2011-08-24 Thread aaron morton
Jump on the machine that raised the error and see if you can ssh to node01. 

or try using ip address to see if they work. 

Cheers

-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 24/08/2011, at 11:34 PM, Thamizh wrote:

> Hi Aaron,
> 
> This is yet to be resolved. 
> 
> I have set-up Cassandra multi node clustering and facing issues in pushing 
> HDFS data to Cassandra. When I ran "MapReduce" progrma I am getting 
> UnknownHostException.
> 
> In hadoop(0.20.1), I have configured node01-as master and node01, node02 & 
> node03 as slaves.
> 
> In Cassandra(0.8.4), the installation & configurations has been done. when I 
> issue nodetool ring command I could see the ring and also the KEYSPACES & 
> COLUMNFAMILYS have got distributed.
> 
> o/p: nodetool
> $bin/nodetool -h node02 ring
> Address DC  RackStatus State   LoadOwns   
>  Token   
>   
>  161930152162677484001961360738128229499 
> 198.168.0.1 datacenter1 rack1   Up Normal  132.28 MB   12.48% 
>  13027320554261208311902766005835168982  
> 198.168.0.2 datacenter1 rack1   Up Normal  99.34 MB75.07% 
>  140745249930211229277235689500208693608 
> 198.168.0.3 datacenter1 rack1   Up Normal  66.21 KB12.45% 
>  161930152162677484001961360738128229499 
> nutch@lab02:/code/apache-cassandra-0.8.4$ 
> 
> 
> Here are the hadoop config.
> 
> job4.setOutputFormatClass(ColumnFamilyOutputFormat.class);
> ConfigHelper.setOutputColumnFamily(job4.getConfiguration(), 
> KEYSPACE,COLUMN_FAMILY );
> ConfigHelper.setRpcPort(job4.getConfiguration(), ""9160);
> ConfigHelper.setInitialAddress(job4.getConfiguration(), "node01");
> ConfigHelper.setPartitioner(job4.getConfiguration(), 
> "org.apache.cassandra.dht.RandomPartitioner");
> 
> Bleow is an exception message:
> 
> Error: java.net.UnknownHostException: /198.168.0.3
> at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
> at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849)
> at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1200)
> at java.net.InetAddress.getAllByName0(InetAddress.java:1153)
> at java.net.InetAddress.getAllByName(InetAddress.java:1083)
> at java.net.InetAddress.getAllByName(InetAddress.java:1019)
> at java.net.InetAddress.getByName(InetAddress.java:969)
> at 
> org.apache.cassandra.client.RingCache.refreshEndpointMap(RingCache.java:93)
> at org.apache.cassandra.client.RingCache.(RingCache.java:67)
> at 
> org.apache.cassandra.hadoop.ColumnFamilyRecordWriter.(ColumnFamilyRecordWriter.java:98)
> at 
> org.apache.cassandra.hadoop.ColumnFamilyRecordWriter.(ColumnFamilyRecordWriter.java:92)
> at 
> org.apache.cassandra.hadoop.ColumnFamilyOutputFormat.getRecordWriter(ColumnFamilyOutputFormat.java:132)
> at 
> org.apache.cassandra.hadoop.ColumnFamilyOutputFormat.getRecordWriter(ColumnFamilyOutputFormat.java:62)
> at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:553)
> at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:408)
> at org.apache.hadoop.mapred.Child.main(Child.java:170)
> 
> note: Same /etc/hosts file has been used across all the nodes.
> 
> Kindly help me to resolve this issue?
> 
> 
> Regards,
> Thamizhannal P
> 
> --- On Wed, 24/8/11, aaron morton  wrote:
> 
> From: aaron morton 
> Subject: Re: multi-node cassandra config doubt
> To: user@cassandra.apache.org
> Date: Wednesday, 24 August, 2011, 2:40 PM
> 
> Did you get this sorted ? 
> 
> At a guess I would say there are no nodes listed in the Hadoop JobConf.
> 
> Cheers
> 
> -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
> 
> On 23/08/2011, at 9:51 PM, Thamizh wrote:
> 
>> Hi All,
>> 
>> This is regarding multi-node cluster configuration doubt.
>> 
>> I have configured 3 nodes of cluster using Cassandra-0.8.4 and getting error 
>> when I ran Map/Reduce job which uploads records from HDFS to Cassandra.
>> 
>> Here are my 3 nodes cluster config file (cassandra.yaml) for Cassandra:
>> 
>> node01:
>> seeds: "node01,node02,node03"
>> auto_bootstrap: false
>> listen_address: 192.168.0.1
>> rpc_address: 192.168.0.1
>> 
>> 
>> node02:
>> 
>> seeds: "node01,node02,node03"
>> auto_bootstrap: true
>> listen_address: 192.168.0.2
>> rpc_address: 192.168.0.2
>> 
>> 
>> node03:
>> seeds: "node01,node02,node03"
>> auto_bootstrap: true
>> listen_address: 192.168.0.3
>> rpc_address: 192.168.0.3
>> 
>> When I ran M/R program, I am getting below error
>> 11/08/23 04:37:00 INFO mapred.JobClient:  map 100% reduce 11%
>> 11/08/23 04:37:06 INFO mapred.JobClient:  map 100% reduce 22%
>> 11/08/23 04:37:09 INFO mapred.JobClient:  map 100% reduce 33%
>> 11/

Re: help creating data model

2011-08-24 Thread aaron morton
I normally suggest trying a model with Standard CF's first as there are some 
down sides to super CF's. If you know there will only be a few sub columns 
there are probably OK (see 
http://wiki.apache.org/cassandra/CassandraLimitations). Your alternative design 
is fine. Test it out and see what works for you. 

Also (and I know not everyone agrees) depending on the use case it's ok to blob 
data up. Cassandra does not *need* to know about the individual properties of 
your entities. By that I mean there is not a query planner that can make better 
decisions about how to execute your query based on data types and 
distributions, or how what types columns should have in projections. 

So an alternative here is to collapse VisitantSessions and Sessions into one, 
and store the session data as a JSON (or similar) blob in the column value. 
This works best if you do not need to concurrently update fields in the entity. 
So if you write the session data once, or if you *always* only update from a 
single thread / process. Or if your data is designed to be overwritten. 

Cheers


-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 25/08/2011, at 1:15 AM, Helder Oliveira wrote:

> Thanks Indranath Ghosh for your tip!
> 
> I will continue here the question.
> 
> Aaron, i have read your suggestion and tried to design your suggestion and i 
> have one question regarding it.
> 
> Let's forget for now the Requests and Events!
> 
> Just keep the Visitants and the Sessions.
> 
> My goal is when having a visitant get all informations about him, in this 
> case all his past sessions so i can create a profile using his past.
> 
> You have suggested 3 CF's
> 
> Visitants CF
> key: id
> cn: pn
> cv: pv
> 
> Visitant Sessions CF
> key: visitant id
> cn: session id
> cv: none
> 
> Sessions CF
> key: session id
> cn: pn
> cv: pv
> 
> When i need to know everything about one visitant, i need to query "Visitant 
> Sessions CF" to get all keys, and then query "Sessions CF" for all keys 
> properties.
> 
> In this case, applying a Super Column Family to the "Sessions" isn't better ?
> 
> I mean something like:
> 
> {
>   "sessions": {
> 
> "visitant id 1": {
>   "session id 1": {
> "p1": {"p1": "v1"},
> "p2": {"jira": "v2"}
>   },
>   "session id 2": {
> "p1": {"p1": "v1"}
>   }
> }
>   
> "visitant id 2": {
>   "session id 3": {
> "p1": {"p1": "v1"},
> "p2": {"jira": "v2"}
>   },
>   "session id 4": {
> "p1": {"p1": "v1"}
>   }
> }
>   }
> }
> 
> Using this, i can get all sessions in the second query, instead of having all 
> sessions only at third query.
> 
> Regarding your notes, the Visitant CF will be almost unchangeable since the 
> beginning of his creation, the sessions will be added every time a known user 
> visits back, ceasing a new sessions.
> 
> Thanks a lot for you help guys, and i hope i was not saying crazy things :D
> 
> On Aug 22, 2011, at 11:23 PM, aaron morton wrote:
> 
>> Lets start with something quick and simple, all standard Column Families…
>> 
>> Visitant CF
>> key: id 
>> column name: property name
>> column value: property value 
>> 
>> Visitant Sessions CF
>> key: visitant id 
>> column name: session id
>> column value: none
>> 
>> Session CF
>> 
>> key: session_id
>> column_name: property value 
>> column_value: property value 
>> 
>> key: session_id/requests
>> column_name: request_id
>> column_value: none
>> 
>> key: session_id/events
>> column_name: event_id
>> column_value: none
>> 
>> Requests CF
>> 
>> key: request_id
>> column_name: property name
>> column_value: property value
>> 
>> Event CF
>> 
>> key: event_id
>> column_name: property name
>> column_value: property value
>> 
>> 
>> Notes:
>> 
>> * assuming the Visitant CF is slowing changing i kept it in it's own cf.  
>> * using compound keys to keep information related to sessions in the same 
>> CF. These could be diff CF's,or in the Request or Event CF. 
>> * the best model is the one that allows you to do your reads by getting one 
>> or a few rows from a single cf. 
>> * you could collapse the Request and Event CF's into one. 
>> 
>> If the event and request data is immutable (or there is no issues with 
>> concurrent modifications) I would recommend this…
>> 
>> Request / Event CF:
>> 
>> key: session_id/events or session_id/requests
>> column_name: event_id or session_id
>> column_value: data
>> 
>> 
>> Start with the simple model and then make changes to better handle your read 
>> queries.
>> 
>> Have fun :)
>> 
>> 
>> 
>> -
>> Aaron Morton
>> Freelance Cassandra Developer
>> @aaronmorton
>> http://www.thelastpickle.com
>> 
>> On 22/08/2011, at 11:13 PM, Helder Oliveira wrote:
>> 
>>> Hello all,
>>> 
>>> i have a SQL structure like this:
>>> 
>>> Visitant ( has several properties )
>>> Visitant has many Sessions
>>> Sessions ( has several properties )
>>> Session

Re: run Cassandra tutorial example

2011-08-24 Thread Thairu
"Error stacktraces" is output from maven.
mvn -e option turns on Error reporting.

From: aaron morton mailto:aa...@thelastpickle.com>>
Reply-To: "user@cassandra.apache.org" 
mailto:user@cassandra.apache.org>>
Date: Wed, 24 Aug 2011 02:14:12 -0700
To: "user@cassandra.apache.org" 
mailto:user@cassandra.apache.org>>
Subject: Re: run Cassandra tutorial example

HColumn(city=Austin)
Is the data you are after.

Have a look in src/main/resources/log4j.properties if you want to change the 
logging settings.

Have fun.
-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 24/08/2011, at 4:06 AM, Alvin UW wrote:

Thanks.

By your solution, the problem is fixed.
But my output is like this.
I don't understand what's the meaning of " Error stacktraces are turned on."
And I hope only the results are outputted, not the INFO.

 mvn -e exec:java -Dexec.args="get" 
-Dexec.mainClass="com.datastax.tutorial.TutorialRunner"
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] 
[INFO] Building cassandra-tutorial
[INFO]task-segment: [exec:java]
[INFO] 
[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[INFO] [exec:java {execution: default-cli}]
HColumn(city=Austin)
[INFO] 
[INFO] BUILD SUCCESSFUL
[INFO] 
[INFO] Total time: 1 second
[INFO] Finished at: Tue Aug 23 12:02:27 EDT 2011
[INFO] Final Memory: 11M/100M


2011/8/23 aaron morton mailto:aa...@thelastpickle.com>>
Did you sort this out ? The #cassandra IRC room is a good place to get help as 
well.

I tried to build it first using
mvn compile and got this different error
"[ERROR] Failed to execute goal on project cassandra-tutorial: Could not 
resolve dependencies for project 
com.datastax.tutorial:cassandra-tutorial:jar:1.0-SNAPSHOT: Could not find 
artifact me.prettyprint:hector-core:jar:0.8.0-2-SNAPSHOT -> [Help 1]"

There is a fix here...
https://github.com/zznate/cassandra-tutorial/pull/1

After than I did mvn compile and it worked.

So added the schema…
path-to-cassandra/bin/cassandra-cli --host localhost < 
~/code/github/datastax/cassandra-tutorial/npanxx_script.txt

And ran
mvn -e exec:java -Dexec.args="get" 
-Dexec.mainClass="com.datastax.tutorial.TutorialRunner"

Which outputted
HColumn(city=Austin)

Hope that helps.

-
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 23/08/2011, at 10:30 AM, Alvin UW wrote:

Hello,

I'd like to try the cassandra tutorial example: 
https://github.com/zznate/cassandra-tutorial
 by following the readme.

After typing  mvn -e exec:java -Dexec.args="get" 
-Dexec.mainClass="com.datastax.tutorial.TutorialRunner"
I got the following errors.
Should I do something before the above command?
Thanks.

+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] 
[INFO] Building cassandra-tutorial
[INFO]task-segment: [exec:java]
[INFO] 
[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[INFO] [exec:java {execution: default-cli}]
[INFO] 
[ERROR] BUILD ERROR
[INFO] 
[INFO] An exception occured while executing the Java class. 
com.datastax.tutorial.TutorialRunner

[INFO] 
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An exception occured 
while executing the Java class. com.datastax.tutorial.TutorialRunner
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.Compa

Atomic or Non-Atomic Counters

2011-08-24 Thread Sal Fuentes
The design document that is referenced on the Cassandra wiki page (
http://wiki.apache.org/cassandra/Counters) describes the Counters in
Cassandra as non-atomic (
https://issues.apache.org/jira/secure/attachment/12459754/Partitionedcountersdesigndoc.pdf).
However, the DataStax post on counters (
http://www.datastax.com/dev/blog/whats-new-in-cassandra-0-8-part-2-counters)
suggests that they are atomic. My impression is that the design document is
outdated (Nov2010). Can someone confirm or deny that these Counters are
atomic?



-- 
Salvador Fuentes Jr.


Re: Customized Secondary Index Schema

2011-08-24 Thread Ryan King
On Tue, Aug 23, 2011 at 10:03 AM, Alvin UW  wrote:
> Hello,
>
> As mentioned by Ed Anuff in his blog and slides, one way to build customized
> secondary index is:
> We use one CF, each row to represent a secondary index, with the secondary
> index name as row key.
> For example,
>
> Indexes = {
> "User_Keys_By_Last_Name" : {
> "adams" : "e5d61f2b-…",
> "alden" : "e80a17ba-…",
> "anderson" : "e5d61f2b-…",
> "davis" : "e719962b-…",
> "doe" : "e78ece0f-…",
> "franks" : "e66afd40-…",
> … : …,
> }
> }
>
> But the whole secondary index is partitioned into a single node, because of
> the row key.
> All the queries against this secondary index will go to this node. Of
> course, there are some replica nodes.
>
> Do you think this is a scalability problem, or any better solution to solve
> it?

Its certainly a scalability problem in that this solution has a hard
ceiling (this index can't get larger than the capacity of any single
node). It will probably work on small datasets, but if your dataset is
small then why are you using cassandra?

-ryan


Re: Cassandra Node Requirements

2011-08-24 Thread Jacob, Arun
Thanks for the links and the answers. The vagueness of my initial questions 
reflects the fact that I'm trying to configure for a general case — I will 
clarify below:

I need to account for a variety of use cases.
(1) they will be both read and write heavy.  I was assuming that SSDs would be 
really good to handle the heavy read load, but with the amount of data I need 
to store, SSDs arent economical.
(2) I should have clarified, the main use case has  95% of writes going to a 
single column family. The other CFs are going to be much smaller in relation to 
the primary CF, which will be sized to sizes below. Given that this is the 
case, are my assumptions about storage correct for that use case?
(3) In  that use case, the majority of reads will actually come from the most 
recently inserted 7% of the data. In other use cases, reads will be random. 
Another use case uses Solandra, and I am assuming that use case results in 
random reads.

Assuming 250-360TB storage, need for the primary use case, I'm still trying to 
determine  how many nodes  I need to stand up to service that much data. What 
is a reasonable amount of storage per node? You mentioned memory to storage 
ratio: I'm assuming that ratio trends higher with the more random reads you do. 
Could you provide an example ratio for a heavy read use case?

Thanks,

-- Arun

From: Edward Capriolo mailto:edlinuxg...@gmail.com>>
Reply-To: "user@cassandra.apache.org" 
mailto:user@cassandra.apache.org>>
Date: Wed, 24 Aug 2011 14:54:56 -0700
To: "user@cassandra.apache.org" 
mailto:user@cassandra.apache.org>>
Subject: Re: Cassandra Node Requirements



On Wed, Aug 24, 2011 at 2:54 PM, Jacob, Arun 
mailto:arun.ja...@disney.com>> wrote:
I'm trying to determine a node configuration for Cassandra. From what I've been 
able to determine from reading around:


 1.  we need to cap data size at 50% of total node storage capacity for 
compaction
 2.  with RF=3, that means that I need to effectively assume that I have 1/6th 
of total storage capacity.
 3.  SSDs are preferred, but of course  reduce storage capacity
 4.  using standard storage means you bump up your RAM to keep as much in 
memory as possible.

Right now we are looking at storage requirements of 42 – 60TB, assuming a 
baseline of 3TB/day and expiring data after 14-20 days (depending on use case), 
 I would assume based on above that we need 252- 360TB total storage max.

My questions:

 1.  is 8TB (meaning 1.33 actual TB storage/node) a reasonable per node storage 
size for Cassandra? I don’t want to use SSDs due to reduced storage capacity -- 
I don't want to buy 100s of nodes to support that reduced storage capacity of 
SSDs.  Given that I will be using standard drives, what is a 
reasonable/effective per node storage capacity?
 2.  other than splitting the commit log onto a separate drive, is there any 
other drive allocation I should be doing?
 3.  Assuming I'm not using SSDs, what would be a good memory size for a node? 
I've heard anything from 32-48 GB, but need more guidance.

Anything else that anyone has run into? What are common configurations being 
used by others?

Thanks in advance,

-- Arun




I would suggest checking out:
http://wiki.apache.org/cassandra/CassandraHardware
http://wiki.apache.org/cassandra/LargeDataSetConsiderations
http://www.slideshare.net/edwardcapriolo/real-world-capacity

1. we need to cap data size at 50% of total node storage capacity for compaction

False. You need 50% the capacity of your largest column family free with some 
other room for overhead. This changes all your numbers.

3. SSDs are preferred, but of course  reduce storage capacity

Avoid generalizations. Many use cases may get little benefit from SSD disks.

4. using standard storage means you bump up your RAM to keep as much in memory 
as possible.

In most cases you want to maintain some RAM / Hard disk ratio. SSD setups still 
likely need sizable RAM.

Your 3 questions are hard to answer because what hardware you need workload 
dependent. If really depends on active set, what percent of the data is active 
at any time. It also depends on your latency requirements, if you are modeling 
something like the way-back machine, that has different usage profile then a 
stock ticker application, that is again different from the usage patterns of an 
email system.

Generally people come to Cassandra because they are looking for low latency 
access to read and write data. This is hard to achieve on 8TB of disk. The size 
of the bloom filters and index files are themselves substantial with 8TB of 
data. You will also require a large amount of RAM on this disk to minimize disk 
seeks (or a super like SSD raid-0 (does this sound like a bad idea to you? It 
does to me :))

The only way to answer the question of how much hardware your need is with load 
testing. The Yahoo Cloud Serving Benchmark can help you fill up a node and test 
it with diffe

Re: question about cassandra.in.sh

2011-08-24 Thread Eric Evans
On Wed, Aug 24, 2011 at 1:28 PM, Koert Kuipers  wrote:
> my problem is that the scripts for my cassandra 0.7 instance don't work
> properly. the problem lies in the code snippets below. when i run the
> scripts they source /usr/share/cassandra/cassandra.in.sh, which has the
> wrong settings (it now loads all the jars from
> /usr/share/brisk/cassandra/lib). i know i can fix it by settings
> CASSANDRA_INCLUDE but i think thats not a very nice solution.
>
> why was the decision made that the central "casssandra.in.sh" should have
> higher priority than the local one? doesn't that break local installs?

It was considered the element of least surprise.  If it exists in
/usr/share/cassandra then Cassandra's been "installed", and in the
absence of any other data, that's probably what should be used.  If
it's a local copy *and* there's a copy installed in
/usr/share/cassandra, it's probably the owner of the local copy that
needs to know what they are doing and intervene with
CASSANDRA_INCLUDE.

> wouldnt it make more sense if scripts assumed they were in SOMEDIR/bin and
> then tried to load casssandra.in.sh from SOMEDIR first with the highest
> priority?

I don't think so, but then I was the one that reasoned out the current
search order, so YMMV. :)

> code snippet:
> if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
>     # Locations (in order) to use when searching for an include file.
>     for include in /usr/share/cassandra/cassandra.in.sh \
>    /usr/local/share/cassandra/cassandra.in.sh \
>    /opt/cassandra/cassandra.in.sh \
>    ~/.cassandra.in.sh \
>    `dirname $0`/cassandra.in.sh; do
>     if [ -r $include ]; then
>     . $include
>     break
>     fi
>     done
>

-- 
Eric Evans
Acunu | http://www.acunu.com | @acunu


Re: Atomic or Non-Atomic Counters

2011-08-24 Thread Jonathan Ellis
They are atomic in the sense that if you increment from N to M,
readers will never see any intermediate values, just N or M itself.

On Wed, Aug 24, 2011 at 6:50 PM, Sal Fuentes  wrote:
> The design document that is referenced on the Cassandra wiki page
> (http://wiki.apache.org/cassandra/Counters) describes the Counters in
> Cassandra as non-atomic
> (https://issues.apache.org/jira/secure/attachment/12459754/Partitionedcountersdesigndoc.pdf).
> However, the DataStax post on counters
> (http://www.datastax.com/dev/blog/whats-new-in-cassandra-0-8-part-2-counters)
> suggests that they are atomic. My impression is that the design document is
> outdated (Nov2010). Can someone confirm or deny that these Counters are
> atomic?
>
>
> --
> Salvador Fuentes Jr.
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com


Re: Cassandra Node Requirements

2011-08-24 Thread Jonathan Ellis
On Wed, Aug 24, 2011 at 1:54 PM, Jacob, Arun  wrote:
> we need to cap data size at 50% of total node storage capacity for
> compaction

Sort of.  There's some fine print, such as the 50% number is only if
you're manually forcing major compactions, which is not recommended,
but a bigger thing to know is that 1.0 will introduce "leveled
compaction" [1] inspired by leveldb.  The free space requirement will
then be a small number of megabytes.

[1] https://issues.apache.org/jira/browse/CASSANDRA-1608

> SSDs are preferred, but of course  reduce storage capacity
> using standard storage means you bump up your RAM to keep as much in memory
> as possible.

You want to keep "as much in ram as possible" either way; whether you
need SSDs or not depends on whether that's adequate for your "hot"
working set.

> is 8TB (meaning 1.33 actual TB storage/node) a reasonable per node storage
> size for Cassandra?

That's fine, but keep in mind that repairing that much data if you
lose a node could take a while.  Other things being equal, I'd prefer
more nodes with less capacity.

-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com


Re: nodetool repair does not return...

2011-08-24 Thread Boris Yen
Would Cassandra-2433 cause this?

On Wed, Aug 24, 2011 at 7:23 PM, Boris Yen  wrote:

> Hi,
>
> In our testing environment, we got two nodes with RF=2 running 0.8.4. We
> tried to test the repair functions of cassandra, however, every once a
> while, the "nodetool repair" never returns. We have checked the system.log,
> nothing seems to be out of ordinary, no errors, no exceptions. The data is
> only 50 mb, and it is consistently updated.
>
> Shutting down one node during the repair process could cause similar
> symptom. So, our original thought is that maybe one of the TreeRequest is
> not sent to the other node correctly, that might cause the repair to run
> forever. However, I did not see any relative log msg to support that. I am
> kind of running out of idea about this... Does anyone also has this problem?
>
> Regards
> Boris
>


Re: how to know if nodetool cleanup is safe?

2011-08-24 Thread Yan Chunlu
got it! thanks a lot for the explanation!

On Wed, Aug 24, 2011 at 1:06 AM, Edward Capriolo wrote:

>
> On Tue, Aug 23, 2011 at 11:56 AM, Sam Overton  wrote:
>
>> On 21 August 2011 12:34, Yan Chunlu  wrote:
>>
>>> since "nodetool cleanup" could remove hinted handoff,  will it cause the
>>> data loss?
>>
>>
>> Hi Yan,
>>
>> Hints are not guaranteed to be delivered and "nodetool cleanup" is one of
>> the reasons for that. This will only cause data-loss if you are writing at
>> CL.ANY where a hint counts as a write. If you are writing at CL.ONE or above
>> then at least one replica must receive the data for the write to succeed, so
>> losing hints will not cause data-loss.
>>
>> If a hint is not delivered then the replica to which it was intended will
>> become consistent after a read-repair, or after manual anti-entropy repair.
>>
>> Sam
>>
>> --
>> Sam Overton
>> Acunu | http://www.acunu.com | @acunu
>>
>
> If you run nodetool tpstats on each node in your cluster and ensure none of
> them have an active or pending threads in the Hinted stage no hints are
> currently being delivered. But as pointed out above Hinted Handoff is a best
> effort system.
>


For multi-tenant, is it good to have a key space for each tenant?

2011-08-24 Thread Guofeng Zhang
I wonder if it is a good practice to create a key space for each tenant. Any
advice is appreciated.

Thanks


Re: For multi-tenant, is it good to have a key space for each tenant?

2011-08-24 Thread Himanshi Sharma
I am working on similar sort of stuff. As per my knowledge, creating 
keyspace for each tenant would impose lot of memory constraints. 

Following Shared Keyspace and Shared Column families would be a better 
approach. And each row in CF could be referred by tenant_id as row key. 
And again it depends on the type of application. 

Hey this is just a suggestion, m not completely sure.. :)


Himanshi Sharma





From:
Guofeng Zhang 
To:
user@cassandra.apache.org
Date:
08/25/2011 10:38 AM
Subject:
For multi-tenant, is it good to have a key space for each tenant?



I wonder if it is a good practice to create a key space for each tenant. 
Any advice is appreciated.

Thanks


=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you