Re: Creating secondary index CQL3 cassandra 1.1.1

2012-06-21 Thread Sylvain Lebresne
On Thu, Jun 21, 2012 at 5:11 AM, Stephen Powis stephen.po...@pardot.com wrote:
 I have the following schema:

 describe columnfamily visitor_audit;

 CREATE TABLE visitor_audit (
   visitor_id text,
   audit_id uuid,
   account_id int,
   audit_type int,
   created_at text,
   PRIMARY KEY (visitor_id, audit_id)
 ) WITH
   comment='' AND
   caching='KEYS_ONLY' AND
   read_repair_chance=0.10 AND
   gc_grace_seconds=864000 AND
   min_compaction_threshold=4 AND
   max_compaction_threshold=32 AND
   replicate_on_write='true' AND
   compaction_strategy_class='SizeTieredCompactionStrategy' AND
   compression_parameters:sstable_compression='SnappyCompressor';

 I then created an index by executing the following:
 CREATE INDEX ix_accountid ON visitor_audit (account_id);

 When I attempt to execute: select * from visitor_audit where account_id=1;
 Nothing is returned even tho I have rows with account_id equal to 1.

 Is there anything I am missing here?

You are pretty much hitting
https://issues.apache.org/jira/browse/CASSANDRA-4328.
In other words, secondary indexes is not yet supported on table with
composite PRIMARY KEY, but we don't correctly reject the CREATE INDEX
command.

--
Sylvain


Re: When will CQL BATCH support binding variable (Query substitution use named parameters)?

2012-06-21 Thread Sylvain Lebresne
On Thu, Jun 21, 2012 at 12:06 AM, Data Craftsman
database.crafts...@gmail.com wrote:
 Hello,

 CQL BATCH is good for INSERT/UPDATE performance.

 But it cannot do binding variable, exposed to SQL injection.

 Is there a plan to make CQL BATCH to support binding variable in near future?

 e.g.
 http://code.google.com/a/apache-extras.org/p/cassandra-dbapi2/

 Query substitution
 Use named parameters and a dictionary of names and values.

 cursor.execute(SELECT column FROM CF WHERE name=:name, dict(name=Foo))

That may be a problem with the python driver (cassandra-dbapi2) and
you'd want to open an issue there.

But note that the query substitution of the python driver is *not*
related to CQL prepared statements (that use question marks for bound
variables). Those support BATCH all right.

--
Sylvain


Re: cqlsh commands

2012-06-21 Thread Jeff Williams
You should be able to get most of this information from the datastax 
documentation, e.g. http://www.datastax.com/docs/1.0/references/cql/index for 
version 1.0.

Jeff

On Jun 20, 2012, at 1:47 PM, Thierry Templier wrote:

 Hello,
 
 I'm using cqlsh tool to create column families and it works fine. However I 
 don't know how to use the following commands:
 
 Documented commands (type help topic):
 
 ASSUME  CAPTURE  DESC  DESCRIBE  EXIT  HELP  SELECT  SHOW  SOURCE  USE
 
 Moreover I can't display the related documentations using the help command.
 
 Thanks very much for your help.
 Thierry



Tiered compation on two disks

2012-06-21 Thread Flavio Baronti

Hi,

I have a Cassandra installation where we plan to store 1Tb of data, split 
between two 1Tb disks.
Tiered compation should be better suited for our workload (append-only, 
deletion of old data, few reads).
I know that tiered compaction needs 50% free disk space for worst case situation. How does this combine with the disk 
split? What happens if I have 500Gb of data in one disk and 500Gb in the other? Won't compaction try to build a single 
1Tb file, failing since there are only 500Gb free on each disk?


Flavio



Starting cassandra with -D option

2012-06-21 Thread Roshni Rajagopal
Hi Folks,

  We wanted to have a single cassandra installation, and use it to start 
cassandra in other nodes by passing it the cassandra configuration directories 
as a parameter. Idea is to avoid having the copies of cassandra code in each 
node, and starting each node by getting into bin/cassandra of that node.


As per http://www.datastax.com/docs/1.0/references/cassandra,
We have an option –D where we can supply some parameters to cassandra.
Has anyone tried this?
Im getting an error as below.

