Updates is not happening when using the same time stamp.

2013-12-02 Thread srinivas rao
Hi Team,

i am facing an issue, with updating the data with same time stamp.

The column values with string type which multiple fields are delimited with
"|", example (1|2|3|4|5|6|).
if i chage one of the field, some times its updating properly with same
time stamp (column internal clock). however some times its not updating
with same time stamp.
The updates are not happening continuously,
please help me to solve the issue.

please help me to understand the logic also.



Thanks
Srini


Re: Updates is not happening when using the same time stamp.

2013-12-02 Thread srinivas rao
>
> Hi Team,
>
> i am facing an issue, with updating the data with same time stamp.
>
> The column values with string type which multiple fields are delimited
> with "|", example (1|2|3|4|5|6|).
> if i chage one of the field, some times its updating properly with same
> time stamp (column internal clock). however some times its not updating
> with same time stamp.
> The updates are not happening continuously,
> please help me to solve the issue.
>
> please help me to understand the logic also.
>
>
>
> Thanks
> Srini
>


Repair hangs - Cassandra 1.2.10

2013-12-02 Thread Tamar Rosen
Hi,

On AWS, we had a 2 node cluster with RF 2.
We added 2 more nodes, then changed RF to 3 on all our keyspaces.
Next step was to run nodetool repair, node by node.
(In the meantime, we found that we must use  CL quorum, which is affecting
our application's performance).
Started with node 1, which is one of the old nodes.
Ran:
nodetool repair -pr

It seemed to be progressing fine, running keyspace by keyspace, for about
an hour, but then it hung. The last messages in the output are:

[2013-12-01 11:18:24,577] Repair command #4 finished
[2013-12-01 11:18:24,594] Starting repair command #5, repairing 230 ranges
for keyspace correlor_customer_766

It stayed like this for almost 24 hours. Then we read about the possibility
of this being related to not upgrading
sstables,
so we killed the process. We were not sure whether we had run upgrade
sstables (we upgraded from 1.2.4 a couple of months ago)

So:
Ran upgradesstables on a specific table in the keyspace that repair got
stuck on. (this was fast)
nodetool upgradesstables correlor_customer_766 users
Ran repair on that same table.
nodetool repair correlor_customer_766 users -pr

This is again hanging.
The first and only output from this process is:
[2013-12-02 08:22:41,221] Starting repair command #6, repairing 230 ranges
for keyspace correlor_customer_766

Nothing else happened for more than an hour.

Any help and advice will be greatly appreciated.

Tamar Rosen

correlor.com


Re: Sample Trigger Code to get inserted value

2013-12-02 Thread J Ramesh Kumar
Finally I got it working...

Below are the code snippet which will be useful for trigger users,

public Collection augment(ByteBuffer key, ColumnFamily cf) {
try {
ByteBuffer id_bb = CompositeType.extractComponent(key, 0);
UUID id=TimeUUIDType.instance.compose(id_bb);

ByteBuffer data_key_bb = CompositeType.extractComponent(key, 1);
String data_key=UTF8Type.instance.compose(data_key_bb);


Iterator col_itr=cf.iterator();

Column ts_col=(Column)col_itr.next();
ByteBuffer time_bb=CompositeType.extractComponent(ts_col.name(),0);
long time=(TimestampType.instance.compose(time_bb)).getTime();


Column data_bb=(Column)col_itr.next();
String data=UTF8Type.instance.compose(data_bb.value());

log(" id --> "+id.toString());
log(" data_key-->"+data_key);
log(" time == "+time);
log(" data == "+data);
} catch (Exception e) {
logger.warn("Exception ", e);
}
return null;
}

PS: Since I know my table format, I hardcoded the column comparator type.
If we want to write generic trigger code, we can use
cf.getComponentComparator()/getKeyValidator().

- Ramesh


On Wed, Nov 27, 2013 at 5:10 PM, J Ramesh Kumar wrote:

> Hi,
>
> I need your help on extract column names and values in the trigger augment
> method.
>
> *Table Def :*
>
> create table dy_data (
> id timeuuid,
> data_key text,
> time timestamp,
> data text,
> primary key((id,data_key),time)) with clustering order by (time desc);
>
> public class ArchiveTrigger implements ITrigger {
>   public Collection augment(ByteBuffer key, ColumnFamily cf) {
> try {
> *// Below loop only has 2 columns ( one is "data" and another
> one may be "time" but i am not sure, because i cannot get value.   *
>
> for (Column cell : cf) {
>* //Got Exception if I try to get column name*
> String name = ByteBufferUtil.string(cell.name());
>* //Got only "data" column value and empty value for
> another column may be "time"*. *If I try
> ByteBufferUtil.toLong(cell.value()) it throws exception*
> String value = ByteBufferUtil.string(cell.value());
> log(" name = " + name);
> log(" value = " + value);
> }
> } catch (Exception e) {
> logger.warn("Exception ", e);
> }
> return null;
> }
> }
>
>
> I tried my best to search sample code in google. But failed. Please help
> me with sample code.
>
> Thanks in advance.
>
> Regards,
> Ramesh
>


Re: Updates is not happening when using the same time stamp.

2013-12-02 Thread Julien Campan
Hi,

The internal timestamp is used when you try to read a row. Cassandra checks
 all the versions  of the same row and returns the one with the most recent
timestamp.  If you make many writes (updates) of the same row with the same
timestamp and then read it, Cassandra is not going to be able to choose
between them.

In the code, for this case, they add something that returns the first
result from the lexical-order.

I think that doing many updates with same timestamp is not a good pattern
with Cassandra and you should try to find another way to perform yours
operations.


Julien CAMPAN






2013/12/2 srinivas rao 

>  Hi Team,
>>
>> i am facing an issue, with updating the data with same time stamp.
>>
>> The column values with string type which multiple fields are delimited
>> with "|", example (1|2|3|4|5|6|).
>> if i chage one of the field, some times its updating properly with same
>> time stamp (column internal clock). however some times its not updating
>> with same time stamp.
>> The updates are not happening continuously,
>> please help me to solve the issue.
>>
>> please help me to understand the logic also.
>>
>>
>>
>> Thanks
>> Srini
>>
>
>


Configuration of multiple nodes in a single machine

2013-12-02 Thread Santosh Shet
Hi,

I have requirement to setup multiple nodes to the existing single node 
Cassandra cluster. I am new to Cassandra and I don't have idea whether do I 
need to setup multiple nodes in a single machine by copying Cassandra 
configuration or do I require separate physical machines to create multiple 
nodes.

But I have tried doing it in a single machine by following below steps.

1.   Download apache Cassandra

2.   Unzip Cassandra file

3.   Go inside /Cassandra folder

4.   Make 2 copies of /conf folder named as /conf2,/conf3(in case of 3 
nodes)

5.   Go inside conf folder and edit cassandra.yaml

* Name of the cluster

* Specify seed node

* Change listening address

* Change rpc_address

* Change locations of data_file, commitlog and saved_caches

6.   Go to Cassandra-env.sh under /conf and change JMX_PORT

7.   Go to log4j-server.properties under /conf folder and modify property 
log4j.appender.R.File address if needed.

8.   Make 2 copies of Cassandra.in.sh under /bin folder and edit 
CASSANDRA_HOME.

9.   Make copies of Cassandra under /bin folder. Specify which config 
folder it has to use.

10.   Create aliases to localhost using below command

Sudo ifconfig lo0 alias 127.0.0.2 up

I have followed all the above steps but when I am trying to do step 10, it 
gives following error
[cid:image001.png@01CEEF85.E7325F50]
Please could you provide some inputs.

Santosh Shet
Software Engineer | VistaOne Solutions
Direct India : +91 80 30273829 | Mobile India : +91 8105720582
Skype : santushet

<>

Re: Configuration of multiple nodes in a single machine

2013-12-02 Thread Kais Ahmed
You can try https://github.com/pcmanus/ccm



2013/12/2 Santosh Shet 

>  Hi,
>
>
>
> I have requirement to setup multiple nodes to the existing single node
> Cassandra cluster. I am new to Cassandra and I don’t have idea whether do I
> need to setup multiple nodes in a single machine by copying Cassandra
> configuration or do I require separate physical machines to create multiple
> nodes.
>
>
>
> But I have tried doing it in a single machine by following below steps.
>
> 1.   Download apache Cassandra
>
> 2.   Unzip Cassandra file
>
> 3.   Go inside /Cassandra folder
>
> 4.   Make 2 copies of /conf folder named as /conf2,/conf3(in case of
> 3 nodes)
>
> 5.   Go inside conf folder and edit cassandra.yaml
>
> · Name of the cluster
>
> · Specify seed node
>
> · Change listening address
>
> · Change rpc_address
>
> · Change locations of data_file, commitlog and saved_caches
>
> 6.   Go to Cassandra-env.sh under /conf and change JMX_PORT
>
> 7.   Go to log4j-server.properties under /conf folder and modify
> property log4j.appender.R.File address if needed.
>
> 8.   Make 2 copies of Cassandra.in.sh under /bin folder and edit
> CASSANDRA_HOME.
>
> 9.   Make copies of Cassandra under /bin folder. Specify which config
> folder it has to use.
>
> 10.   Create aliases to localhost using below command
>
> *Sudo ifconfig lo0 alias 127.0.0.2 up*
>
>
>
> I have followed all the above steps but when I am trying to do step 10, it
> gives following error
>
>  Please could you provide some inputs.
>
>
>
> *Santosh Shet*
>
> Software Engineer | VistaOne Solutions
>
> Direct India : * +91 80 30273829 <%2B91%2080%2030273829>* | Mobile India
> : *+91 8105720582 <%2B91%208105720582>*
>
> Skype : santushet
>
>
>
<>

replica verification

2013-12-02 Thread chandra Varahala
Hello Team,


I have cassandra cluster with 5 nodes with 1 replication factor initially.
Now i changed to replication factor 3 and ran nodetool repair.
Is there way i can verify that i have 3 replicas ?


Thanks
Chandra


Re: Data loss when swapping out cluster

2013-12-02 Thread Robert Coli
On Fri, Nov 29, 2013 at 6:36 PM, Anthony Grasso wrote:

> In this case would it be possible to do the following to replace a seed
> node?
>

With the quoted procedure, you are essentially just "changing the ip
address of a node", which will work as long as you set auto_bootstrap:false
in cassandra.yaml. This works because you are *not* bootstrapping, which is
different from bootstrapping.

Details :

https://engineering.eventbrite.com/changing-the-ip-address-of-a-cassandra-node-with-auto_bootstrapfalse/


=Rob


Table Creation Error

2013-12-02 Thread Charlie Andrews
Hi all,

When I try to create a new table, I get the following error:

cqlsh:userdata> CREATE TABLE "f6f5e6a90a90a7ebb69d84a3d6f807" (item_id uuid 
PRIMARY KEY);
TSocket read 0 bytes

This error means nothing to me, so I check the logs that were created and I get 
the error, ‘Cannot modify index name’ multiple times in the stack trace that is 
spit out: 

 INFO [Thrift:16] 2013-12-02 19:49:58,769 MigrationManager.java (line 231) 
Create new ColumnFamily: 
org.apache.cassandra.config.CFMetaData@481b22c4[cfId=78919d85-88fd-358d-884e-c44d913e6642,ksName=userdata,cfName=f6f5e6a90a90a7ebb69d84a3d6f807,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type),comment=,readRepairChance=0.1,dclocalReadRepairChance=0.0,replicateOnWrite=true,gcGraceSeconds=864000,defaultValidator=org.apache.cassandra.db.marshal.BytesType,keyValidator=org.apache.cassandra.db.marshal.UUIDType,minCompactionThreshold=4,maxCompactionThreshold=32,column_metadata={java.nio.HeapByteBuffer[pos=0
 lim=7 cap=7]=ColumnDefinition{name=6974656d5f6964, 
validator=org.apache.cassandra.db.marshal.UUIDType, type=PARTITION_KEY, 
componentIndex=null, indexName=null, 
indexType=null}},compactionStrategyClass=class 
org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy,compactionStrategyOptions={},compressionOptions={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtable_flush_period_in_ms=0,caching=KEYS_ONLY,defaultTimeToLive=0,speculative_retry=99.0PERCENTILE,indexInterval=128,populateIoCacheOnFlush=false,droppedColumns={},triggers={}]
 INFO [MigrationStage:1] 2013-12-02 19:49:58,781 ColumnFamilyStore.java (line 
734) Enqueuing flush of Memtable-schema_columnfamilies@1837602519(1921/9515 
serialized/live bytes, 25 ops)
 INFO [FlushWriter:55] 2013-12-02 19:49:58,782 Memtable.java (line 328) Writing 
Memtable-schema_columnfamilies@1837602519(1921/9515 serialized/live bytes, 25 
ops)
 INFO [FlushWriter:55] 2013-12-02 19:49:58,794 Memtable.java (line 366) 
Completed flushing 
/var/lib/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-jb-183-Data.db
 (852 bytes) for commitlog position ReplayPosition(segmentId=1384553111306, 
position=32142921)
 INFO [MigrationStage:1] 2013-12-02 19:49:58,796 ColumnFamilyStore.java (line 
734) Enqueuing flush of Memtable-schema_columns@842693139(508/2874 
serialized/live bytes, 7 ops)
 INFO [FlushWriter:55] 2013-12-02 19:49:58,796 Memtable.java (line 328) Writing 
Memtable-schema_columns@842693139(508/2874 serialized/live bytes, 7 ops)
 INFO [FlushWriter:55] 2013-12-02 19:49:58,806 Memtable.java (line 366) 
Completed flushing 
/var/lib/cassandra/data/system/schema_columns/system-schema_columns-jb-183-Data.db
 (255 bytes) for commitlog position ReplayPosition(segmentId=1384553111306, 
position=32142921)
 INFO [MigrationStage:1] 2013-12-02 19:49:58,946 DefsTables.java (line 341) 
Loading 
org.apache.cassandra.config.CFMetaData@6c61cd53[cfId=78919d85-88fd-358d-884e-c44d913e6642,ksName=userdata,cfName=f6f5e6a90a90a7ebb69d84a3d6f807,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type),comment=,readRepairChance=0.1,dclocalReadRepairChance=0.0,replicateOnWrite=true,gcGraceSeconds=864000,defaultValidator=org.apache.cassandra.db.marshal.BytesType,keyValidator=org.apache.cassandra.db.marshal.UUIDType,minCompactionThreshold=4,maxCompactionThreshold=32,column_metadata={java.nio.HeapByteBuffer[pos=0
 lim=7 cap=7]=ColumnDefinition{name=6974656d5f6964, 
validator=org.apache.cassandra.db.marshal.UUIDType, type=PARTITION_KEY, 
componentIndex=null, indexName=null, 
indexType=null}},compactionStrategyClass=class 
org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy,compactionStrategyOptions={},compressionOptions={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtable_flush_period_in_ms=0,caching=KEYS_ONLY,defaultTimeToLive=0,speculative_retry=99.0PERCENTILE,indexInterval=128,populateIoCacheOnFlush=false,droppedColumns={},triggers={}]
 INFO [MigrationStage:1] 2013-12-02 19:49:58,950 ColumnFamilyStore.java (line 
251) Initializing userdata.f6f5e6a90a90a7ebb69d84a3d6f807
ERROR [MigrationStage:1] 2013-12-02 19:49:58,953 CassandraDaemon.java (line 
187) Exception in thread Thread[MigrationStage:1,5,main]
java.lang.RuntimeException: 
org.apache.cassandra.exceptions.ConfigurationException: Cannot modify index name
at org.apache.cassandra.config.CFMetaData.reload(CFMetaData.java:983)
at 
org.apache.cassandra.db.DefsTables.updateColumnFamily(DefsTables.java:377)
at 
org.apache.cassandra.db.DefsTables.mergeColumnFamilies(DefsTables.java:318)
at org.apache.cassandra.db.DefsTables.mergeSchema(DefsTables.java:183)
at 
org.apache.cassandra.service.MigrationManager$2.runMayThrow(MigrationManager.java:305)
at 
org.apache.cassandra.utils.WrappedRunnable.run(Wra

Re: Cassandra shows java exceptions

2013-12-02 Thread Robert Coli
On Thu, Nov 28, 2013 at 8:47 AM, Nate McCall  wrote:

> I can reproduce this with the mx4j lib loaded by setting to max hint
> window to 'empty':
>  max_hint_window_in_ms:
>
> I guess you could call this a bug, but given that it has 2 defaults, you
> have to explicitly set this to empty in the configuration to cause any
> exceptions.
>

To those interested in JMX vs cassandra.yaml defaults, generally :

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

=Rob


Re: Table Creation Error

2013-12-02 Thread Robert Coli
On Mon, Dec 2, 2013 at 11:51 AM, Charlie Andrews <
charlieandrews@gmail.com> wrote:

> Has anyone ever seen this behavior before?
>

No.

What version of Cassandra? Easiest fix is probably to dump-and-reload
schema.

=Rob


Re: Table Creation Error

2013-12-02 Thread Charlie Andrews
I am on version 2.0.2. Do you have any resources on how to dump and reload the 
schema?

On Dec 2, 2013, at 2:52 PM, Robert Coli  wrote:

> On Mon, Dec 2, 2013 at 11:51 AM, Charlie Andrews 
>  wrote:
> Has anyone ever seen this behavior before?
> 
> No.
> 
> What version of Cassandra? Easiest fix is probably to dump-and-reload schema.
> 
> =Rob 



Re: Recommended amount of free disk space for compaction

2013-12-02 Thread Robert Coli
On Thu, Nov 28, 2013 at 7:21 PM, Robert Wille  wrote:

> So here’s my question. If Cassandra only compacts one table at a time,
> then I should be safe if I keep as much free space as there is data in the
> largest table. If Cassandra can compact multiple tables simultaneously,
> then it seems that I need as much free space as all the tables put
> together, which means no more than 50% utilization.
>

If the number of SSTables is [x], then :

- "minor" compaction runs on 1-[x-1] SSTables (in practice, usually a
smaller number depending on config)
- "major" compaction runs on [x] SSTables

Unless you run a major compaction manually while using Size Tiered
Compaction, you are very unlikely to run a major compaction in normal
operation.

Level compaciton strategy has a different set of assumptions.

=Rob


Re: Table Creation Error

2013-12-02 Thread Robert Coli
On Mon, Dec 2, 2013 at 11:54 AM, Charlie Andrews <
charlieandrews@gmail.com> wrote:

> I am on version 2.0.2. Do you have any resources on how to dump and reload
> the schema?
>

I guess I should write a blog post on this guy, but the rough outline is :

1) echo "DESCRIBE KEYSPACE ;" | cqlsh >
keyspace_name.schema.cqlsh
2) DROP KEYSPACE ;
3) use the contents of keyspace_name.schema.cqlsh to re-create your schema

