Streaming fails with inter node encryption on

2013-03-25 Thread Mathijs Vogelzang
Hi all,

We have a 6-node cassandra cluster which has worked fine for a long
time through upgrades starting from 0.8.x to 1.1.x. Recently we
upgraded to 1.2.2, and since then streaming repair doesn't work
anymore (everything else works, gossip, serving Thrift queries etc.).
We upgraded to 1.2.3, upgraded the JDK to the latest version (1.7u17),
but nothing helped. The only error message in the logs is the
following pasted below:

 INFO [AntiEntropyStage:1] 2013-03-25 09:30:33,493
StreamOutSession.java (line 162) Streaming to /xxx.xxx.xxx.xxx
 INFO [Streaming to /10.181.129.193:1] 2013-03-25 09:30:33,859
StreamReplyVerbHandler.java (line 50) Need to re-stream file
/var/lib/cassandra/data/db to /xxx.xxx.xxx.xxx
 INFO [Streaming to /10.181.129.193:1] 2013-03-25 09:30:33,994
StreamReplyVerbHandler.java (line 50) Need to re-stream file
/var/lib/cassandra/data/db to /xxx.xxx.xxx.xxx
 INFO [Streaming to /10.181.129.193:1] 2013-03-25 09:30:34,190
StreamReplyVerbHandler.java (line 50) Need to re-stream file
/var/lib/cassandra/data/.db to /xxx.xxx.xxx.xxx
ERROR [Streaming to /10.181.129.193:1] 2013-03-25 09:30:34,474
CassandraDaemon.java (line 164) Exception in thread Thread[Streaming
to /xxx.xxx.xxx.xxx:1,5,main]
java.lang.RuntimeException: java.io.EOFException
at com.google.common.base.Throwables.propagate(Throwables.java:160)
at 
org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:32)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:392)
at 
org.apache.cassandra.streaming.FileStreamTask.receiveReply(FileStreamTask.java:193)
at 
org.apache.cassandra.streaming.compress.CompressedFileStreamTask.stream(CompressedFileStreamTask.java:114)
at 
org.apache.cassandra.streaming.FileStreamTask.runMayThrow(FileStreamTask.java:91)
at 
org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
... 3 more

Subsequently the repair command hangs, and the nodes start running out
of memory after a few cycles with the heap being full of Merkle tree
related datastructures.

We've now discovered that when we turn internode encryption off then
the streaming works again. Is there something that could explain why
the regular internode network traffic works (else thrift queries
should also fail), but the streaming doesn't?

Our internode encryption settings were:
server_encryption_options:
internode_encryption: all
keystore: conf/.keystore
keystore_password: 
truststore: conf/.truststore
truststore_password: 
protocol: TLS
algorithm: SunX509
store_type: JKS
cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA]


Best regards,

Mathijs


RE: cannot start Cassandra on Windows7

2013-03-25 Thread Михаил Колесников
I always run Cassandra (from 0.9 to latest 1.2.3) on Win7 machine without any 
issue with default configuration settings. The only thing I've changed in 
cassandra.yaml is cluster_name. I also recommend to add an additional JVM flag 
-Dfile.encoding=UTF-8 in cassandra.bat and cassandra-cli.bat and always run 
cassandra.bat without '-f'. If you want to run Cassandra as service on Windows 
machine you should use some service wrapper, for example 
http://wrapper.tanukisoftware.com

Michael

-Original Message-
From: Wei Zhu [mailto:wz1...@yahoo.com] 
Sent: Friday, March 22, 2013 9:58 PM
To: user@cassandra.apache.org
Subject: Re: cannot start Cassandra on Windows7

It's there:

http://www.datastax.com/docs/1.2/cluster_architecture/cluster_planning#node-init-config

It's a long document You need to look at the cassandra.yaml and 
cassandra-env.sh and make sure you understand the settings there. 

By the way, did datastax just face lift their document web site? It looks nice.
-Wei

- Original Message -
From: "Marina" 
To: user@cassandra.apache.org
Sent: Friday, March 22, 2013 9:18:46 AM
Subject: Re: cannot start Cassandra on Windows7

Jabbar Azam  gmail.com> writes:

> 
> 
> 
> 
> 
> 
> Oops, I also had opscenter installed on my PC.
> My  changes
> log4j-server.properties file
log4j.appender.R.File=c:/var/log/cassandra/system.log
> cassandra.yaml file# directories where 
> Cassandra
should store data on disk.data_file_directories:    - 
c:/var/lib/cassandra/data# commit logcommitlog_directory: 
c:/var/lib/cassandra/commitlog# saved
cachessaved_caches_directory: c:/var/lib/cassandra/saved_caches
> I also added an environment variable for windows called CASSANDRA_HOME 
> I needed to do this for one of my colleagues and now it's documented 
> ;)
> 
> 
> 
> 

Thanks, Jabbar, Victor,
Yes, after I made similar changes I was able to start Cassandra too. 
Would be nice if these instructions were included with the main Cassandra 
documentation/WIKI :)

Thanks!
Marina


> On 22 March 2013 15:47, Jabbar Azam  gmail.com> wrote:
> Viktor, you're right. I didn't get any errors on my windows console 
> but
cassandra.yaml and log4j-server.properties need modifying.
> 
> 
> 
> On 22 March 2013 15:44, Viktor Jevdokimov  
> adform.com>
wrote:You NEED to edit cassandra.yaml and log4j-server.properties paths before 
starting on Windows.
> There're a LOT of things to learn for starters. Google for Cassandra 
> on
Windows.
> Best regards / Pagarbiai
> Viktor Jevdokimov
> Senior Developer
> Email: Viktor.Jevdokimov  adform.com
> Phone: +370 5 212 3063
> Fax: +370 5 261 0453
> J. Jasinskio 16C,
> LT-01112 Vilnius,
> Lithuania
> Disclaimer: The information contained in this message and attachments 
> is
intended solely for the attention and use of the named addressee and may be 
confidential. If you are not the intended recipient, you are reminded that the 
information remains the property of the sender. You must not use, disclose, 
distribute, copy, print or rely on this e-mail. If you have received this 
message in error, please contact the sender immediately and irrevocably delete 
this message and any copies.> -Original Message-
> 
> 
> > From: Marina [mailto:ppine7  yahoo.com]
> > Sent: Friday, March 22, 2013 17:21
> > To: user  cassandra.apache.org
> > Subject: cannot start Cassandra on Windows7> Hi, I have downloaded 
> > apache-cassandra-1.2.3-bin.tar.gz and un-zipped it on my
> > Windows7 machine (I did not find a Windows-specific 
> > distributable...). Then,
I
> > tried to start Cassandra as following and got an error:
> >
> > C:\Marina\Tools\apache-cassandra-1.2.3\bin>cassandra.bat -f Starting 
> > Cassandra Server Exception in thread "main"
> > java.lang.ExceptionInInitializerError
> > Caused by: java.lang.RuntimeException: Couldn't figure out log4j
> > configuration:
> > log4j-server.properties
> >         at
> > org.apache.cassandra.service.CassandraDaemon.initLog4j(CassandraDaem
> > o
> > n.java:81)
> >         at
> > org.apache.cassandra.service.CassandraDaemon.(CassandraDaemo
> > n
> > .java:57)
> > Could not find the main class:
> > org.apache.cassandra.service.CassandraDaemon.  Pr ogram will exit.
> >
> > C:\Marina\Tools\apache-cassandra-1.2.3\bin>
> >
> > It looks similar to the Cassandra issue that was already fixed:
> > https://issues.apache.org/jira/browse/CASSANDRA-2383
> >
> > however I am still getting this error
> > I am an Administrator on my machine, and have access to all files in 
> > the
> > apache- cassandra-1.2.3\conf dir, including the log4j ones.
> >
> > Do I need to configure anything else on Winows ? I did not find any
> > Windows- specific installation/setup/startup instructions - if there 
> > are
such
> > documents somewhere, please let me know!
> >
> > Thanks,
> > Marina
> >
> >
> 
> 
> 
> 
> 
> -- ThanksJabbar Azam
> 
> 
> 
> 
> 
> -- ThanksJabbar Azam
> 
> 
> 







Re: Recovering from a faulty cassandra node

2013-03-25 Thread Jabbar Azam
nodetool cleanup took about 23.5 hours on each node(did this in parallel).
started the nodetool cleanup 20:53 on March 22 and it's still running
(10:08 25 March)

The RF = 3. The load on each node is 490 GB, 491 GB, 323GB, 476GB

I think I read some that removenode is faster the more nodes there are in
the cluster.

My next email will be the last in the thread. I thought the info might be
useful to other people in the community.





On 21 March 2013 21:59, Jabbar Azam  wrote:

> nodetool cleanup command removes keys which can be deleted from the node
> the  command is run. So I'm assuming I can run nodetool cleanup on all the
> old nodes in parallel. Wouldn't do this on a live cluster as it's I/O
> intensive on each node.
>
>
> On 21 March 2013 17:26, Jabbar Azam  wrote:
>
>> Can I do a multiple node nodetool cleanup on my test cluster?
>> On 21 Mar 2013 17:12, "Jabbar Azam"  wrote:
>>
>>>
>>> All cassandra-topology.properties are the same.
>>>
>>> The node add appears to be successful. I can see it using nodetool
>>> status. I'm doing a node cleanup on the old nodes and then will do a node
>>> remove, to remove the old node. The actual node join took about 6 hours.
>>> The wiped node(now new node) has about 324 GB of files in /var/lib/cassandra
>>>
>>>
>>>
>>>
>>>
>>> On 21 March 2013 16:58, aaron morton  wrote:
>>>
  Not sure if I needed to change cassandra-topology.properties file on
 the existing nodes.

 If you are using the PropertyFileSnitch all nodes need to have the same
 cassandra-topology.properties file.

 Cheers