walmarts-MacBook-Pro-2:Node1-Cassandra1.1.0 walmart$  bin/cassandra  
-Dcassandra.config=file:///Users/walmart/Downloads/Cassandra/Node2-Cassandra1.1.0/conf
walmarts-MacBook-Pro-2:Node1-Cassandra1.1.0 walmart$  INFO 15:38:01,763 Logging 
initialized
 INFO 15:38:01,766 JVM vendor/version: Java HotSpot(TM) 64-Bit Server 
VM/1.6.0_31
 INFO 15:38:01,766 Heap size: 1052770304/1052770304
 INFO 15:38:01,766 Classpath: 
bin/../conf:bin/../build/classes/main:bin/../build/classes/thrift:bin/../lib/antlr-3.2.jar:bin/../lib/apache-cassandra-1.1.0.jar:bin/../lib/apache-cassandra-clientutil-1.1.0.jar:bin/../lib/apache-cassandra-thrift-1.1.0.jar:bin/../lib/avro-1.4.0-fixes.jar:bin/../lib/avro-1.4.0-sources-fixes.jar:bin/../lib/commons-cli-1.1.jar:bin/../lib/commons-codec-1.2.jar:bin/../lib/commons-lang-2.4.jar:bin/../lib/compress-lzf-0.8.4.jar:bin/../lib/concurrentlinkedhashmap-lru-1.2.jar:bin/../lib/guava-r08.jar:bin/../lib/high-scale-lib-1.1.2.jar:bin/../lib/jackson-core-asl-1.9.2.jar:bin/../lib/jackson-mapper-asl-1.9.2.jar:bin/../lib/jamm-0.2.5.jar:bin/../lib/jline-0.9.94.jar:bin/../lib/json-simple-1.1.jar:bin/../lib/libthrift-0.7.0.jar:bin/../lib/log4j-1.2.16.jar:bin/../lib/metrics-core-2.0.3.jar:bin/../lib/mx4j-tools-3.0.1.jar:bin/../lib/servlet-api-2.5-20081211.jar:bin/../lib/slf4j-api-1.6.1.jar:bin/../lib/slf4j-log4j12-1.6.1.jar:bin/../lib/snakeyaml-1.6.jar:bin/../lib/snappy-java-1.0.4.1.jar:bin/../lib/snaptree-0.1.jar:bin/../lib/jamm-0.2.5.jar
 INFO 15:38:01,768 JNA not found. Native methods will be disabled.
 INFO 15:38:01,826 Loading settings from 
file:/Users/walmart/Downloads/Cassandra/Node2-Cassandra1.1.0/conf
ERROR 15:38:01,873 Fatal configuration error error
Can't construct a java object for 
tag:yaml.org,2002:org.apache.cassandra.config.Config; exception=No single 
argument constructor found for class org.apache.cassandra.config.Config
 in reader, line 1, column 1:
cassandra.yaml

The other option would be to modify cassandra.in.sh.
Has anyone tried this??

Regards,
Roshni

This email and any files transmitted with it are confidential and intended 
solely for the individual or entity to whom they are addressed. If you have 
received this email in error destroy it immediately. *** Walmart Confidential 
***


Re: Starting cassandra with -D option

2012-06-21 Thread Flavio Baronti

The option must actually include also the name of the yaml file:

Dcassandra.config=file:///Users/walmart/Downloads/Cassandra/Node2-Cassandra1.1.0/conf/cassandra.yaml


Flavio


Il 6/21/2012 13:16 PM, Roshni Rajagopal ha scritto:

Hi Folks,

   We wanted to have a single cassandra installation, and use it to start 
cassandra in other nodes by passing it the cassandra configuration directories 
as a parameter. Idea is to avoid having the copies of cassandra code in each 
node, and starting each node by getting into bin/cassandra of that node.


As per http://www.datastax.com/docs/1.0/references/cassandra,
We have an option –D where we can supply some parameters to cassandra.
Has anyone tried this?
Im getting an error as below.