For step 3 you can probably do it en masse via another pipe through cqlsh,
but I would probably do it manually unless I had a huge amount of schema.
You should probably keep a schema dump in general, for recovery purposes.

=Rob
PS - thx to devdazed for testing out the cqlsh syntax, I only use
cassandra-cli in my current deploys..


Re: Table Creation Error

2013-12-02 Thread Charlie Andrews
Maybe a stupid question, but doesn’t dropping a keyspace drop all data? Or is 
the keyspace schema separate from the data it describes?

-Charlie

On Dec 2, 2013, at 3:10 PM, Robert Coli  wrote:

> On Mon, Dec 2, 2013 at 11:54 AM, Charlie Andrews 
>  wrote:
> I am on version 2.0.2. Do you have any resources on how to dump and reload 
> the schema?
> 
> I guess I should write a blog post on this guy, but the rough outline is :
> 
> 1) echo "DESCRIBE KEYSPACE ;" | cqlsh > 
> keyspace_name.schema.cqlsh
> 2) DROP KEYSPACE ;
> 3) use the contents of keyspace_name.schema.cqlsh to re-create your schema
> 
> For step 3 you can probably do it en masse via another pipe through cqlsh, 
> but I would probably do it manually unless I had a huge amount of schema. You 
> should probably keep a schema dump in general, for recovery purposes.
> 
> =Rob
> PS - thx to devdazed for testing out the cqlsh syntax, I only use 
> cassandra-cli in my current deploys..