-
 Aaron Morton
 Freelance Cassandra Consultant
 New Zealand

 @aaronmorton
 http://www.thelastpickle.com

 On 21/03/2013, at 1:34 AM, Jabbar Azam  wrote:

 I've added the node with a different IP address and after disabling the
 firewall data is being streamed from the existing nodes to the wiped node.
 I'll do a cleanup, followed by remove node once it's done.

 I've also added the new node to the existing nodes'
 cassandra-topology.properties file and restarted them. I also found I had
 iptables switched on and couldn't understand why the wiped node couldn't
 see the cluster. Not sure if I needed to change
 cassandra-topology.properties file on the existing nodes.




 On 19 March 2013 15:49, Jabbar Azam  wrote:

> Do I use removenode before adding the reinstalled node or after?
>
>
> On 19 March 2013 15:45, Alain RODRIGUEZ  wrote:
>
>> In 1.2, you may want to use the nodetool removenode if your server i
>> broken or unreachable, else I guess nodetool decommission remains the 
>> good
>> way to remove a node. (
>> http://www.datastax.com/docs/1.2/references/nodetool)
>>
>> When this node is out, rm -rf /yourpath/cassandra/* on this serveur,
>> change the configuration if needed (not sure about the auto_bootstrap
>> param) and start Cassandra on that node again. It should join the ring 
>> as a
>> new node.
>>
>> Good luck.
>>
>>
>> 2013/3/19 Hiller, Dean 
>>
>> Since you "cleared" out that node, it IS the replacement node.
>>>
>>> Dean
>>>
>>> From: Jabbar Azam mailto:aja...@gmail.com>>
>>> Reply-To: "user@cassandra.apache.org>> user@cassandra.apache.org>" >> user@cassandra.apache.org>>
>>> Date: Tuesday, March 19, 2013 9:29 AM
>>> To: "user@cassandra.apache.org" <
>>> user@cassandra.apache.org>
>>> Subject: Re: Recovering from a faulty cassandra node
>>>
>>> Hello Dean.
>>>
>>> I'm using vnodes so can't specify a token. In addition I can't
>>> follow the replace node docs because I don't have a replacement node.
>>>
>>>
>>> On 19 March 2013 15:25, Hiller, Dean >> dean.hil...@nrel.gov>> wrote:
>>> I have not done this as of yet but from all that I have read your
>>> best option is to follow the replace node documentation which I belive 
>>> you
>>> need to
>>>
>>>
>>>  1.  Have the token be the same BUT add 1 to it so it doesn't think
>>> it's the same computer
>>>  2.  Have the bootstrap option set or something so streaming takes
>>> affect.
>>>
>>> I would however test that all out in QA to make sure it works and if
>>> you have QUOROM reads/writes a good part of that test would be to take 
>>> node
>>> X down after your node Y is back in the cluster to make sure 
>>> reads/writes
>>> are working on the node you fixed…..you just need to make sure node X
>>> shares one of the token ranges of node Y AND your writes/reads are in 
>>> that
>>> token range.
>>>
>>> Dean
>>>
>>> From: Jabbar Azam mailto:aja...@gmail.com>>> aja...@gmail.com>>
>>> Reply-To: "user@cassandra.ap

RE: java.lang.IllegalStateException: No sources found for (0,0]

2013-03-25 Thread Sloot, Hans-Peter
Hi Tyler,

I must have sounded like a complete dummy. I read your reply from my cell phone 
and did not understand it immediately.

I just noticed that I had made mistakes in the seed provider ipaddresses.

Thanks Hans-peter






From: Tyler Hobbs [mailto:ty...@datastax.com]
Sent: donderdag 21 maart 2013 20:52
To: Sloot, Hans-Peter
Subject: Re: java.lang.IllegalStateException: No sources found for (0,0]

It's also in the cassandra.yaml: 
http://www.datastax.com/docs/1.2/configuration/node_configuration#seed-provider

In the future, please try to keep responses on the mailing list so that others 
can find the answer in the future. Thanks!

On Thu, Mar 21, 2013 at 2:43 PM, Sloot, Hans-Peter 
mailto:hans-peter.sl...@atos.net>> wrote:

No



how can I do that?



I didn't on my 2.1 cluster either.

At least i do not remember



-Origineel bericht-

Van: Tyler Hobbs

Verz.:  21-03-2013, 17:17

Aan: user@cassandra.apache.org

Onderwerp: Re: java.lang.IllegalStateException: No sources found for (0,0]
Did you also change the seeds to match the listen address?

On Thu, Mar 21, 2013 at 9:22 AM, Sloot, Hans-Peter 
mailto:hans-peter.sl...@atos.net>> wrote:
HI,

A minute or so after starting the dse service (Datastax 3.0) the daemon stops.

The system.log says:
INFO [CompactionExecutor:1] 2013-03-21 14:53:18,596 CompactionTask.java (line 
230) Compacted to [/var/lib/cassandra/data/system/Loc
ationInfo/system-LocationInfo-hf-5-Data.db,].  540 to 337 (~62% of original) 
bytes for 3 keys at 0.004464MB/s.  Time: 72ms.
INFO [main] 2013-03-21 14:53:48,439 StorageService.java (line 789) JOINING: 
Starting to bootstrap...
ERROR [main] 2013-03-21 14:53:48,447 AbstractCassandraDaemon.java (line 410) 
Exception encountered during startup
java.lang.IllegalStateException: No sources found for (0,0]
at 
org.apache.cassandra.dht.RangeStreamer.getAllRangesWithSourcesFor(RangeStreamer.java:163)
at 
org.apache.cassandra.dht.RangeStreamer.addRanges(RangeStreamer.java:121)
at org.apache.cassandra.dht.BootStrapper.bootstrap(BootStrapper.java:82)
at 
org.apache.cassandra.service.StorageService.bootstrap(StorageService.java:818)
at 
org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:666)
at 
org.apache.cassandra.service.StorageService.initServer(StorageService.java:535)
at 
org.apache.cassandra.service.StorageService.initServer(StorageService.java:427)
at 
org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:271)
at com.datastax.bdp.server.DseDaemon.setup(DseDaemon.java:183)
at 
org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:393)
at com.datastax.bdp.server.DseDaemon.main(DseDaemon.java:347)
INFO [StorageServiceShutdownHook] 2013-03-21 14:53:48,457 Gossiper.java (line 
1134) Announcing shutdown
INFO [StorageServiceShutdownHook] 2013-03-21 14:53:49,458 MessagingService.java 
(line 549) Waiting for messaging service to quiesce
INFO [ACCEPT-localhost/127.0.0.1] 2013-03-21 14:53:49,461 
MessagingService.java (line 705) MessagingService shutting down server thread.

It is a brand new cluster.
I basically changed the cluster name, listen addres and token in the 
Cassandra.yaml file.

Any clues?

Regards Hans-Peter






Dit bericht is vertrouwelijk en kan geheime informatie bevatten enkel bestemd 
voor de geadresseerde. Indien dit bericht niet voor u is bestemd, verzoeken wij 
u dit onmiddellijk aan ons te melden en het bericht te vernietigen. Aangezien 
de integriteit van het bericht niet veilig gesteld is middels verzending via 
internet, kan Atos Nederland B.V. niet aansprakelijk worden gehouden voor de 
inhoud daarvan. Hoewel wij ons inspannen een virusvrij netwerk te hanteren, 
geven wij geen enkele garantie dat dit bericht virusvrij is, noch aanvaarden 
wij enige aansprakelijkheid voor de mogelijke aanwezigheid van een virus in dit 
bericht. Op al onze rechtsverhoudingen, aanbiedingen en overeenkomsten 
waaronder Atos Nederland B.V. goederen en/of diensten levert zijn met 
uitsluiting van alle andere voorwaarden de Leveringsvoorwaarden van Atos 
Nederland B.V. van toepassing. Deze worden u op aanvraag direct kosteloos 
toegezonden.

This e-mail and the documents attached are confidential and intended solely for 
the addressee; it may also be privileged. If you receive this e-mail in error, 
please notify the sender immediately and destroy it. As its integrity cannot be 
secured on the Internet, the Atos Nederland B.V. group liability cannot be 
triggered for the message content. Although the sender endeavours to maintain a 
computer virus-free network, the sender does not warrant that this transmission 
is virus-free and will not be liable for any damages resulting from any virus 
transmitted. On all offers and agreements under which Atos Nederland B.V. 
supplies goods and/or services of what

Delete Issues with cassandra cluster

2013-03-25 Thread Byron Wang
Hi,

I'm using cassandra 1.2.3.

I've successfully clustered 3 machines and created a keyspace with replication 
factor 3.

Node1 seeds Node2
Node2 seeds Node1
Node3 seeds Node1

I insert an entry using node1.

Using cqlsh from another node, I try to delete the item by sending out the 
delete command. 

After sending the command, there seems to be no error but when I try to select 
the item it is still there. 

When I try to send the same delete command from node1 cqlsh it seems to work.

Basically any delete command i send from the other nodes doesn't work unless i 
use it using node1. However I can select the items using the other nodes.

Is this a problem? I can't seem to modify objects from node1 using other nodes. 
Truncate works though.

Please help

Thanks!
Byron



Clearing tombstones

2013-03-25 Thread Joel Samuelsson
Hi,

I've deleted a range of keys in my one node test-cluster and want to re-add
them with an older creation time. How can I make sure all tombstones are
gone so that they can be re-added properly? I've tried nodetool compact but
it seems some tombstones remain.

Best regards,
Joel Samuelsson


Re: 33million hinted handoffs from nowhere

2013-03-25 Thread Andras Szerdahelyi
Thanks again!

Nodetool gossipinfo correctly lists the existing nodes only

- last change to ring topology was months ago
- I started the problem node with -Dcassanda.load_ring_state=false and
observed no unusual behaviour ( this is with hinted handoff OFF. With
hinted handoff ON I see the same behaviour as before )
- tried to assassinate these endpoints but got UnknownHostExceptions for
all 3
- tried remove token but got java.lang.UnsupportedOperationException:
Token not found. For all of these

I have an update however. I changed which node I use to coordinate
mutations and its happening elsewhere too, same tokens.
I'm clueless as to what could have caused my ring to end up in such an
inconsistent state.. How can there be pending hints for endpoints
gossipinfo does not know about?

Regards,
Andras


On 21/03/13 17:56, "aaron morton"  wrote:

>Take a look a nodetool gossipinfo it will tell you what nodes the node
>thinks are around.
>
>If you can see something in gossip that should not be there you have a
>few choices.
>
>* if it's less than 3 days since a change to ring topology wait and see
>if C* sorts it out.
>* try restarting nodes with -Dcassanda.load_ring_state=false as a JVM opt
>in cassandra-env.sh. This may not work because when the node restarts
>others will tell it the bad info
>* try the unsafeAssassinateEndpoint() call on the Gossiper MBean via JMX
>https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassand
>ra/gms/GossiperMBean.java#L28
>
>Cheers
> 
>-
>Aaron Morton
>Freelance Cassandra Consultant
>New Zealand
>
>@aaronmorton
>http://www.thelastpickle.com
>
>On 20/03/2013, at 11:10 PM, Andras Szerdahelyi
> wrote:
>
>> Thanks, Aaron.
>> 
>> I re-enabled hinted handoff and noted the following
>>  € no host is marked down in nodetool ring
>>  € No host is logged as down or dead in logs
>>  € No "started hinted handoff for.." is logged
>>  € The hinted handoff manager Mbean lists pending hints to ..
>>(drumroll) 3 non-existent nodes?
>> 
>> Here's my ring
>> 
>> Note: Ownership information does not include topology, please specify a
>>keyspace. 
>> Address DC  RackStatus State   Load
>>OwnsToken
>> 
>>   113427455640312821154458202477256070785
>> XX.XX.1.113ione-us-atl rack1   Up Normal  382.08 GB
>>33.33%  0
>> XX.XX.31.10  ione-us-lvg rack1   Up Normal  266.04 GB
>>0.00%   100
>> XX.XX.0.71 ione-be-bru rack1   Up Normal  85.86 GB
>>0.00%   200
>> XX.XX.2.86 ione-analytics-us-atlrack1   Up Normal  153.6 GB
>>   0.00%   300
>> XX.XX.1.45 ione-us-atl-ssdrack1   Up Normal  296.72 GB
>> 0.00%   400
>> XX.XX.2.85 ione-analytics-us-atlrack1   Up Normal  100.3 GB
>>   33.33%  56713727820156410577229101238628035542
>> XX.XX.1.204ione-us-atl rack1   Up Normal  341.55 GB
>>16.67%  85070591730234615865843651857942052864
>> XX.XX.11  ione-us-lvg rack1   Up Normal  320.22 GB
>>0.00%   85070591730234615865843651857942052964
>> XX.XX.2.87 ione-analytics-us-atlrack1   Up Normal  166.48
>>GB   16.67%  113427455640312821154458202477256070785
>> 
>> And these are nodes pending hints according to the Mbean
>> 
>> 166860289390734216023086131251507064403
>> 143927757573010354572009627285182898319
>> 24295500190543334543807902779534181373
>> 
>> Err.. Unbalanced ring ? Opscenter says otherwise ( "OpsCenter has
>>detected that the token ranges are evenly distributed across the nodes
>>in each data center. Load rebalancing is not necessary at this time." )
>> 
>> I appreciate your help so far! In the mean time hintedhandOFF because
>>my mutation TP can't keep up with this traffic, not to mention
>>compaction..
>> 
>> Thanks,
>> Andras
>> 
>> ps: all nodes are cassandra-1.1.6-dse-p1
>> 
>> From: aaron morton 
>> Reply-To: "user@cassandra.apache.org" 
>> Date: Monday 18 March 2013 17:51
>> To: "user@cassandra.apache.org" 
>> Subject: Re: 33million hinted handoffs from nowhere
>> 
>> You can check which nodes hints are being held for using the JMX api.
>>Look for the org.apache.cassandra.db:type=HintedHandoffManager MBean and
>>call the listEndpointsPendingHints() function.
>> 
>> There are two points where hints may be stored, if the node is down
>>when the request started or if the node timed out and did not return
>>before rpc_timeout. To check for the first, look for log lines about a
>>node being "dead" on the coordinator. To check for the second look for
>>dropped messages on the other nodes. This will be logged, or you can use
>>nodetool tpstats to look for them.
>> 
>> Cheers
>>   
>> -
>> Aaron Morton
>> Freelance Cassandra Consultant
>> New Zealand
>> 
>> @aaronmorton
>> http://www.thelastpickle.com
>> 
>> On 15/03/2013, at 2:30 AM, Andras Szerdahelyi
>>

For clients, which node to connect too? (Python, CQL 1.4 driver)

2013-03-25 Thread Adam Venturella
I am currently running 4 nodes, @ 1.2.2.

I was curious if it mattered what node I have my clients connect to. Using
the python cql driver :
https://pypi.python.org/pypi/cql/

It doesn't give me the option to specify multiple client addresses, just
one. Will this be an issue?

My assumption is that given that the data is spread out across the ring, it
shouldn't really matter since chances are it will need to pull data from
another node anyway.


Re: Delete Issues with cassandra cluster

2013-03-25 Thread Víctor Hugo Oliveira Molinar
What is the consistence level of your read and write operations?

On Mon, Mar 25, 2013 at 8:39 AM, Byron Wang  wrote:

> Hi,
>
> I'm using cassandra 1.2.3.
>
> I've successfully clustered 3 machines and created a keyspace with
> replication factor 3.
>
> Node1 seeds Node2
> Node2 seeds Node1
> Node3 seeds Node1
>
> I insert an entry using node1.
>
> Using cqlsh from another node, I try to delete the item by sending out the
> delete command.
>
> After sending the command, there seems to be no error but when I try to
> select the item it is still there.
>
> When I try to send the same delete command from node1 cqlsh it seems to
> work.
>
> Basically any delete command i send from the other nodes doesn't work
> unless i use it using node1. However I can select the items using the other
> nodes.
>
> Is this a problem? I can't seem to modify objects from node1 using other
> nodes. Truncate works though.
>
> Please help
>
> Thanks!
> Byron
>
>


Re: TimeUUID Order Partitioner

2013-03-25 Thread Carlos Pérez Miguel
Yes it does. Thank you Aaron.

Now I realized that the system keyspace uses string as keys, like "Ring" or
"ClusterName", and I don't know how to convert these type of keys into
UUID. Any idea?


Carlos Pérez Miguel


2013/3/25 aaron morton 

> The best thing to do is start with a look at ByteOrderedPartitoner and
> AbstractByteOrderedPartitioner.
>
> You'll want to create a new TimeUUIDToken extends Token and a new
> UUIDPartitioner that extends AbstractPartitioner<>
>
> Usual disclaimer that ordered partitioners cause problems with load
> balancing.
>
> Hope that helps.
>
>-
> Aaron Morton
> Freelance Cassandra Consultant
> New Zealand
>
> @aaronmorton
> http://www.thelastpickle.com
>
> On 25/03/2013, at 1:12 AM, Carlos Pérez Miguel 
> wrote:
>
> Hi,
>
> I store in my system rows where the key is a UUID version1, TimeUUID. I
> would like to maintain rows ordered by time. I know that in this case, it
> is recomended to use an external CF where column names are UUID ordered by
> time. But in my use case this is not possible, so I would like to use a
> custom Partitioner in order to do this. If I use ByteOrderedPartitioner
> rows are not correctly ordered because of the way a UUID stores the
> timestamp. What is needed in order to implement my own Partitioner?
>
> Thank you.
>
> Carlos Pérez Miguel
>
>
>


Querying CQL3 collections from Java

2013-03-25 Thread Szárnyas Gábor
Hello!

I got stuck when trying to query CQL3 collections from Java.
I'm using Cassandra 1.2.3 with CQL3. I created a column family to store a
property graph's edges with the following command:

CREATE TABLE vertices (
  id text PRIMARY KEY,
  properties map
)

I can access the data from the cqlsh, however, I couldn't figure out how to
iterate through the map entries in Java.
The following code iterates through the rows and columns, but does not
retrieve the key-value pairs of the "properties" map.

String query = "SELECT * FROM vertices";
CqlResult cqlResult =
client.execute_cql3_query(ByteBuffer.wrap(query.getBytes()),
COMPRESSION_LEVEL.NONE, CONSISTENCY_LEVEL.ALL);

Iterator rowsIterator = cqlResult.getRowsIterator();
while (rowsIterator.hasNext()) {
  CqlRow cqlRow = rowsIterator.next();
  Iterator columnsIterator = cqlRow.getColumnsIterator();
  while (columnsIterator.hasNext()) {
Column cqlColumn = columnsIterator.next();

byte[] name = cqlColumn.getName();
String nameString = new String(name);
System.out.print(nameString + ": ");

byte[] value = cqlColumn.getValue();
String string = new String(value);
System.out.println(string);
  }
}

The cqlResult.getSchema() method shows the column with the type
"org.apache.cassandra.db.marshal.MapType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type)".
How can I create a HashMap from each row's properties cell?

Thanks,
Gabor


Re: recv_describe_keyspace bug in org.apache.cassandra.thrift.Cassandra ?

2013-03-25 Thread cscetbon.ext
No one else concerned by the fact that we must define the column families the 
old way to access it with Pig ?
Is there a way to have the column family defined the new way in a DC and the 
old way (WITH COMPACT STORAGE) in another DC ?

Thanks
-- 
Cyril SCETBON 
Expert bases de données
Humanlog pour France Télécom
DMGP/PORTAILS/DOP/HEBEX/ARCHI

Tél : +33 (0)4 97 46 29 56
France Telecom - Orange
790 Avenue du Docteur Maurice Donat 
Bâtiment Marco Polo C1
Bureau 406
06251 Mougins
France

On Mar 20, 2013, at 9:59 AM, cscetbon@orange.com wrote:

> On Mar 20, 2013, at 5:21 AM, aaron morton  wrote:
> 
>> By design. There may be a plan to change in the future, I'm not aware of one 
>> though. 
> bad news. If someone else has more information about that, don't hesitate !
> Do you know how hard it would be to change this behaviour ? to not skip 
> tables without compact storage format
>> 
>> CQL 3 tables created without COMPACT STORAGE store all keys and columns 
>> using Composite Types. They also store some additional columns you may not 
>> expect. 
> I suppose that if we are aware of that we can take it into account. And 
> that's the job of the Pig script to take  only the columns it wants
>> 
>> If you want to interrop with thrift based API's like PIG it's best to use 
>> COMPACT STORAGE. 
> yes, but it means that I must recreate tables in production, and that rows 
> will be stored in a single column on disk which may hurt performance. It's 
> said in the documentation that this format is an old one that should be 
> avoided. I suppose there are other issues with it that could  be found ??
>> 
>> You can always create CF's the old way using the cassandra-cli. 
> 
> Regards
>> 
>> Cheers
>> 
>> -
>> Aaron Morton
>> Freelance Cassandra Consultant
>> New Zealand
>> 
>> @aaronmorton
>> http://www.thelastpickle.com
>> 
>> On 20/03/2013, at 12:09 AM, cscetbon@orange.com wrote:
>> 
>>> Hi,
>>> 
>>> I'm testing Pig (0.11) with Cassandra (1.2.2). I've noticed that when the 
>>> column family is created without WITH COMPACT STORAGE clause, Pig can't 
>>> find it :(
>>> After searching in the code, I've found that the issue comes from the 
>>> function recv_describe_keyspace. This function returns a KsDef with an 
>>> empty cf_defs array when there is no column family with COMPACT STORAGE 
>>> clause. I conclude that all column families that must be accessed by Pig 
>>> must be defined with this storage clause, but I wandering if it is a bug ? 
>>> I suppose ..
>>> 
>>> Thanks.
>>> -- 
>>> Cyril SCETBON
>>> 
>>> _
>>> 
>>> Ce message et ses pieces jointes peuvent contenir des informations 
>>> confidentielles ou privilegiees et ne doivent donc
>>> pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu 
>>> ce message par erreur, veuillez le signaler
>>> a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
>>> electroniques etant susceptibles d'alteration,
>>> France Telecom - Orange decline toute responsabilite si ce message a ete 
>>> altere, deforme ou falsifie. Merci.
>>> 
>>> This message and its attachments may contain confidential or privileged 
>>> information that may be protected by law;
>>> they should not be distributed, used or copied without authorisation.
>>> If you have received this email in error, please notify the sender and 
>>> delete this message and its attachments.
>>> As emails may be altered, France Telecom - Orange is not liable for 
>>> messages that have been modified, changed or falsified.
>>> Thank you.
>>> 
>> 
> 
> 
> _
> 
> Ce message et ses pieces jointes peuvent contenir des informations 
> confidentielles ou privilegiees et ne doivent donc
> pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu 
> ce message par erreur, veuillez le signaler
> a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
> electroniques etant susceptibles d'alteration,
> France Telecom - Orange decline toute responsabilite si ce message a ete 
> altere, deforme ou falsifie. Merci.
> 
> This message and its attachments may contain confidential or privileged 
> information that may be protected by law;
> they should not be distributed, used or copied without authorisation.
> If you have received this email in error, please notify the sender and delete 
> this message and its attachments.
> As emails may be altered, France Telecom - Orange is not liable for messages 
> that have been modified, changed or falsified.
> Thank you.
> 


_

Ce message et ses pieces jointes peuvent contenir des informations 
confidentielles ou privilegiees et ne doivent donc

Re: Querying CQL3 collections from Java

2013-03-25 Thread Sylvain Lebresne
I would advise you not to use raw thrift. It's just a low-level transport
as far as CQL3 is concerned, and what you will get is binary encoded data
that you will have to decode manually. Use a client library (like
https://github.com/datastax/java-driver) that will do that for you.

Though to answer your initial question, the binary format used by map (that
you will have to decode yourself) is described in
https://git-wip-us.apache.org/repos/asf?p=cassandra.git;a=blob;f=doc/native_protocol.spec(Section
6).

--
Sylvain


On Mon, Mar 25, 2013 at 2:30 PM, Szárnyas Gábor  wrote:

> Hello!
>
> I got stuck when trying to query CQL3 collections from Java.
> I'm using Cassandra 1.2.3 with CQL3. I created a column family to store a
> property graph's edges with the following command:
>
> CREATE TABLE vertices (
>   id text PRIMARY KEY,
>   properties map
> )
>
> I can access the data from the cqlsh, however, I couldn't figure out how
> to iterate through the map entries in Java.
> The following code iterates through the rows and columns, but does not
> retrieve the key-value pairs of the "properties" map.
>
> String query = "SELECT * FROM vertices";
> CqlResult cqlResult =
> client.execute_cql3_query(ByteBuffer.wrap(query.getBytes()),
> COMPRESSION_LEVEL.NONE, CONSISTENCY_LEVEL.ALL);
>
> Iterator rowsIterator = cqlResult.getRowsIterator();
> while (rowsIterator.hasNext()) {
>   CqlRow cqlRow = rowsIterator.next();
>   Iterator columnsIterator = cqlRow.getColumnsIterator();
>   while (columnsIterator.hasNext()) {
> Column cqlColumn = columnsIterator.next();
>
> byte[] name = cqlColumn.getName();
> String nameString = new String(name);
> System.out.print(nameString + ": ");
>
> byte[] value = cqlColumn.getValue();
> String string = new String(value);
> System.out.println(string);
>   }
> }
>
> The cqlResult.getSchema() method shows the column with the type
> "org.apache.cassandra.db.marshal.MapType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type)".
> How can I create a HashMap from each row's properties cell?
>
> Thanks,
> Gabor
>


any other NYC* attendees find your usb stick of the proceedings empty?

2013-03-25 Thread Brian Tarbox
Last week I attended DataStax's NYC* conference and one of the give-aways
was a wooden USB stick.  Finally getting around to loading it I find it
empty.

Anyone else have this problem?  Are the conference presentations available
somewhere else?

Brian Tarbox


Re: any other NYC* attendees find your usb stick of the proceedings empty?

2013-03-25 Thread Brian O'Neill
I think the recorded sessions will be posted to the PlanetCassandra Youtube
channel:
http://www.planetcassandra.org/blog/post/nyc-big-data-tech-day-update

Some of the slides have been posted up to slideshare:
http://www.slideshare.net/boneill42/hms-nyc-talk
http://www.slideshare.net/edwardcapriolo/intravert

-brian

---
Brian O'Neill
Lead Architect, Software Development
Health Market Science
The Science of Better Results
2700 Horizon Drive € King of Prussia, PA € 19406
M: 215.588.6024 € @boneill42    €
healthmarketscience.com


This information transmitted in this email message is for the intended
recipient only and may contain confidential and/or privileged material. If
you received this email in error and are not the intended recipient, or the
person responsible to deliver it to the intended recipient, please contact
the sender at the email above and delete this email and any attachments and
destroy any copies thereof. Any review, retransmission, dissemination,
copying or other use of, or taking any action in reliance upon, this
information by persons or entities other than the intended recipient is
strictly prohibited.
 


From:  Brian Tarbox 
Reply-To:  
Date:  Monday, March 25, 2013 11:43 AM
To:  
Subject:  any other NYC* attendees find your usb stick of the proceedings
empty?

Last week I attended DataStax's NYC* conference and one of the give-aways
was a wooden USB stick.  Finally getting around to loading it I find it
empty.

Anyone else have this problem?  Are the conference presentations available
somewhere else?

Brian Tarbox




cfhistograms

2013-03-25 Thread Kanwar Sangha
Can someone explain how to read the cfhistograms o/p ?

[root@db4 ~]# nodetool cfhistograms usertable data
usertable/data histograms
Offset  SSTables Write Latency  Read Latency  Row Size  
Column Count
12857444  4051 0 0  
   342711
26355104 27021 0 0  
201313
32579941 61600 0 0  
130489
4 374067119286 0 0  
   91378
5   9175210934 0 0  
   68548
6  0321098 0 0  
   54479
7  0476677 0 0  
   45427
8  0734846 0 0  
   38814
10 0   2867967 4 0  
   65512
12 0   536684422 0  
   59967
14 0   691143136 0  
   63980
17 0  10155740   127 0  
  115714
20 0   7432318   302 0  
  138759
24 0   5231047   969 0  
  193477
29 0   2368553  2790 0  
  209998
35 0859591  4385 0  
  204751
42 0456978  3790 0  
  214658
50 0306084  2465 0  
  151838
60 0223202  2158 0  
   40277
72 0122906  2896 0  
1735


Thanks
Kanwar



Re: java.io.IOException: FAILED_TO_UNCOMPRESS(5) exception when running nodetool rebuild

2013-03-25 Thread Ondřej Černoš
Hi all,

I am still unable to move forward with this issue.

- when I switch SSL off in inter-DC communication, nodetool rebuild  works well
- when I switch internode_compression off, I still get
java.io.IOException: FAILED_TO_UNCOMPRESS exception. Does
internode_compression: none really switch off the snappy compression
of the internode communication? The stacktrace - see the previous mail
- clearly demonstrates some compression is involved
- I managed to trigger another exception:

java.lang.RuntimeException: javax.net.ssl.SSLException: bad record MAC
at com.google.common.base.Throwables.propagate(Throwables.java:160)
at 
org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:32)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.net.ssl.SSLException: bad record MAC
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)
at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1649)
at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1607)
at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:859)
at 
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:755)
at 
com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
at 
org.apache.cassandra.streaming.compress.CompressedInputStream$Reader.runMayThrow(CompressedInputStream.java:151)
at 
org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
... 1 more

I managed to trigger this exception only once however.

The fact the transfer works when SSL is off and fails with SSL is
another strange thing with this issue.

Any ideas or hints?

regards,

Ondrej Cernos

On Tue, Mar 19, 2013 at 5:51 PM, Ondřej Černoš  wrote:
> Hi all,
>
> I am running into strange error when bootstrapping Cassandra cluster
> in multiple datacenter setup.
>
> The setup is as follows: 3 nodes in AWS east, 3 nodes somewhere on
> Rackspace/Openstack. I use my own snitch based on EC2MultiRegionSnitch
> (it just adds some ec2 avalability zone parsing capabilities). Nodes
> in the cluster connect to each other and all seems ok.
>
> When I start the Rackspace cluster first, populate it with data and
> then let the AWS cluster bootstrap from it, it works great. However
> the other way round it just breaks.
>
> The breakage demonstrates as follows:
>
> - nodetool rebuild us-east command hangs
> - cassandra's log contains the following:
>
> 2013-03-19 12:42:15.796+0100 [Thread-14] [DEBUG]
> IncomingTcpConnection.java(63)
> org.apache.cassandra.net.IncomingTcpConnection: Connection version 6
> from ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com/xxx.xxx.xxx.xxx
> 2013-03-19 12:42:15.803+0100 [Thread-14] [DEBUG]
> StreamInSession.java(104)
> org.apache.cassandra.streaming.StreamInSession: Adding file
> /path/to/cassandra/data/key_space/column_family/key_space-column_family-ib-2-Data.db
> to Stream Request queue
> 2013-03-19 12:42:15.803+0100 [Thread-14] [DEBUG]
> StreamInSession.java(104)
> org.apache.cassandra.streaming.StreamInSession: Adding file
> /path/to/cassandra/data/key_space/column_family/key_space-column_family-ib-1-Data.db
> to Stream Request queue
> 2013-03-19 12:42:15.806+0100 [Thread-14] [DEBUG]
> IncomingStreamReader.java(112)
> org.apache.cassandra.streaming.IncomingStreamReader: Receiving stream
> 2013-03-19 12:42:15.807+0100 [Thread-14] [DEBUG]
> IncomingStreamReader.java(113)
> org.apache.cassandra.streaming.IncomingStreamReader: Creating file for
> /path/to/cassandra/data/key_space/column_family/key_space-column_family-tmp-ib-2-Data.db
> with 7808 estimat
> ed keys
> 2013-03-19 12:42:15.808+0100 [Thread-14] [DEBUG]
> ColumnFamilyStore.java(863) org.apache.cassandra.db.ColumnFamilyStore:
> component=key_space Checking for sstables overlapping []
> 2013-03-19 12:42:15.962+0100 [Thread-14] [DEBUG] FileUtils.java(110)
> org.apache.cassandra.io.util.FileUtils: Deleting
> key_space-column_family-tmp-ib-2-Data.db
> 2013-03-19 12:42:15.962+0100 [Thread-14] [DEBUG] FileUtils.java(110)
> org.apache.cassandra.io.util.FileUtils: Deleting
> key_space-column_family-tmp-ib-2-CompressionInfo.db
> 2013-03-19 12:42:15.962+0100 [Thread-14] [DEBUG] FileUtils.java(110)
> org.apache.cassandra.io.util.FileUtils: Deleting
> key_space-column_family-tmp-ib-2-TOC.txt
> 2013-03-19 12:42:15.962+0100 [Thread-14] [DEBUG] FileUtils.java(110)
> org.apache.cassandra.io.util.FileUtils: Deleting
> key_space-column_family-tmp-ib-2-Filter.db
> 2013-03-19 12:42:15.963+0100 [Thread-14] [DEBUG] FileUtils.java(110)
> org.apache.cassandra.io.util.FileUtils: Deleting
> key_space-column_family-tmp-ib-2-Index.db
> 2013-03-19 12:42:15.963+0100 [Thread-14] [DEBUG] SSTable.java(154)
> org.apache.cassandra.io.sstable.SSTable: Deleted
> /path/to/cassandra/data/key_space/column_family/key_space-column_family-tmp-ib-2
> 2013-03-19 12:42:15.963+0100 [Thread-14] [INFO]
> StreamInSession.java(1

Re: cfhistograms

2013-03-25 Thread Brian Tarbox
I think we all go through this learning curve.  Here is the answer I gave
last time this question was asked:

The output of this command seems to make no sense unless I think of it as 5
completely separate histograms that just happen to be displayed together.

Using this example output should I read it as: my reads all took either 1
or 2 sstable.  And separately, I had write latencies of 3,7,19.  And
separately I had read latencies of 2, 8,69, etc?

In other words...each row isn't really a row...i.e. on those 16033 reads
from a single SSTable I didn't have 0 write latency, 0 read latency, 0 row
size and 0 column count.  Is that right?

Offset  SSTables Write Latency  Read Latency  Row Size
 Column Count
1  16033 00
   0 0
2303   00
 0 1
3  0 00
   0 0
4  0 00
   0 0
5  0 00
   0 0
6  0 00
   0 0
7  0 00
   0 0
8  0 02
   0 0
10 0 00
   0  6261
12 0 02
   0   117
14 0 08
   0 0
17 0 3   69
   0   255
20 0 7  163
   0 0
24 019 1369
   0 0


On Mon, Mar 25, 2013 at 11:52 AM, Kanwar Sangha  wrote:

>  Can someone explain how to read the cfhistograms o/p ?
>
> ** **
>
> [root@db4 ~]# nodetool cfhistograms usertable data
>
> usertable/data histograms
>
> Offset  SSTables Write Latency  Read Latency  Row
> Size  Column Count
>
> 12857444  4051 0
> 0 342711
>
> 26355104 27021 0
>0  201313
>
> 32579941 61600 0
> 0  130489
>
> 4 374067119286 0
> 0 91378
>
> 5   9175210934 0
> 0 68548
>
> 6  0321098 0
> 0 54479
>
> 7  0476677 0
> 0 45427
>
> 8  0734846 0
> 0 38814
>
> 10 0   2867967 4
> 0 65512
>
> 12 0   536684422
> 0 59967
>
> 14 0   691143136
> 0 63980
>
> 17 0  10155740   127
> 0115714
>
> 20 0   7432318   302
>   0138759
>
> 24 0   5231047   969
> 0193477
>
> 29 0   2368553  2790
> 0209998
>
> 35 0859591  4385
> 0204751
>
> 42 0456978  3790
> 0214658
>
> 50 0306084  2465
> 0151838
>
> 60 0223202  2158
> 0 40277
>
> 72 0122906  2896
> 0  1735
>
> ** **
>
> ** **
>
> Thanks
>
> Kanwar
>
> ** **
>


Re: Many to one type of replication.

2013-03-25 Thread Francois Richard
Thanks much,

I wanted to confirm.  We will do this at the application level.

FR


On Sun, Mar 24, 2013 at 10:03 AM, aaron morton wrote:

> From this mailing list I found this Github project that is doing something
> similar by looking at the commit logs:
> https://github.com/carloscm/cassandra-commitlog-extract
>
> IMHO tailing the logs is fragile, and you may be better off handling it at
> the application level.
>
> But is there other options around using a custom replication strategy?
>
> There is no such thing as "one directional" replication. For example
> replication everything from DC 1 to DC 2, but do not replicate from DC 2 to
> DC 1.
> You may be better off reducing the number of clusters and then running one
> transactional and one analytical DC.
>
> Cheers
>
> -
> Aaron Morton
> Freelance Cassandra Consultant
> New Zealand
>
> @aaronmorton
> http://www.thelastpickle.com
>
> On 24/03/2013, at 3:42 AM, Francois Richard  wrote:
>
> Hi,
>
> We currently run our Cassandra deployment with
> multiple independent clusters.  The clusters are totally self contain in
> terms of redundancy and independent from each others.  We have a "sharding
> "layer higher in our stack to dispatch the requests to the right
> application stack and this stack connects to his associated Cassandra
> cluster. All the cassandra clusters are identical in terms of hosted
> keyspaces, column families, replication factor ...
>
> At this point I am investigating ways to build a central cassandra cluster
> that could contain all the data from all the other cassandra clusters and I
> am wondering how to best do it.  The goal is to have a global view of our
> data and to be able to do some massive crunching on it.
>
> For sure we can build some ETL type of job that would figure out the data
> that was updated, extract it, and load it to the central cassandra cluster.
>  From this mailing list I found this Github project that is doing something
> similar by looking at the commit logs:
> https://github.com/carloscm/cassandra-commitlog-extract
>
> But is there other options around using a custom replication strategy?
>  Any other general suggestions ?
>
> Thanks,
>
> FR
>
> --
>
> _
>
> *Francois Richard *
>
>
>
>


-- 

_

*Francois Richard *

VP Server Engineering and Operations**

Xobni Engineering

Xobni, Inc.

539 Bryant St

San Francisco, CA  94107

415-987-5305 Mobile

(For emergencies please leave a voice-mail to mobile)


www.xobni.com**


other questions about // RE: batch_mutate

2013-03-25 Thread DE VITO Dominique
When the coordinator node receives a batch_mutate with different N row keys 
(for different CF) :

a) does it treat them as N independent requests to replicas, or

b) does the coordinator node split the the initial batch_mutate into M 
batch_mutate (M <= N) according to rowkeys ?

Thanks,
Dominique


De : aaron morton [mailto:aa...@thelastpickle.com]
Envoyé : vendredi 6 juillet 2012 01:21
À : user@cassandra.apache.org
Objet : Re: batch_mutate

Does it mean that the popular use case is when we need to update multiple 
column families using the same key?
Yes.

Shouldn't we design our space in such a way that those columns live in the same 
column family?
Design a model where the data for common queries is stored in one row+cf. You 
can also take into consideration the workload. e.g. things are are updated 
frequently often live together, things that are updated infrequently often live 
together.

cheers

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

On 6/07/2012, at 3:16 AM, Leonid Ilyevsky wrote:


I actually found an answer to my first question at 
http://wiki.apache.org/cassandra/API. So I got it wrong: actually the outer key 
is the key in the table, and the inner key is the table name (this was somewhat 
counter-intuitive). Does it mean that the popular use case is when we need to 
update multiple column families using the same key? Shouldn't we design our 
space in such a way that those columns live in the same column family?

From: Leonid Ilyevsky [mailto:lilyev...@mooncapital.com]
Sent: Thursday, July 05, 2012 10:39 AM
To: 'user@cassandra.apache.org'
Subject: batch_mutate

My current way of inserting rows one by one is too slow (I use cql3 prepared 
statements) , so I want to try batch_mutate.

Could anybody give me more details about the interface? In the javadoc it says:

public 
voidbatch_mutate(java.util.Map>>>
 mutation_map,
 
ConsistencyLevel
 consistency_level)
  throws 
InvalidRequestException,
 
UnavailableException,
 
TimedOutException,
 org.apache.thrift.TException
Description copied from interface: 
Cassandra.Iface
Mutate many columns or super columns for many row keys. See also: Mutation. 
mutation_map maps key to column family to a list of Mutation objects to take 
place at that scope. *


I need to understand the meaning of the elements of mutation_map parameter.
My guess is, the key in the outer map is columnfamily name, is this correct?
The key in the inner map is, probably, a key to the columnfamily (it is 
somewhat confusing that it is String while the outer key is ByteBuffer, I 
wonder what is the rational). If this is correct, how should I do it if my key 
is a composite one. Does anybody have an example?

Thanks,

Leonid


This email, along with any attachments, is confidential and may be legally 
privileged or otherwise protected from disclosure. Any unauthorized 
dissemination, copying or use of the contents of this email is strictly 
prohibited and may be in violation of law. If you are not the intended 
recipient, any disclosure, copying, forwarding or distribution of this email is 
strictly prohibited and this email and any attachments should be deleted 
immediately. This email and any attachments do not constitute an offer to sell 
or a solicitation of an offer to purchase any interest in any investment 
vehicle sponsored by Moon Capital Management LP ("Moon Capital"). Moon Capital 
does not provide legal, accounting or tax advice. Any statement regarding 
legal, accounting or tax matters was not intended or written to be relied upon 
by any person as advice. Moon Capital does not waive confidentiality or 
privilege as a result of this email.


This email, along with any attachments, is confidential and may be legally 
privileged or otherwise protected from disclosure. Any unauthorized 
dissemination, copying or use of the contents of this email is strictly 
prohibited and may be in violation of law. If you are not the intended 
recipient, any disclosure, copying, forwarding or distribution of this email is 
strictly prohibited and this email and any attachments should be deleted 
immediately. This email and any attachments do not constitute an offer to sell 
or a solicitation of an offer to purchase any interest in any investment 
vehicle sponsored by Moon Capital Management LP ("Moon Capital"). Moon Capital 
does not provide legal, accounting or tax advice. Any statement regarding 
legal, accounting or tax matters was not intended or written to be relied upon 
by any person as advice. Moon Capital does not waive confidentiality or 
privilege as a result of this email.



Re: cfhistograms

2013-03-25 Thread Jabbar Azam
This also has a good description of how to interpret the results

http://thelastpickle.com/2011/04/28/Forces-of-Write-and-Read/


On 25 March 2013 16:36, Brian Tarbox  wrote:

> I think we all go through this learning curve.  Here is the answer I gave
> last time this question was asked:
>
> The output of this command seems to make no sense unless I think of it as
> 5 completely separate histograms that just happen to be displayed
> together.
>
> Using this example output should I read it as: my reads all took either 1
> or 2 sstable.  And separately, I had write latencies of 3,7,19.  And
> separately I had read latencies of 2, 8,69, etc?
>
> In other words...each row isn't really a row...i.e. on those 16033 reads
> from a single SSTable I didn't have 0 write latency, 0 read latency, 0 row
> size and 0 column count.  Is that right?
>
> Offset  SSTables Write Latency  Read Latency  Row Size
>  Column Count
> 1  16033 00
>  0 0
> 2303   00
>0 1
> 3  0 00
>  0 0
> 4  0 00
>  0 0
> 5  0 00
>  0 0
> 6  0 00
>  0 0
> 7  0 00
>  0 0
> 8  0 02
>  0 0
> 10 0 00
>  0  6261
> 12 0 02
>  0   117
> 14 0 08
>  0 0
> 17 0 3   69
>  0   255
> 20 0 7  163
>  0 0
> 24 019 1369
>  0 0
>
>
> On Mon, Mar 25, 2013 at 11:52 AM, Kanwar Sangha wrote:
>
>>  Can someone explain how to read the cfhistograms o/p ?
>>
>> ** **
>>
>> [root@db4 ~]# nodetool cfhistograms usertable data
>>
>> usertable/data histograms
>>
>> Offset  SSTables Write Latency  Read Latency  Row
>> Size  Column Count
>>
>> 12857444  4051 0
>> 0 342711
>>
>> 26355104 27021 0
>>0  201313
>>
>> 32579941 61600 0
>> 0  130489
>>
>> 4 374067119286 0
>> 0 91378
>>
>> 5   9175210934 0
>> 0 68548
>>
>> 6  0321098 0
>> 0 54479
>>
>> 7  0476677 0
>> 0 45427
>>
>> 8  0734846 0
>> 0 38814
>>
>> 10 0   2867967 4
>> 0 65512
>>
>> 12 0   536684422
>> 0 59967
>>
>> 14 0   691143136
>> 0 63980
>>
>> 17 0  10155740   127
>> 0115714
>>
>> 20 0   7432318   302
>>   0138759
>>
>> 24 0   5231047   969
>> 0193477
>>
>> 29 0   2368553  2790
>> 0209998
>>
>> 35 0859591  4385
>> 0204751
>>
>> 42 0456978  3790
>> 0214658
>>
>> 50 0306084  2465
>> 0151838
>>
>> 60 0223202  2158
>> 0 40277
>>
>> 72 0122906  2896
>> 0  1735
>>
>> ** **
>>
>> ** **
>>
>> Thanks
>>
>> Kanwar
>>
>> ** **
>>
>
>


-- 
Thanks

Jabbar Azam


Re: High disk I/O during reads

2013-03-25 Thread Jon Scarborough
Big thanks to everyone for the suggestions.  Turned out to be a good
opportunity for me to learn more about C* internals and add some extra
debug output to the code to validate some of my assumptions.

Aaron, very good points on the problems with doing the reversed queries.  I
read your blog posts over the weekend, and they're the best description
I've found so far on how the read-path in C* works - they made the code
much easier to understand.  Even though the reversed queries turned out not
to be the primary issue, there are some easy adjustments we can make to
speed things up.  You guess was also correct that we're running m1.large
instances.

Anyway, turns out that Igor's instincts were correct, and the root cause
was a disk read-ahead issue.  On the 4 nodes that were performing poorly it
was set way too high.  With that fix in place we're now seeing read
latencies in the 10ms ballpark, which I think is reasonable for our
hardware setup and use-case.

-Jon

On Sun, Mar 24, 2013 at 10:27 AM, aaron morton wrote:

> Device:tpskB_read/skB_wrtn/skB_readkB_wrtn
> xvdap10.13 0.00 1.07  0 16
> xvdb474.20 13524.5325.33 202868380
> xvdc469.87 13455.7330.40 201836456
>
> Perchance are you running on m1.large instances ?
> You may be seeing the "moderate" IO performance they offer.
>
>
> The query is looking for a maximum of 50 messages between two dates, in
> reverse order.
>
> This is probably the slowest query you can do. Removing the reverse would
> make it faster, or using a reversed comparator.
> You mentioned that most queries in cfhistograms were hitting one SSTable.
> If you are comfortable with the output from that I would work out the
> distribution for read latency, the read_latency in cfstats if the most
> recent only.
>
> It have a lot of deletes on a row that can slow down reads as well. Does
> not sound like the case but I wanted to mention in.
>
> Next thing to look at is the proxyhistograms, that will give you the
> end-to-end request latency in cassandra. Which will help with identifying
> if the issue is the disk read or network / something else. The something
> else may be DigestMismatch errors if you have been dropping writes and not
> running repair / disable hints.
>
> Cheers
>
>
> -
> Aaron Morton
> Freelance Cassandra Consultant
> New Zealand
>
> @aaronmorton
> http://www.thelastpickle.com
>
> On 24/03/2013, at 2:59 PM, Matt Kap  wrote:
>
> Having battled similar issues with read latency recently, here's some
> general things to look out for.
>
> - At 118ms, something is definitely broken. You should be looking at
> under 10ms or lower, depending on hardware.
> - Do "nodetool info" on all 5 nodes. Is the load distributed evenly?
> Is it reasonable (under 500GB)?
> - Make sure you aren't running low on heap space. You could see that
> from "nodetool info" also. If you are running low, very bad things
> begin to happen (lots of GC, constant flushing of Memtables, reduction
> of Key Cache, etc). Generally, once there, the node doesn't recover,
> and read latency goes to sh*t.
> - Which compaction strategy are you using? Leveled compactions or
> size-tiered? There's different issues with both.
> - Is your Key Cache turned on? What's the Key Cache hit rate?
> - Is the Read Latency the same on all nodes? Or just one in particular?
> - Are pending compactions building up?
> - What's %util on disk? Same on all nodes?
>
> I would go through "nodetool cfstats, info, compactionstats, tpstats",
> and see if things are roughly the same across all the nodes. You could
> also just be under capacity, but more likely, there's an actual
> problem looming somewhere.
>
> Cheers!
> -Matt
>
> On Sat, Mar 23, 2013 at 3:18 AM,   wrote:
>
> You can try to disable readahead on cassandra data disk.
>
> Jon Scarborough  написал(а):
>
>
> Checked tpstats, there are very few dropped messages.
>
> Checked histograms. Mostly nothing surprising. The vast majority of rows
> are small, and most reads only access one or two SSTables.
>
> What I did discover is that of our 5 nodes, one is performing well, with
> disk I/O in the ballprk that seems reasonable. The other 4 nodes are doing
> roughly 4x the disk i/O per second.  Interestingly, the node that is
> performing well also seems to be servicing about twice the number of reads
> that the other nodes are.
>
> I compared configuration between the node performing well to those that
> aren't, and so far haven't found any discrepancies.
>
> On Fri, Mar 22, 2013 at 10:43 AM, Wei Zhu  wrote:
>
>
> According to your cfstats, read latency is over 100 ms which is really
> really slow. I am seeing less than 3ms reads for my cluster which is on
> SSD.
> Can you also check the nodetool cfhistorgram, it tells you more about the
> number of SSTable involved and read/write latency. Somtimes average doesn't
> tell you the whole st

Re: any other NYC* attendees find your usb stick of the proceedings empty?

2013-03-25 Thread Edward Capriolo
The sticks were given to me in a bag at 9:00am in the morning. I would be
highly impressed if datastax found a way to retroactively put my 2:00PM
presentation on that USB stick.

http://www.imdb.com/title/tt0088763/

:)

On Mon, Mar 25, 2013 at 11:49 AM, Brian O'Neill wrote:

> I think the recorded sessions will be posted to the PlanetCassandra
> Youtube channel:
> http://www.planetcassandra.org/blog/post/nyc-big-data-tech-day-update
>
> Some of the slides have been posted up to slideshare:
> http://www.slideshare.net/boneill42/hms-nyc-talk
> http://www.slideshare.net/edwardcapriolo/intravert
>
> -brian
>
> ---
>
> Brian O'Neill
>
> Lead Architect, Software Development
>
> *Health Market Science*
>
> *The Science of Better Results*
>
> 2700 Horizon Drive • King of Prussia, PA • 19406
>
> M: 215.588.6024 • @boneill42   •
>
> healthmarketscience.com
>
>
> This information transmitted in this email message is for the intended
> recipient only and may contain confidential and/or privileged material. If
> you received this email in error and are not the intended recipient, or the
> person responsible to deliver it to the intended recipient, please contact
> the sender at the email above and delete this email and any attachments and
> destroy any copies thereof. Any review, retransmission, dissemination,
> copying or other use of, or taking any action in reliance upon, this
> information by persons or entities other than the intended recipient is
> strictly prohibited.
>
>
>
> From: Brian Tarbox 
> Reply-To: 
> Date: Monday, March 25, 2013 11:43 AM
> To: 
> Subject: any other NYC* attendees find your usb stick of the proceedings
> empty?
>
> Last week I attended DataStax's NYC* conference and one of the give-aways
> was a wooden USB stick.  Finally getting around to loading it I find it
> empty.
>
> Anyone else have this problem?  Are the conference presentations available
> somewhere else?
>
> Brian Tarbox
>


bloom filter fp ratio of 0.98 with fp_chance of 0.01

2013-03-25 Thread Andras Szerdahelyi
Hello list,

Could anyone shed some light on how an FP chance of 0.01 coexist with a 
measured FP ratio of .. 0.98 ? Am I reading this wrong or are 98% of the 
requests hitting the bloom filter create a false positive while the "target" 
false ratio is 0.01?
( Also key cache hit ratio is around 0.001 and sstables read is in the skies ( 
non-exponential (non-) drop off  for LCS )  but that should be filed under 
"effect" and not "cause"? )

[default@unknown] use KS;
Authenticated to keyspace: KS
[default@KS] describe CF;
ColumnFamily: CF
  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.BytesType
  GC grace seconds: 691200
  Compaction min/max thresholds: 4/32
  Read repair chance: 0.1
  DC Local Read repair chance: 0.0
  Replicate on write: true
  Caching: ALL
  Bloom Filter FP chance: 0.01
  Built indexes: []
  Compaction Strategy: 
org.apache.cassandra.db.compaction.LeveledCompactionStrategy
  Compaction Strategy Options:
sstable_size_in_mb: 5
  Compression Options:
sstable_compression: org.apache.cassandra.io.compress.SnappyCompressor

Keyspace: KS
Read Count: 628950
Read Latency: 93.19921121869784 ms.
Write Count: 1219021
Write Latency: 0.14352380885973254 ms.
Pending Tasks: 0
Column Family: CF
SSTable count: 22682
Space used (live): 119771434915
Space used (total): 119771434915
Number of Keys (estimate): 203837952
Memtable Columns Count: 13125
Memtable Data Size: 33212827
Memtable Switch Count: 15
Read Count: 629009
Read Latency: 88.434 ms.
Write Count: 1219038
Write Latency: 0.095 ms.
Pending Tasks: 0
Bloom Filter False Positives: 37939419
Bloom Filter False Ratio: 0.97928
Bloom Filter Space Used: 261572784
Compacted row minimum size: 104
Compacted row maximum size: 263210
Compacted row mean size: 3041

I upgraded sstables after changing the FP chance

Thanks!
Andras


Re: cfhistograms

2013-03-25 Thread Andrey Ilinykh
What I don't understand hete is "Row Size" column. Why is it  always 0?

Thank you,
   Andrey


On Mon, Mar 25, 2013 at 9:36 AM, Brian Tarbox wrote:

> I think we all go through this learning curve.  Here is the answer I gave
> last time this question was asked:
>
> The output of this command seems to make no sense unless I think of it as
> 5 completely separate histograms that just happen to be displayed
> together.
>
> Using this example output should I read it as: my reads all took either 1
> or 2 sstable.  And separately, I had write latencies of 3,7,19.  And
> separately I had read latencies of 2, 8,69, etc?
>
> In other words...each row isn't really a row...i.e. on those 16033 reads
> from a single SSTable I didn't have 0 write latency, 0 read latency, 0 row
> size and 0 column count.  Is that right?
>
> Offset  SSTables Write Latency  Read Latency  Row Size
>  Column Count
> 1  16033 00
>  0 0
> 2303   00
>0 1
> 3  0 00
>  0 0
> 4  0 00
>  0 0
> 5  0 00
>  0 0
> 6  0 00
>  0 0
> 7  0 00
>  0 0
> 8  0 02
>  0 0
> 10 0 00
>  0  6261
> 12 0 02
>  0   117
> 14 0 08
>  0 0
> 17 0 3   69
>  0   255
> 20 0 7  163
>  0 0
> 24 019 1369
>  0 0
>
>
> On Mon, Mar 25, 2013 at 11:52 AM, Kanwar Sangha wrote:
>
>>  Can someone explain how to read the cfhistograms o/p ?
>>
>> ** **
>>
>> [root@db4 ~]# nodetool cfhistograms usertable data
>>
>> usertable/data histograms
>>
>> Offset  SSTables Write Latency  Read Latency  Row
>> Size  Column Count
>>
>> 12857444  4051 0
>> 0 342711
>>
>> 26355104 27021 0
>>0  201313
>>
>> 32579941 61600 0
>> 0  130489
>>
>> 4 374067119286 0
>> 0 91378
>>
>> 5   9175210934 0
>> 0 68548
>>
>> 6  0321098 0
>> 0 54479
>>
>> 7  0476677 0
>> 0 45427
>>
>> 8  0734846 0
>> 0 38814
>>
>> 10 0   2867967 4
>> 0 65512
>>
>> 12 0   536684422
>> 0 59967
>>
>> 14 0   691143136
>> 0 63980
>>
>> 17 0  10155740   127
>> 0115714
>>
>> 20 0   7432318   302
>>   0138759
>>
>> 24 0   5231047   969
>> 0193477
>>
>> 29 0   2368553  2790
>> 0209998
>>
>> 35 0859591  4385
>> 0204751
>>
>> 42 0456978  3790
>> 0214658
>>
>> 50 0306084  2465
>> 0151838
>>
>> 60 0223202  2158
>> 0 40277
>>
>> 72 0122906  2896
>> 0  1735
>>
>> ** **
>>
>> ** **
>>
>> Thanks
>>
>> Kanwar
>>
>> ** **
>>
>
>


Re: cfhistograms

2013-03-25 Thread Derek Williams
On Mon, Mar 25, 2013 at 10:36 AM, Brian Tarbox wrote:

> I think we all go through this learning curve.  Here is the answer I gave
> last time this question was asked:
>
> The output of this command seems to make no sense unless I think of it as
> 5 completely separate histograms that just happen to be displayed
> together.
>
> Using this example output should I read it as: my reads all took either 1
> or 2 sstable.  And separately, I had write latencies of 3,7,19.  And
> separately I had read latencies of 2, 8,69, etc?
>

Little correction: The actual value is in the Offset column, all the other
columns are the count for that bucket of the histogram. For example in
write latency the 3, 7, and 19 refer to how many requests had that latency.
3 write requests took 17us, 7 requests took 20us, and 19 took 24us.

-- 
Derek Williams


Hinted Handoff

2013-03-25 Thread Kanwar Sangha
Hi - Quick question. Do hints contain the actual data or the data is read from 
the SStables and then sent to the other node when it comes up ?

Thanks,
Kanwar



Re: Querying CQL3 collections from Java

2013-03-25 Thread Szárnyas Gábor
Thanks, this client library is really great! It should be included in the
Apache Cassandra Wiki's "High level clients" page (
http://wiki.apache.org/cassandra/ClientOptions).
Anyway, here is the code I created (using the cassandra-driver-core Maven
artifact).

Cluster cluster = Cluster.builder().addContactPoints("127.0.0.1").build();
Session session = cluster.connect("graph");
for (Row row : session.execute("SELECT * FROM vertices")) {
System.out.println("id: " + row.getString("id"));
System.out.println("properties: ");
Map map = row.getMap("properties", String.class,
String.class);
for (Map.Entry entry : map.entrySet()) {
System.out.println("- " + entry.getKey() + ": " + entry.getValue());
}
}

Gabor


On 25 March 2013 14:52, Sylvain Lebresne  wrote:

> I would advise you not to use raw thrift. It's just a low-level transport
> as far as CQL3 is concerned, and what you will get is binary encoded data
> that you will have to decode manually. Use a client library (like
> https://github.com/datastax/java-driver) that will do that for you.
>
> Though to answer your initial question, the binary format used by map
> (that you will have to decode yourself) is described in
> https://git-wip-us.apache.org/repos/asf?p=cassandra.git;a=blob;f=doc/native_protocol.spec(Section
>  6).
>
> --
> Sylvain
>
>
> On Mon, Mar 25, 2013 at 2:30 PM, Szárnyas Gábor wrote:
>
>> Hello!
>>
>> I got stuck when trying to query CQL3 collections from Java.
>> I'm using Cassandra 1.2.3 with CQL3. I created a column family to store a
>> property graph's edges with the following command:
>>
>> CREATE TABLE vertices (
>>   id text PRIMARY KEY,
>>   properties map
>> )
>>
>> I can access the data from the cqlsh, however, I couldn't figure out how
>> to iterate through the map entries in Java.
>> The following code iterates through the rows and columns, but does not
>> retrieve the key-value pairs of the "properties" map.
>>
>> String query = "SELECT * FROM vertices";
>> CqlResult cqlResult =
>> client.execute_cql3_query(ByteBuffer.wrap(query.getBytes()),
>> COMPRESSION_LEVEL.NONE, CONSISTENCY_LEVEL.ALL);
>>
>> Iterator rowsIterator = cqlResult.getRowsIterator();
>> while (rowsIterator.hasNext()) {
>>   CqlRow cqlRow = rowsIterator.next();
>>   Iterator columnsIterator = cqlRow.getColumnsIterator();
>>   while (columnsIterator.hasNext()) {
>> Column cqlColumn = columnsIterator.next();
>>
>> byte[] name = cqlColumn.getName();
>> String nameString = new String(name);
>> System.out.print(nameString + ": ");
>>
>> byte[] value = cqlColumn.getValue();
>> String string = new String(value);
>> System.out.println(string);
>>   }
>> }
>>
>> The cqlResult.getSchema() method shows the column with the type
>> "org.apache.cassandra.db.marshal.MapType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type)".
>> How can I create a HashMap from each row's properties cell?
>>
>> Thanks,
>> Gabor
>>
>
>


Re: Clearing tombstones

2013-03-25 Thread Tyler Hobbs
You'll need to temporarily lower gc_grace_seconds for that column family,
run compaction, and then restore gc_grace_seconds to its original value.
See http://wiki.apache.org/cassandra/DistributedDeletes for more info.


On Mon, Mar 25, 2013 at 7:40 AM, Joel Samuelsson
wrote:

> Hi,
>
> I've deleted a range of keys in my one node test-cluster and want to
> re-add them with an older creation time. How can I make sure all tombstones
> are gone so that they can be re-added properly? I've tried nodetool compact
> but it seems some tombstones remain.
>
> Best regards,
> Joel Samuelsson
>



-- 
Tyler Hobbs
DataStax 


nodetool repair hung?

2013-03-25 Thread S C
I am using Cassandra 1.1.5. 
nodetool repair is not coming back on the command line. Did it ran 
successfully? Did it hang? How do you find if the repair was successful?I did 
not find anything in the logs."nodetool compactionstats" and "nodetool 
netstats" are clean. 
nodetool compactionstats pending tasks: 0Active compaction remaining time : 
   n/a

nodetool netstatsMode: NORMALNot sending any streams.Not receiving any 
streams.Pool NameActive   Pending  CompletedCommands
n/a 0  121103621Responses   
n/a 0  209564496


  

Re: nodetool repair hung?

2013-03-25 Thread Wei Zhu
check nodetool tpstats and looking for AntiEntropySessions/AntiEntropyStages
grep the log and looking for "repair" and "merkle tree"

- Original Message -
From: "S C" 
To: user@cassandra.apache.org
Sent: Monday, March 25, 2013 2:55:30 PM
Subject: nodetool repair hung?


I am using Cassandra 1.1.5. 


nodetool repair is not coming back on the command line. Did it ran 
successfully? Did it hang? How do you find if the repair was successful? 
I did not find anything in the logs."nodetool compactionstats" and "nodetool 
netstats" are clean. 



nodetool compactionstats 
pending tasks: 0 
Active compaction remaining time : n/a 





nodetool netstats 
Mode: NORMAL 
Not sending any streams. 
Not receiving any streams. 
Pool Name Active Pending Completed 
Commands n/a 0 121103621 
Responses n/a 0 209564496 








CQL3 And ReversedTypes Question

2013-03-25 Thread Gareth Collins
Hi,

I created a table with the following structure in cqlsh (Cassandra
1.2.3 - cql 3):

CREATE TABLE mytable ( column1 text,
  column2 text,
  messageId timeuuid,
  message blob,
  PRIMARY KEY ((column1, column2), messageId));

I can quite happily add values to this table. e.g:

insert into client_queue (column1,column2,messageId,message) VALUES
('string1','string2',now(),'ABCCDCC123');

Yet if I decide I want to set the clustering order on messageId DESC:

CREATE TABLE mytable ( column1 text,
  column2 text,
  messageId timeuuid,
  message blob,
  PRIMARY KEY ((column1, column2), messageId)) WITH CLUSTERING
ORDER BY (messageId DESC);

and try to do an insert:

insert into client_queue2 (column1,column2,messageId,message) VALUES
('string1','string2',now(),'ABCCDCC123');

I get the following error:

Bad Request: Type error: cannot assign result of function now (type
timeuuid) to messageid (type
'org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.TimeUUIDType)')

I am sure I am missing something obvious here, but I don't understand.
Why am I getting an error? What do I need
to do to be able to add an entry to this table?

thanks in advance,
Gareth


RE: nodetool repair hung?

2013-03-25 Thread S C
Thank you. It helped me.

> Date: Mon, 25 Mar 2013 15:22:32 -0700
> From: wz1...@yahoo.com
> Subject: Re: nodetool repair hung?
> To: user@cassandra.apache.org
> 
> check nodetool tpstats and looking for AntiEntropySessions/AntiEntropyStages
> grep the log and looking for "repair" and "merkle tree"
> 
> - Original Message -
> From: "S C" 
> To: user@cassandra.apache.org
> Sent: Monday, March 25, 2013 2:55:30 PM
> Subject: nodetool repair hung?
> 
> 
> I am using Cassandra 1.1.5. 
> 
> 
> nodetool repair is not coming back on the command line. Did it ran 
> successfully? Did it hang? How do you find if the repair was successful? 
> I did not find anything in the logs."nodetool compactionstats" and "nodetool 
> netstats" are clean. 
> 
> 
> 
> nodetool compactionstats 
> pending tasks: 0 
> Active compaction remaining time : n/a 
> 
> 
> 
> 
> 
> nodetool netstats 
> Mode: NORMAL 
> Not sending any streams. 
> Not receiving any streams. 
> Pool Name Active Pending Completed 
> Commands n/a 0 121103621 
> Responses n/a 0 209564496 
> 
> 
> 
> 
> 
> 
  

Re: Delete Issues with cassandra cluster

2013-03-25 Thread Byron Wang
I've actually tried all or 1. Anyway I think I've solved the issue. Seems like 
node1 is having some issues with regards to connections.  

Thanks!  

--  
Byron Wang
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Monday, March 25, 2013 at 9:11 PM, Víctor Hugo Oliveira Molinar wrote:

> What is the consistence level of your read and write operations?
>  
> On Mon, Mar 25, 2013 at 8:39 AM, Byron Wang  (mailto:byron.w...@woowteam.com)> wrote:
> > Hi,
> >  
> > I'm using cassandra 1.2.3.
> >  
> > I've successfully clustered 3 machines and created a keyspace with 
> > replication factor 3.
> >  
> > Node1 seeds Node2
> > Node2 seeds Node1
> > Node3 seeds Node1
> >  
> > I insert an entry using node1.
> >  
> > Using cqlsh from another node, I try to delete the item by sending out the 
> > delete command.
> >  
> > After sending the command, there seems to be no error but when I try to 
> > select the item it is still there.
> >  
> > When I try to send the same delete command from node1 cqlsh it seems to 
> > work.
> >  
> > Basically any delete command i send from the other nodes doesn't work 
> > unless i use it using node1. However I can select the items using the other 
> > nodes.
> >  
> > Is this a problem? I can't seem to modify objects from node1 using other 
> > nodes. Truncate works though.
> >  
> > Please help
> >  
> > Thanks!
> > Byron
>  





Multiple Primary Keys on an IN clause or 2i?

2013-03-25 Thread Byron Wang
Hi,  

I'm currently trying to implement an offline message retrieval solution wherein 
I retrieve messages after a particular timestamp for specific users. My 
question is will what route should I go for…multple primary keys on an IN 
clause or using 2i


The current model of the messages table looks something like this

CREATE TABLE msg_archive(
thread_id varchar,
ts timestamp,
msg blob,
PRIMARY KEY (thread_id, ts))



where thread_id is an alphabetized order of sender and recipient such as 
"brian|john"

Now, in order to retrieve the messages, I will have to retrieve them based on 
the number of contacts you have and as such the query will look something like 
this

SELECT * FROM msg_archive WHERE thread_id IN ('brian|john', 'brian|james'….) 
AND ts < 1234567890;

Ofcourse the list of friends a user can have can potentially reach around 500 
or even worse 1000 so the IN clause can potentially have these large amount of 
primary keys.




The question is will this work well or do I have to modify the schema such that 
we should incorporate secondary indexes And look something like this instead?

CREATE TABLE msg_archive(
thread_id varchar,
recipient varchar,
ts timestamp,
msg blob,
PRIMARY KEY (thread_id, ts))



CREATE INDEX ON msg_archive (recipient);

For the select statement, ofcourse it will be as simple as

SELECT * FROM msg_archive WHERE recipient = 'brian' AND ts < 1234567890;



Which is actually better in terms of performance? Or are there other 
suggestions to this kind of model?

Thanks!
Byron



--  
Byron Wang
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)




Infinit Loop in CompactionExecutor

2013-03-25 Thread Arya Goudarzi
Hi,

I am experiencing this bug on our 1.1.6 cluster:

https://issues.apache.org/jira/browse/CASSANDRA-4765

The pending compactions has been stuck on a constant value, so I suppose
something is not compacting due to this. Is there a workaround beside
upgrading? We are not ready to upgrade just yet.

Thanks,
-Arya