walmarts-MacBook-Pro-2:Node1-Cassandra1.1.0 walmart$  bin/cassandra  
-Dcassandra.config=file:///Users/walmart/Downloads/Cassandra/Node2-Cassandra1.1.0/conf
walmarts-MacBook-Pro-2:Node1-Cassandra1.1.0 walmart$  INFO 15:38:01,763 Logging 
initialized
  INFO 15:38:01,766 JVM vendor/version: Java HotSpot(TM) 64-Bit Server 
VM/1.6.0_31
  INFO 15:38:01,766 Heap size: 1052770304/1052770304
  INFO 15:38:01,766 Classpath: 
bin/../conf:bin/../build/classes/main:bin/../build/classes/thrift:bin/../lib/antlr-3.2.jar:bin/../lib/apache-cassandra-1.1.0.jar:bin/../lib/apache-cassandra-clientutil-1.1.0.jar:bin/../lib/apache-cassandra-thrift-1.1.0.jar:bin/../lib/avro-1.4.0-fixes.jar:bin/../lib/avro-1.4.0-sources-fixes.jar:bin/../lib/commons-cli-1.1.jar:bin/../lib/commons-codec-1.2.jar:bin/../lib/commons-lang-2.4.jar:bin/../lib/compress-lzf-0.8.4.jar:bin/../lib/concurrentlinkedhashmap-lru-1.2.jar:bin/../lib/guava-r08.jar:bin/../lib/high-scale-lib-1.1.2.jar:bin/../lib/jackson-core-asl-1.9.2.jar:bin/../lib/jackson-mapper-asl-1.9.2.jar:bin/../lib/jamm-0.2.5.jar:bin/../lib/jline-0.9.94.jar:bin/../lib/json-simple-1.1.jar:bin/../lib/libthrift-0.7.0.jar:bin/../lib/log4j-1.2.16.jar:bin/../lib/metrics-core-2.0.3.jar:bin/../lib/mx4j-tools-3.0.1.jar:bin/../lib/servlet-api-2.5-20081211.jar:bin/../lib/slf4j-api-1.6.1.jar:bin/../lib/slf4j-log4j12-1.6.1.jar:bin/../lib/snakeyaml-1.6.jar:bin/../lib/snappy-java-1.0.4.1.jar:bin/../lib/snaptree-0.1.jar:bin/../lib/jamm-0.2.5.jar
  INFO 15:38:01,768 JNA not found. Native methods will be disabled.
  INFO 15:38:01,826 Loading settings from 
file:/Users/walmart/Downloads/Cassandra/Node2-Cassandra1.1.0/conf
ERROR 15:38:01,873 Fatal configuration error error
Can't construct a java object for 
tag:yaml.org,2002:org.apache.cassandra.config.Config; exception=No single 
argument constructor found for class org.apache.cassandra.config.Config
  in reader, line 1, column 1:
 cassandra.yaml

The other option would be to modify cassandra.in.sh.
Has anyone tried this??

Regards,
Roshni

This email and any files transmitted with it are confidential and intended 
solely for the individual or entity to whom they are addressed. If you have 
received this email in error destroy it immediately. *** Walmart Confidential 
***







Re: cqlsh commands

2012-06-21 Thread paul cannon
What do you mean when you say you can't display the related documentations
using the help command?  What does cqlsh do instead?  I don't know about
any bugs in that area.

p

On Wed, Jun 20, 2012 at 6:47 AM, Thierry Templier 
thierry.templ...@restlet.com wrote:

 Hello,

 I'm using cqlsh tool to create column families and it works fine. However
 I don't know how to use the following commands:

 Documented commands (type help topic):
 ==**==
 ASSUME  CAPTURE  DESC  DESCRIBE  EXIT  HELP  SELECT  SHOW  SOURCE  USE

 Moreover I can't display the related documentations using the help command.

 Thanks very much for your help.
 Thierry



Strange behavior ¿data corruption?

2012-06-21 Thread Juan Ezquerro
Hi

I'm using version 1.1.1. I'm sorry about the lack of information, i don't
have stacktraces, nothig crash, just return empty, i explain, i do login as
usual, find in db if there is a user named X and who belongs to client Y,
if that is true i return the hash of password from db and do my checks.