Re: Table Creation Error

2013-12-02 Thread Robert Coli
On Mon, Dec 2, 2013 at 12:14 PM, Charlie Andrews <
charlieandrews@gmail.com> wrote:

> Maybe a stupid question, but doesn’t dropping a keyspace drop all data? Or
> is the keyspace schema separate from the data it describes?
>

Lol, sorry, yes. You will have to restore the data from the automatically
created snapshot.

1) echo "DESCRIBE KEYSPACE ;" | cqlsh >
keyspace_name.schema.cqlsh
2) DROP KEYSPACE ;
3) restore keyspace's data from the snapshots created automatically when
you DROP
4) use the contents of keyspace_name.schema.cqlsh to re-create your schema
5) rolling restart of all nodes (or use "nodetool refresh")

=Rob


Re: Table Creation Error

2013-12-02 Thread Charlie Andrews
Just out of curiosity, what do you think occurred to cause this problem? I 
thought it was quite strange that I didn’t get a useable error since my 
experience with this project has always been pretty helpful errors.

Thanks,
Charlie

On Dec 2, 2013, at 3:20 PM, Robert Coli  wrote:

> On Mon, Dec 2, 2013 at 12:14 PM, Charlie Andrews 
>  wrote:
> Maybe a stupid question, but doesn’t dropping a keyspace drop all data? Or is 
> the keyspace schema separate from the data it describes?
> 
> Lol, sorry, yes. You will have to restore the data from the automatically 
> created snapshot.
> 
> 1) echo "DESCRIBE KEYSPACE ;" | cqlsh > 
> keyspace_name.schema.cqlsh
> 2) DROP KEYSPACE ;
> 3) restore keyspace's data from the snapshots created automatically when you 
> DROP
> 4) use the contents of keyspace_name.schema.cqlsh to re-create your schema
> 5) rolling restart of all nodes (or use "nodetool refresh")
>  
> =Rob
> 