Sometimes, after a reboot, the login stops work, debug say cassandra is
returning empty, can't find the same user named X who belongs to client Y,
i take a look into db with cassandra-cli and data is there and looks fine
but cassandra can't find it.

I drop user columfamily and then i create the same columnfamily and fill
with same data and login works again.

I talk with my buddy who have his own develop environment and same strange
behavior happend sometimes, always after machine halt. We work with oracle
java, i'm using debian testing and phpcassa as client.

Did you see something like that before? Suggestions for debug?

-- 
Juan Ezquerro LLanes Sofistic Team

Telf: 618349107/964051479


Re: Using row cache causes slowdown and unavailable reads

2012-06-21 Thread aaron morton
2300 * 5MB / 1024 = 11GB 

Check the logs for GC problems. 

Cheers

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

On 20/06/2012, at 8:39 PM, Nury Redjepow wrote:

 Good day,
 
 I'm load testing our cassandra instance. I have a column family with 2300 
 rows, each being ~ 5MB. And I run same query which asks for same rows. With 
 caching='keys_only response time is adequate. But with caching='ALL', we get 
 four times larger response time and 40-50$ of requests don't get served, 
 error is returned. 
 
 So I'm asking if 5MB rows are too big to be using row cache? Or maybe I 
 should do some memory tweaks?
 
 I'm using Cassand 1.1.10, JNA enabled.
 
 Sincerely, Nury. 



Re: Unbalanced ring in Cassandra 0.8.4

2012-06-21 Thread aaron morton
  Does cleanup only cleanup keys that no longer belong to that node. 
Yes.

I guess it could be an artefact of the bulk load. It's not been reported 
previously though. Try the cleanup and see how it goes. 

Cheers


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

On 21/06/2012, at 1:34 AM, Raj N wrote:

 Nick, thanks for the response. Does cleanup only cleanup keys that no longer 
 belong to that node. Just to add more color, when I bulk loaded all my data 
 into these 6 nodes, all of them had the same amount of data. After the first 
 nodetool repair, the first node started having more data than the rest of the 
 cluster. And since then it has never come back down. When I run cfstats on 
 the node, the amount of data for every column family is almost 2 times the 
 the amount of data for other. This is true for the number of keys estimate as 
 well. For 1 CF I see more than double the number of keys and that's the 
 largest cf as well with 34 GB data.
 
 Thanks
 -Rajesh
 
 On Wed, Jun 20, 2012 at 12:32 AM, Nick Bailey n...@datastax.com wrote:
 No. Cleanup will scan each sstable to remove data that is no longer
 owned by that specific node. It won't compact the sstables together
 however.
 
 On Tue, Jun 19, 2012 at 11:11 PM, Raj N raj.cassan...@gmail.com wrote:
  But wont that also run a major compaction which is not recommended anymore.
 
  -Raj
 
 
  On Sun, Jun 17, 2012 at 11:58 PM, aaron morton aa...@thelastpickle.com
  wrote:
 
  Assuming you have been running repair, it' can't hurt.
 
  Cheers
 
  -
  Aaron Morton
  Freelance Developer
  @aaronmorton
  http://www.thelastpickle.com
 
  On 17/06/2012, at 4:06 AM, Raj N wrote:
 
  Nick, do you think I should still run cleanup on the first node.
 
  -Rajesh
 
  On Fri, Jun 15, 2012 at 3:47 PM, Raj N raj.cassan...@gmail.com wrote:
 
  I did run nodetool move. But that was when I was setting up the cluster
  which means I didn't have any data at that time.
 
  -Raj
 
 
  On Fri, Jun 15, 2012 at 1:29 PM, Nick Bailey n...@datastax.com wrote:
 
  Did you start all your nodes at the correct tokens or did you balance
  by moving them? Moving nodes around won't delete unneeded data after
  the move is done.
 
  Try running 'nodetool cleanup' on all of your nodes.
 
  On Fri, Jun 15, 2012 at 12:24 PM, Raj N raj.cassan...@gmail.com wrote:
   Actually I am not worried about the percentage. Its the data I am
   concerned
   about. Look at the first node. It has 102.07GB data. And the other
   nodes
   have around 60 GB(one has 69, but lets ignore that one). I am not
   understanding why the first node has almost double the data.
  
   Thanks
   -Raj
  
  
   On Fri, Jun 15, 2012 at 11:06 AM, Nick Bailey n...@datastax.com
   wrote:
  
   This is just a known problem with the nodetool output and multiple
   DCs. Your configuration is correct. The problem with nodetool is
   fixed
   in 1.1.1
  
   https://issues.apache.org/jira/browse/CASSANDRA-3412
  
   On Fri, Jun 15, 2012 at 9:59 AM, Raj N raj.cassan...@gmail.com
   wrote:
Hi experts,
I have a 6 node cluster across 2 DCs(DC1:3, DC2:3). I have
assigned
tokens using the first strategy(adding 1) mentioned here -
   
http://wiki.apache.org/cassandra/Operations?#Token_selection
   
But when I run nodetool ring on my cluster, this is the result I
get -
   
Address DC  Rack  Status State   LoadOwnsToken
   
 113427455640312814857969558651062452225
172.17.72.91DC1 RAC13 Up Normal  102.07 GB   33.33%  0
45.10.80.144DC2 RAC5  Up Normal  59.1 GB 0.00%   1
172.17.72.93DC1 RAC18 Up Normal  59.57 GB33.33%
 56713727820156407428984779325531226112
45.10.80.146DC2 RAC7  Up Normal  59.64 GB0.00%
56713727820156407428984779325531226113
172.17.72.95DC1 RAC19 Up Normal  69.58 GB33.33%
 113427455640312814857969558651062452224
45.10.80.148DC2 RAC9  Up Normal  59.31 GB0.00%
113427455640312814857969558651062452225
   
   
As you can see the first node has considerably more load than the
others(almost double) which is surprising since all these are
replicas
of
each other. I am running Cassandra 0.8.4. Is there an explanation
for
this
behaviour?
Could https://issues.apache.org/jira/browse/CASSANDRA-2433 be
the
cause for this?
   
Thanks
-Raj
  
  
 
 
 
 
 
 



RE: Much more native memory used by Cassandra then the configured JVM heap size

2012-06-21 Thread Poziombka, Wade L
Just to close this item: with CASSANDRA-4314 applied I see no memory errors 
(either Java heap or native heap).  Cassandra appears to be a hog with its 
memory mapped files.  This caused us to wrongly think it was the culprit in a 
severe native memory leak.  However, our leaky process was a different jsvc 
process altogether.



I wanted to make sure I set the record straight and not leave the idea out 
there that Cassandra may have a memory problem.



Wade Poziombka

Intel Americas, Inc.




From: Poziombka, Wade L [mailto:wade.l.poziom...@intel.com]
Sent: Wednesday, June 13, 2012 10:53 AM
To: user@cassandra.apache.org
Subject: RE: Much more native memory used by Cassandra then the configured JVM 
heap size

Seems like my only recourse is to remove jna.jar and just take the 
performance/swapping pain?

Obviously can't have the entire box lock up.  I can provide a pmap etc. if 
needed.

From: Poziombka, Wade L [mailto:wade.l.poziom...@intel.com]
Sent: Wednesday, June 13, 2012 10:28 AM
To: user@cassandra.apache.orgmailto:user@cassandra.apache.org
Subject: RE: Much more native memory used by Cassandra then the configured JVM 
heap size

I have experienced the same issue.  The Java heap seems fine but eventually the 
OS runs out of heap.  In my case it renders the entire box unusable without a 
hard reboot.  Console shows:

is there a way to limit the native heap usage?


xfs invoked oom-killer: gfp_mask=0x201d2, order=0, oomkilladj=0



Call Trace:

 [800c9d3a] out_of_memory+0x8e/0x2f3

 [8002dfd7] __wake_up+0x38/0x4f

 [8000f677] __alloc_pages+0x27f/0x308

 [80013034] __do_page_cache_readahead+0x96/0x17b

 [80013971] filemap_nopage+0x14c/0x360

 [8000896c] __handle_mm_fault+0x1fd/0x103b

 [8002dfd7] __wake_up+0x38/0x4f

 [800671f2] do_page_fault+0x499/0x842

 [800b8f39] audit_filter_syscall+0x87/0xad

 [8005dde9] error_exit+0x0/0x84