Re: Table Creation Error

2013-12-02 Thread Robert Coli
On Mon, Dec 2, 2013 at 12:24 PM, Charlie Andrews <
charlieandrews@gmail.com> wrote:

> Just out of curiosity, what do you think occurred to cause this problem? I
> thought it was quite strange that I didn’t get a useable error since my
> experience with this project has always been pretty helpful errors.
>

No idea, haven't looked into it in detail. The advice given is my generic
advice for "it seems like my schema is stuck", if your schema is not in
fact stuck (or it's not trivial for you to reset the schema) then you *may*
be able to debug and figure out what is wrong. My assertion is that this is
probably not worth your time, in many cases. If you are running 2.0.x,
hopefully you are not in production, etc...

=Rob


Re: sstable2json hangs for authenticated keyspace?

2013-12-02 Thread Robert Coli
On Fri, Nov 29, 2013 at 4:11 PM, Josh Dzielak  wrote:

> Having an issue with sstable2json. It appears to hang when I run it
> against an SSTable that's part of a keyspace with authentication turned on.
> Running it against any other keyspace works, and as far as I can tell the
> only difference between the keyspaces is authentication. Has anyone run
> into this?
>

This is probably a bug. I would file a JIRA. It's unclear whether this
"should" work, but I can't see any reason why not. At very least, it should
do something other than hang forever. :)