Node 0 DMA per-cpu: empty

Node 0 DMA32 per-cpu: empty

Node 0 Normal per-cpu:

cpu 0 hot: high 186, batch 31 used:23

cpu 0 cold: high 62, batch 15 used:14
...
cpu 23 cold: high 62, batch 15 used:8
Node 1 HighMem per-cpu: empty
Free pages:  158332kB (0kB HighMem)
Active:16225503 inactive:1 dirty:0 writeback:0 unstable:0 free:39583 slab:21496
Node 0 DMA free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB
present:0kB
lowmem_reserve[]: 0 0 32320 32320
Node 0 DMA32 free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB
present:0
lowmem_reserve[]: 0 0 32320 32320
Node 0 Normal free:16136kB min:16272kB low:20340kB high:24408kB active:3255624


From: aaron morton [mailto:aa...@thelastpickle.com]
Sent: Tuesday, June 12, 2012 4:08 AM
To: user@cassandra.apache.orgmailto:user@cassandra.apache.org
Subject: Re: Much more native memory used by Cassandra then the configured JVM 
heap size

see http://wiki.apache.org/cassandra/FAQ#mmap

which cause the OS low memory.
If the memory is used for mmapped access the os can get it back later.

Is the low free memory causing a problem ?

Cheers


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

On 12/06/2012, at 5:52 PM, Jason Tang wrote:

Hi

I found some information of this issue
And seems we can have other strategy for data access to reduce mmap usage, in 
order to use less memory.

But I didn't find the document to describe the parameters for Cassandra 1.x, is 
it a good way to use this parameter to reduce shared memory usage and what's 
the impact? (btw, our data model is dynamical, which means the although the 
through put is high, but the life cycle of the data is short, one hour or less).


# Choices are auto, standard, mmap, and mmap_index_only.
disk_access_mode: auto


http://comments.gmane.org/gmane.comp.db.cassandra.user/7390
2012/6/12 Jason Tang ares.t...@gmail.commailto:ares.t...@gmail.com
See my post, I limit the HVM heap 6G, but actually Cassandra will use more 
memory which is not calculated in JVM heap.

I use top to monitor total memory used by Cassandra.

=
-Xms6G -Xmx6G -Xmn1600M

2012/6/12 Jeffrey Kesselman jef...@gmail.commailto:jef...@gmail.com
Btw.  I suggest you spin up JConsole as it will give you much more detai kon 
what your VM is actually doing.



On Mon, Jun 11, 2012 at 9:14 PM, Jason Tang 
ares.t...@gmail.commailto:ares.t...@gmail.com wrote:
Hi

We have some problem with Cassandra memory usage, we configure the JVM HEAP 6G, 
but after runing Cassandra for several hours (insert, update, delete). The 
total memory used by Cassandra go up to 15G, which cause the OS low memory.
So I wonder if it is normal to have so many memory used by cassandra?

And how to limit the native memory used by Cassandra?


===
Cassandra 1.0.3, 64 bit jdk.

Memory ocupied by Cassandra 15G
  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
 9567 casadm20   0 28.3g  15g 9.1g S  269 65.1 385:57.65 java


Re: Creating secondary index CQL3 cassandra 1.1.1

2012-06-21 Thread Stephen Powis
Ah yes that's it exactly, including the time outs/errors.  I wonder why
this didn't come up when I googled the error from my system logs.

Thanks!
Stephen

On Thu, Jun 21, 2012 at 2:47 AM, Sylvain Lebresne sylv...@datastax.comwrote:

 On Thu, Jun 21, 2012 at 5:11 AM, Stephen Powis stephen.po...@pardot.com
 wrote:
  I have the following schema:
 
  describe columnfamily visitor_audit;
 
  CREATE TABLE visitor_audit (
visitor_id text,
audit_id uuid,
account_id int,
audit_type int,
created_at text,
PRIMARY KEY (visitor_id, audit_id)
  ) WITH
comment='' AND
caching='KEYS_ONLY' AND
read_repair_chance=0.10 AND
gc_grace_seconds=864000 AND
min_compaction_threshold=4 AND
max_compaction_threshold=32 AND
replicate_on_write='true' AND
compaction_strategy_class='SizeTieredCompactionStrategy' AND
compression_parameters:sstable_compression='SnappyCompressor';
 
  I then created an index by executing the following:
  CREATE INDEX ix_accountid ON visitor_audit (account_id);
 
  When I attempt to execute: select * from visitor_audit where
 account_id=1;
  Nothing is returned even tho I have rows with account_id equal to 1.
 
  Is there anything I am missing here?

 You are pretty much hitting
 https://issues.apache.org/jira/browse/CASSANDRA-4328.
 In other words, secondary indexes is not yet supported on table with
 composite PRIMARY KEY, but we don't correctly reject the CREATE INDEX
 command.

 --
 Sylvain



Indexing JSON in Cassandra

2012-06-21 Thread Brian O'Neill
I know we had this conversation over on the dev list a while back:
http://www.mail-archive.com/dev@cassandra.apache.org/msg03914.html

I just wanted to let people know that we added the capability to our
cassandra-indexing extension.
http://brianoneill.blogspot.com/2012/06/indexing-json-in-cassandra.html

Let us know if you have any trouble with it.

-brian