=Rob


changing several things (almost) at once; is this the right order to make the changes?

2013-12-02 Thread Brian Tarbox
We're making several changes and I'd to confirm that our order of making
them is reasonable.  Right now we have 4 node system at replicationFactor=2
running 1.1.6.

We've moving to a 6 node system at rf=3 running 1.2.12 (I guess).

We think the order should be:
1) change to rf=3 and run repair on all nodes while still at 1.1.6
2) upgrade to 1.1.10 (latest on that branch?)
3) upgrade to 1.2.12 (latest on that branch?)
4) run the convert-to-v_Node command
5) add two more servers

Is that reasonable?  Thanks.  We run in ec2 and I'm planning on testing it
all on a new set of servers just in case but figured I'd ask the experts
first in case I'm doing something foolish.

Thanks,

Brian Tarbox


bin/cqlsh is missing cqlshlib

2013-12-02 Thread Ritchie Iu

Hello,

I am trying to install and setup Cassandra on Fedora. So far I have 
successfully installed it using Yum by following the startup guide: 
http://www.datastax.com/documentation/cassandra/1.2/webhelp/index.html#cassandra/install/installRHEL_t.html


My problem is that when I run bin/cqlsh, I get the following error:
Traceback (most recent call last):
  File "bin/cqlsh", line 114, in 
from cqlshlib import cqlhandling, cql3handling, pylexotron
ImportError: No module named cqlshlib

I'm aware that there was a similar bug about this a year ago 
(https://issues.apache.org/jira/browse/CASSANDRA-3767) but it seems to 
have been fixed, so I'm not sure what I'm missing.


Thank for your help,
Ritchie


Re: 答复: How to configure linux service for Cassandra?

2013-12-02 Thread Kumar Ranjan
Hey Folks,

I have been using ccm for some time and it's pretty awesome tool to test
out admin stuff. Now, I really want to test modeling data by trying to
access ccm running cassandra using Thrift based pycassaShell client from
remote hosts (not locally). My setup is like this:

Lets say, private IP of this machine is: 10.11.12.13 (Just an example)

loLink encap:Local Loopback

  inet addr:127.0.0.1  Mask:255.0.0.0

  inet6 addr: ::1/128 Scope:Host

  UP LOOPBACK RUNNING  MTU:16436  Metric:1

  RX packets:67392708 errors:0 dropped:0 overruns:0 frame:0

  TX packets:67392708 errors:0 dropped:0 overruns:0 carrier:0

  collisions:0 txqueuelen:0

  RX bytes:7398829042 (6.8 GiB)  TX bytes:7398829042 (6.8 GiB)


lo:1  Link encap:Local Loopback

  inet addr:127.0.0.2  Mask:255.255.255.0

  UP LOOPBACK RUNNING  MTU:16436  Metric:1


lo:2  Link encap:Local Loopback

  inet addr:127.0.0.3  Mask:255.0.0.0

  UP LOOPBACK RUNNING  MTU:16436  Metric:1


lo:3  Link encap:Local Loopback

  inet addr:127.0.0.4  Mask:255.0.0.0

  UP LOOPBACK RUNNING  MTU:16436  Metric:1


and 127.0.0.1 (node1), 127.0.0.2 (node2), 127.0.0.3 (node3), 127.0.0.4
(node4)


$ ccm status

node1: UP

node3: UP

node2: UP

node4: UP


How to connect to any of the instance from non-local hosts? When I do:

pycassaShell --host 10.11.12.13 --port 9160, it throws an exception,


thrift.transport.TTransport.TTransportException: Could not connect to
10.11.12.13:9160


Is there a way to make it work?



On Tue, Nov 12, 2013 at 4:19 AM, Boole.Z.Guo (mis.cnsh04.Newegg) 41442 <
boole.z@newegg.com> wrote:

>  Thanks very much. I will try.
>
>
>
> The goal of ccm and ccmlib is to make is easy to create, manage and
> destroy a
>
> small cluster on a local box. It is meant for testing of a Cassandra
> cluster.
>
> Best Regards,
>
> *Boole Guo*
>
> *Software Engineer, NESC-SH.MIS*
>
> *+86-021-51530666 <%2B86-021-51530666>*41442*
>
> *Floor 19, KaiKai Plaza, 888, Wanhangdu Rd, Shanghai (200042)*
>
>
>
> *发件人:* Christopher Wirt [mailto:chris.w...@struq.com]
> *发送时间:* 2013年11月12日 16:53
> *收件人:* user@cassandra.apache.org
> *主题:* RE: How to configure linux service for Cassandra?
>
>
>
> Starting multiple Cassandra nodes on the same machine involves setting
> loop back aliases and some configuration fiddling.
>
>
>
> Lucky for you Sylvain Lebresne made this handy tool in python which does
> the job for you.
>
> https://github.com/pcmanus/ccm
>
>
>
> to run as a service you need a script like this
> http://www.bajb.net/2012/01/cassandra-service-script/
>
> I haven’t tried this, I just run Cassandra in the foreground of a screen
> session.
>
>
>
>
>
> *From:* Boole.Z.Guo (mis.cnsh04.Newegg) 41442 [
> mailto:boole.z@newegg.com ]
> *Sent:* 12 November 2013 05:17
> *To:* user@cassandra.apache.org
> *Subject:* How to configure linux service for Cassandra?
>
>
>
> How to configure linux service for Cassandra or start multiple Cassandra
> nodes from a single node?
>
>
>
> Thanks very muh!
>
>
>
> Best Regards,
>
> *Boole Guo*
>


Re: replica verification

2013-12-02 Thread Jason Wee
You could probably use one of these
nodetool  getendpoints- Print the end points that
owns the key
using cqlsh and desc keyspace;

/Jason




On Tue, Dec 3, 2013 at 12:16 AM, chandra Varahala <
hadoopandcassan...@gmail.com> wrote:

> Hello Team,
>
>
> I have cassandra cluster with 5 nodes with 1 replication factor initially.
> Now i changed to replication factor 3 and ran nodetool repair.
> Is there way i can verify that i have 3 replicas ?
>
>
> Thanks
> Chandra
>
>


Re: bin/cqlsh is missing cqlshlib

2013-12-02 Thread Jason Wee
Check if you have the cqlshlib installed? For debian, it is located
at /usr/share/pyshared/cqlshlib

/Jason


On Tue, Dec 3, 2013 at 5:42 AM, Ritchie Iu  wrote:

> Hello,
>
> I am trying to install and setup Cassandra on Fedora. So far I have
> successfully installed it using Yum by following the startup guide:
> http://www.datastax.com/documentation/cassandra/1.2/
> webhelp/index.html#cassandra/install/installRHEL_t.html
>
> My problem is that when I run bin/cqlsh, I get the following error:
> Traceback (most recent call last):
>   File "bin/cqlsh", line 114, in 
> from cqlshlib import cqlhandling, cql3handling, pylexotron
> ImportError: No module named cqlshlib
>
> I'm aware that there was a similar bug about this a year ago (
> https://issues.apache.org/jira/browse/CASSANDRA-3767) but it seems to
> have been fixed, so I'm not sure what I'm missing.
>
> Thank for your help,
> Ritchie
>


Stack trace from a node during a repair

2013-12-02 Thread John Pyeatt
We are running a 6-node AWS EC2 (m1.large) cluster of cassandra 1.2.9
across three availability zones with Ec2Snitch and NetworkTopologyStrategy.

One of our nodes was apparently sharing a physical box with another
customer who was really hogging the IO. So we needed to bring the node up
on a new ec2 instance.

We decommissioned the offending node, killed the instance and brought a new
instance into the cluster. Everything went fine so far.

After it came up I ran a nodetool repair -pr on each of the nodes in the
cluster. I ran these sequentially. When it got to doing the repair on the
new node three times the gossip service shut down. At the bottom of this
email is a copy of the stack trace we received.

It says it couldn't create a backups directory. I have no idea why this
would be the /data-1 partition is 400Gb in size and currently 1% utilized.
Does anyone have any idea what could be causing this?

my /etc/security/limits.conf file currently has
# resource settings added based on
# http://www.datastax.com/docs/1.2/install/recommended_settings
* soft nofile 65536
* hard nofile 65536
root soft nofile 65536
root hard nofile 65536
* soft memlock unlimited
* hard memlock unlimited
root soft memlock unlimited
root hard memlock unlimited
* soft as unlimited
* hard as unlimited
root soft as unlimited
root hard as unlimited



ERROR 2013-12-02 21:02:25,711 [Thread-3050] CassandraDaemon Exception in
thread Thread[Thread-3050,5,main]
FSWriteError in /data-1/cassandra/data/SinglewireSupport/Binaries/backups
at
org.apache.cassandra.db.Directories.getOrCreate(Directories.java:483)
at
org.apache.cassandra.db.Directories.getBackupsDirectory(Directories.java:242)
at
org.apache.cassandra.db.DataTracker.maybeIncrementallyBackup(DataTracker.java:165)
at
org.apache.cassandra.db.DataTracker.addSSTables(DataTracker.java:237)
at
org.apache.cassandra.db.ColumnFamilyStore.addSSTables(ColumnFamilyStore.java:911)
at
org.apache.cassandra.streaming.StreamInSession.closeIfFinished(StreamInSession.java:186)
at
org.apache.cassandra.streaming.IncomingStreamReader.read(IncomingStreamReader.java:138)
at
org.apache.cassandra.net.IncomingTcpConnection.stream(IncomingTcpConnection.java:238)
at
org.apache.cassandra.net.IncomingTcpConnection.handleStream(IncomingTcpConnection.java:178)
at
org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:78)
Caused by: java.io.IOException: Unable to create directory
/data-1/cassandra/data/SinglewireSupport/Binaries/backups


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