-- 
Brian ONeill
Lead Architect, Health Market Science (http://healthmarketscience.com)
mobile:215.588.6024
blog: http://weblogs.java.net/blog/boneill42/
blog: http://brianoneill.blogspot.com/


Re: Much more native memory used by Cassandra then the configured JVM heap size

2012-06-21 Thread Terje Marthinussen
We run some fairly large and busy Cassandra setups.
All of them without mmap.

I have yet to see a benchmark which conclusively can say mmap is better (or 
worse for that matter) than standard ways of doing I/O and we have done many of 
them last 2 years by different people, with different tools and with different 
HW.

My only conclusion is that not using mmap is easier to monitor and debug (you 
actually see what memory is used by Cassandra) and is more stable overall.

I highly recommend non-mmap setups

Regards,
Terje

On 22 Jun 2012, at 05:05, Poziombka, Wade L wade.l.poziom...@intel.com 
wrote:

 Just to close this item: with CASSANDRA-4314 applied I see no memory errors 
 (either Java heap or native heap).  Cassandra appears to be a hog with its 
 memory mapped files.  This caused us to wrongly think it was the culprit in a 
 severe native memory leak.  However, our leaky process was a different jsvc 
 process altogether.
  
 I wanted to make sure I set the record straight and not leave the idea out 
 there that Cassandra may have a memory problem.
  
 Wade Poziombka
 Intel Americas, Inc.
  
  
 From: Poziombka, Wade L [mailto:wade.l.poziom...@intel.com] 
 Sent: Wednesday, June 13, 2012 10:53 AM
 To: user@cassandra.apache.org
 Subject: RE: Much more native memory used by Cassandra then the configured 
 JVM heap size
  
 Seems like my only recourse is to remove jna.jar and just take the 
 performance/swapping pain?
  
 Obviously can’t have the entire box lock up.  I can provide a pmap etc. if 
 needed.
  
 From: Poziombka, Wade L [mailto:wade.l.poziom...@intel.com] 
 Sent: Wednesday, June 13, 2012 10:28 AM
 To: user@cassandra.apache.org
 Subject: RE: Much more native memory used by Cassandra then the configured 
 JVM heap size
  
 I have experienced the same issue.  The Java heap seems fine but eventually 
 the OS runs out of heap.  In my case it renders the entire box unusable 
 without a hard reboot.  Console shows:
  
 is there a way to limit the native heap usage?
  
 xfs invoked oom-killer: gfp_mask=0x201d2, order=0, oomkilladj=0
  
 Call Trace:
  [800c9d3a] out_of_memory+0x8e/0x2f3
  [8002dfd7] __wake_up+0x38/0x4f
  [8000f677] __alloc_pages+0x27f/0x308
  [80013034] __do_page_cache_readahead+0x96/0x17b
  [80013971] filemap_nopage+0x14c/0x360
  [8000896c] __handle_mm_fault+0x1fd/0x103b
  [8002dfd7] __wake_up+0x38/0x4f
  [800671f2] do_page_fault+0x499/0x842
  [800b8f39] audit_filter_syscall+0x87/0xad
  [8005dde9] error_exit+0x0/0x84
  
 Node 0 DMA per-cpu: empty
 Node 0 DMA32 per-cpu: empty
 Node 0 Normal per-cpu:
 cpu 0 hot: high 186, batch 31 used:23
 cpu 0 cold: high 62, batch 15 used:14
 …
 cpu 23 cold: high 62, batch 15 used:8
 Node 1 HighMem per-cpu: empty
 Free pages:  158332kB (0kB HighMem)
 Active:16225503 inactive:1 dirty:0 writeback:0 unstable:0 free:39583 
 slab:21496
 Node 0 DMA free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB
 present:0kB
 lowmem_reserve[]: 0 0 32320 32320
 Node 0 DMA32 free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB
 present:0
 lowmem_reserve[]: 0 0 32320 32320
 Node 0 Normal free:16136kB min:16272kB low:20340kB high:24408kB active:3255624
  
  
 From: aaron morton [mailto:aa...@thelastpickle.com] 
 Sent: Tuesday, June 12, 2012 4:08 AM
 To: user@cassandra.apache.org
 Subject: Re: Much more native memory used by Cassandra then the configured 
 JVM heap size
  
 see http://wiki.apache.org/cassandra/FAQ#mmap
  
 which cause the OS low memory.
 If the memory is used for mmapped access the os can get it back later. 
  
 Is the low free memory causing a problem ?
  
 Cheers
  
  
 -
 Aaron Morton
 Freelance Developer
 @aaronmorton
 http://www.thelastpickle.com
  
 On 12/06/2012, at 5:52 PM, Jason Tang wrote:
  
 
 Hi
  
 I found some information of this issue
 And seems we can have other strategy for data access to reduce mmap usage, in 
 order to use less memory.
  
 But I didn't find the document to describe the parameters for Cassandra 1.x, 
 is it a good way to use this parameter to reduce shared memory usage and 
 what's the impact? (btw, our data model is dynamical, which means the 
 although the through put is high, but the life cycle of the data is short, 
 one hour or less).
  
 
 # Choices are auto, standard, mmap, and mmap_index_only.
 disk_access_mode: auto
 
  
 http://comments.gmane.org/gmane.comp.db.cassandra.user/7390 
 
 2012/6/12 Jason Tang ares.t...@gmail.com
 See my post, I limit the HVM heap 6G, but actually Cassandra will use more 
 memory which is not calculated in JVM heap. 
  
 I use top to monitor total memory used by Cassandra.
  
 =
 -Xms6G -Xmx6G -Xmn1600M
  
 2012/6/12 Jeffrey Kesselman jef...@gmail.com
 Btw.  I suggest you spin up JConsole as it will give you much more detai kon 
 what your VM is actually doing.
 
 
  
 On Mon, Jun 11, 2012 at 9:14 PM, Jason Tang ares.t...@gmail.com wrote:
 Hi
  

Cassandra 1.0.6 data flush query

2012-06-21 Thread Roshan
Hi

I am using Cassandra 1.0.6 version in our production system and noticed that
Cassandra flushing the data to SSTable and the file size is  10MB. With
under moderate write load, the Cassandra flushing lots of memtables with
small sizes. With this compaction doing lots of compactions.

O/S - Centos 64bit Sun Java 1.6_31
VM size - 2.4GB

Following parameters change on cassandra.yaml file.

flush_largest_memtables_at: 0.45 (reduce it from .75)
reduce_cache_sizes_at: 0.55 (reduce it from .85)
reduce_cache_capacity_to: 0.3 (reduce it from .6)
concurrent_compactors: 1
memtable_total_space_in_mb: 200 
in_memory_compaction_limit_in_mb: 16 (from 64MB)
Key cache = 1
Row cache = 0
Could someone please help me on this.

Thanks
/Roshan
  

--
View this message in context: 
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Cassandra-1-0-6-data-flush-query-tp7580733.html
Sent from the cassandra-u...@incubator.apache.org mailing list archive at 
Nabble.com.