Re: Stack trace from a node during a repair

2013-12-02 Thread Robert Coli
On Mon, Dec 2, 2013 at 2:59 PM, John Pyeatt wrote:

> Caused by: java.io.IOException: Unable to create directory
> /data-1/cassandra/data/SinglewireSupport/Binaries/backups
>

This is an exception directly from a core java method. The cause is
99.9% likely to be permissions.

=Rob


Re: changing several things (almost) at once; is this the right order to make the changes?

2013-12-02 Thread Robert Coli
On Mon, Dec 2, 2013 at 1:08 PM, Brian Tarbox wrote:

> We're making several changes and I'd to confirm that our order of making
> them is reasonable.  Right now we have 4 node system at replicationFactor=2
> running 1.1.6.
>
> We've moving to a 6 node system at rf=3 running 1.2.12 (I guess).
>
> We think the order should be:
> 1) change to rf=3 and run repair on all nodes while still at 1.1.6
>

Yes, being aware that you will get false "no data" reads from the third
replica at CL.ONE until your repair completes.


> 2) upgrade to 1.1.10 (latest on that branch?)
>

Unless NEWS.txt specifies that you need to do this, you can probably skip
it. From memory, I believe you can skip it.


> 3) upgrade to 1.2.12 (latest on that branch?)
>

Yes.


>  4) run the convert-to-v_Node command
>

If you mean shuffle, I feel bound to tell you that no one has successfully
run shuffle on an actual production cluster[1]. I conjecture that you are
in production because you are running 1.1.x.

You might be the first to successfully run shuffle in production, but you
probably do not want to try to be?


> 5) add two more servers
>

If you're going to add servers anyway, you might want to do the "new
datacenter(s)" process for upgrading to Vnodes.

=Rob
[1] rbranson apparently did a shuffle-like activity successfully, but by
adding two additional DCs, one with a node with enough disk space to hold
the entire cluster's data...


Re: replica verification

2013-12-02 Thread Robert Coli
On Mon, Dec 2, 2013 at 8:16 AM, chandra Varahala <
hadoopandcassan...@gmail.com> wrote:

> I have cassandra cluster with 5 nodes with 1 replication factor initially.
> Now i changed to replication factor 3 and ran nodetool repair.
> Is there way i can verify that i have 3 replicas ?
>

Use "findrow" from https://github.com/cloudian/support-tools on each
row/node?

=Rob


Re: bin/cqlsh is missing cqlshlib

2013-12-02 Thread Ritchie Iu
No, there is no cqlshlib found at /usr/share/pyshared/cqlshlib although 
it might because I'm using Fedora which isn't debian.


I did a search and I've found that cqlshlib is in several locations:
/opt_build/fc17/lib/cassandra/pylib/cqlshlib,
/opt_build/fc17/lib/cassandra/pylib/cqlshlib,
/usr/opt/apache-cassandra/1.1.4/top/cassandra/pylib/cqlshlib and
/usr/opt/apache-cassandra/1.1.0/top/cassandra/pylib/cqlshlib

So I'm guessing that means the start script doesn't know where to find 
the cqlshlib directory? Any idea which one of the above locations I 
should tell it to point to?


Thanks,
Ritchie


Re: 答复: How to configure linux service for Cassandra?

2013-12-02 Thread Krishna Chaitanya
Hey why dont you try Datastax Opscenter?  Its a cool Gui tool to
start/stop/manage your cluster(even remotely) . It also provides
administrative tools fr checking on the performance with vital statistics.
Definitely worth it.
On Dec 3, 2013 3:14 AM, "Kumar Ranjan"  wrote:

> Hey Folks,
>
> I have been using ccm for some time and it's pretty awesome tool to test
> out admin stuff. Now, I really want to test modeling data by trying to
> access ccm running cassandra using Thrift based pycassaShell client from
> remote hosts (not locally). My setup is like this:
>
> Lets say, private IP of this machine is: 10.11.12.13 (Just an example)
>
> loLink encap:Local Loopback
>
>   inet addr:127.0.0.1  Mask:255.0.0.0
>
>   inet6 addr: ::1/128 Scope:Host
>
>   UP LOOPBACK RUNNING  MTU:16436  Metric:1
>
>   RX packets:67392708 errors:0 dropped:0 overruns:0 frame:0
>
>   TX packets:67392708 errors:0 dropped:0 overruns:0 carrier:0
>
>   collisions:0 txqueuelen:0
>
>   RX bytes:7398829042 (6.8 GiB)  TX bytes:7398829042 (6.8 GiB)
>
>
> lo:1  Link encap:Local Loopback
>
>   inet addr:127.0.0.2  Mask:255.255.255.0
>
>   UP LOOPBACK RUNNING  MTU:16436  Metric:1
>
>
> lo:2  Link encap:Local Loopback
>
>   inet addr:127.0.0.3  Mask:255.0.0.0
>
>   UP LOOPBACK RUNNING  MTU:16436  Metric:1
>
>
> lo:3  Link encap:Local Loopback
>
>   inet addr:127.0.0.4  Mask:255.0.0.0
>
>   UP LOOPBACK RUNNING  MTU:16436  Metric:1
>
>
> and 127.0.0.1 (node1), 127.0.0.2 (node2), 127.0.0.3 (node3), 127.0.0.4
> (node4)
>
>
> $ ccm status
>
> node1: UP
>
> node3: UP
>
> node2: UP
>
> node4: UP
>
>
> How to connect to any of the instance from non-local hosts? When I do:
>
> pycassaShell --host 10.11.12.13 --port 9160, it throws an exception,
>
>
> thrift.transport.TTransport.TTransportException: Could not connect to
> 10.11.12.13:9160
>
>
> Is there a way to make it work?
>
>
>
> On Tue, Nov 12, 2013 at 4:19 AM, Boole.Z.Guo (mis.cnsh04.Newegg) 41442 <
> boole.z@newegg.com> wrote:
>
>>  Thanks very much. I will try.
>>
>>
>>
>> The goal of ccm and ccmlib is to make is easy to create, manage and
>> destroy a
>>
>> small cluster on a local box. It is meant for testing of a Cassandra
>> cluster.
>>
>> Best Regards,
>>
>> *Boole Guo*
>>
>> *Software Engineer, NESC-SH.MIS*
>>
>> *+86-021-51530666 <%2B86-021-51530666>*41442*
>>
>> *Floor 19, KaiKai Plaza, 888, Wanhangdu Rd, Shanghai (200042)*
>>
>>
>>
>> *发件人:* Christopher Wirt [mailto:chris.w...@struq.com]
>> *发送时间:* 2013年11月12日 16:53
>> *收件人:* user@cassandra.apache.org
>> *主题:* RE: How to configure linux service for Cassandra?
>>
>>
>>
>> Starting multiple Cassandra nodes on the same machine involves setting
>> loop back aliases and some configuration fiddling.
>>
>>
>>
>> Lucky for you Sylvain Lebresne made this handy tool in python which does
>> the job for you.
>>
>> https://github.com/pcmanus/ccm
>>
>>
>>
>> to run as a service you need a script like this
>> http://www.bajb.net/2012/01/cassandra-service-script/
>>
>> I haven’t tried this, I just run Cassandra in the foreground of a screen
>> session.
>>
>>
>>
>>
>>
>> *From:* Boole.Z.Guo (mis.cnsh04.Newegg) 41442 [
>> mailto:boole.z@newegg.com ]
>> *Sent:* 12 November 2013 05:17
>> *To:* user@cassandra.apache.org
>> *Subject:* How to configure linux service for Cassandra?
>>
>>
>>
>> How to configure linux service for Cassandra or start multiple Cassandra
>> nodes from a single node?
>>
>>
>>
>> Thanks very muh!
>>
>>
>>
>> Best Regards,
>>
>> *Boole Guo*
>>
>
>


Re: 答复: How to configure linux service for Cassandra?

2013-12-02 Thread Michael Shuler
On 12/02/2013 03:43 PM, Kumar Ranjan wrote:
> Hey Folks,
> 
> I have been using ccm for some time and it's pretty awesome tool to test
> out admin stuff. Now, I really want to test modeling data by trying to
> access ccm running cassandra using Thrift based pycassaShell client from
> remote hosts (not locally). My setup is like this:

In your case, since the ccm cluster nodes are bound to localhost
aliases, you would need to set up routing and port forwarding via
iptables from your public IP (10.11.12.13) to the respective localhost
aliases/ports.  ccm is great for local testing, but gets to be a pain if
you wish to do some real testing - not because of ccm, but because now
you want to do something that involves actual multi-host networking with
remote access.  Even easier, in my opinion; if you really want to begin
testing a real cluster with remote access, which will have a lot more
horsepower than everything on localhost via ccm, then spend $15/month on
3x $5/mo. digitalocean nodes.

> How to connect to any of the instance from non-local hosts? When I do:
> 
> pycassaShell --host 10.11.12.13 --port 9160, it throws an exception,
> 
> 
> thrift.transport.TTransport.TTransportException: Could not connect to
> 10.11.12.13:9160

Yup.  The nodes are not listening to anything but their localhost alias
IP addresses.

> Is there a way to make it work?

`man iptables`  ;)

-- 
Kind regards,
Michael


Exactly one wide row per node for a given CF?

2013-12-02 Thread onlinespending
Subject says it all. I want to be able to randomly distribute a large set of 
records but keep them clustered in one wide row per node.

As an example, lets say I’ve got a collection of about 1 million records each 
with a unique id. If I just go ahead and set the primary key (and therefore the 
partition key) as the unique id, I’ll get very good random distribution across 
my server cluster. However, each record will be its own row. I’d like to have 
each record belong to one large wide row (per server node) so I can have them 
sorted or clustered on some other column.

If I say have 5 nodes in my cluster, I could randomly assign a value of 1 - 5 
at the time of creation and have the partition key set to this value. But this 
becomes troublesome if I add or remove nodes. What effectively I want is to 
partition on the unique id of the record modulus N (id % N; where N is the 
number of nodes).

I have to imagine there’s a mechanism in Cassandra to simply randomize the 
partitioning without even using a key (and then clustering on some column).

Thanks for any help.