Re: ParNew (promotion failed)

2011-03-24 Thread ruslan usifov
2011/3/24 Erik Onnen 

> It's been about 7 months now but at the time G1 would regularly
> segfault for me under load on Linux x64. I'd advise extra precautions
> in testing and make sure you test with representative load.
>

Which java version do you use?


error connecting to cassandra 0.7.3

2011-03-24 Thread Anurag Gujral
I am using cassandra-0.7.3 and thrift-0.0.5,I wrote a java client using
thrift 0.0.5 when I try to connect to
local cassandra server I get the following error
ERROR com.bluekai.cassandra.validation.ValidationThread  - Failed to connect
to 127.0.0.1.
org.apache.thrift.transport.TTransportException: Cannot write to null
outputStream


I am able to connect to the local cassandra server using cassandra-cli
though

Any suggestions
Thanks
Anurag


error connecting to cassandra 0.7.3

2011-03-24 Thread Anurag Gujral
I am using the following code to create my client.

 tr = new TSocket(url, port);
TProtocol proto = new TBinaryProtocol(tr);
 client = new Cassandra.Client(proto);
  client.set_keyspace(this.keyspace);

I am getting the errors I mentioned below
Thanks
Anurag

-- Forwarded message --
From: Anurag Gujral 
Date: Thu, Mar 24, 2011 at 1:26 AM
Subject: error connecting to cassandra 0.7.3
To: user@cassandra.apache.org


I am using cassandra-0.7.3 and thrift-0.0.5,I wrote a java client using
thrift 0.0.5 when I try to connect to
local cassandra server I get the following error
ERROR com.bluekai.cassandra.validation.ValidationThread  - Failed to connect
to 127.0.0.1.
org.apache.thrift.transport.TTransportException: Cannot write to null
outputStream


I am able to connect to the local cassandra server using cassandra-cli
though

Any suggestions
Thanks
Anurag


Re: error connecting to cassandra 0.7.3

2011-03-24 Thread ruslan usifov
and where is transport creation for your thrift interface? Cassandra 0.7
uses Framed transport as default

2011/3/24 Anurag Gujral 

>
> I am using the following code to create my client.
>
>  tr = new TSocket(url, port);
> TProtocol proto = new TBinaryProtocol(tr);
>  client = new Cassandra.Client(proto);
>   client.set_keyspace(this.keyspace);
>
> I am getting the errors I mentioned below
> Thanks
> Anurag
>
>
> -- Forwarded message --
> From: Anurag Gujral 
> Date: Thu, Mar 24, 2011 at 1:26 AM
> Subject: error connecting to cassandra 0.7.3
> To: user@cassandra.apache.org
>
>
> I am using cassandra-0.7.3 and thrift-0.0.5,I wrote a java client using
> thrift 0.0.5 when I try to connect to
> local cassandra server I get the following error
> ERROR com.bluekai.cassandra.validation.ValidationThread  - Failed to
> connect to 127.0.0.1.
> org.apache.thrift.transport.TTransportException: Cannot write to null
> outputStream
>
>
> I am able to connect to the local cassandra server using cassandra-cli
> though
>
> Any suggestions
> Thanks
> Anurag
>
>


Why disc access mode conf parameter deleted from yaml in cassandra 0.7 brunch,

2011-03-24 Thread ruslan usifov
mmap which will be set default on 64 bit platforms works badly (i don't know
reason why this happens but this is happens on 4 machines in my case so i
don't think that it is hardware problems)


Re: result of get_indexed_slices() seems wrong

2011-03-24 Thread Wangpei (Peter)
Thanks aaron.
Maybe we need to do more check at ThriftValidation.validateIndexClauses(), add 
this:
Map colDefs = 
DatabaseDescriptor.getTableDefinition(keyspace).cfMetaData().get(columnFamily).getColumn_metadata();
for (IndexExpression expression : index_clause.expressions)
{
if (!colDefs.containsKey(expression.column_name))
throw new InvalidRequestException("No column definition for " + 
expression.column_name);
}


发件人: aaron morton [mailto:aa...@thelastpickle.com]
发送时间: 2011年3月24日 12:24
收件人: user@cassandra.apache.org
主题: Re: result of get_indexed_slices() seems wrong

Looks like this https://issues.apache.org/jira/browse/CASSANDRA-2347

From this discussion 
http://www.mail-archive.com/user@cassandra.apache.org/msg11291.html


Aaron

On 24 Mar 2011, at 17:17, Wangpei (Peter) wrote:


Hi,

This problem occurs when the clause has multi expression and a expression with 
operator other than EQ.
Is anyone meet the same problem?

I trace the code, and seen this at ColumnFamilyStore.satisfies() method:
int v = data.getComparator().compare(column.value(), 
expression.value);
It seems when I need the type of column value here, it use the type of my 
column names which is UTF8Type, so give the wrong result.
To fix it, the expression needs a optional “comparator_type” attribute, then 
satisfies() can get the correct type to compare.
pls point out if I am wrong.





Configuration for large number of inserts

2011-03-24 Thread Adam Briffett
Hi,

When doing bulk inserts of data using Pelops (~1000 million rows,
column counts varying from 1 - 100,000 but more skewed towards fewer
columns), we're ultimately getting a server OOME using 0.7.4. I've
attempted to follow other pointers on this issue (reducing threshold
before memtables flushed to disk, increasing heap space), turned off
compaction (although it seems to still be happening), and also tried
reducing the value of index_interval to avoid using up space.

We're using a single box for this test with attached .yaml and a heap
size of 2GB, we're also using a single keyspace and column family, the
settings for which are below (we're creating it using Pelops rather
than in the .yaml):

cf.column_type = "Standard";
cf.comparator_type = "UTF8Type";
cf.key_cache_size = 200d;
cf.row_cache_size = 16d;
cf.memtable_throughput_in_mb = 128;
cf.memtable_operations_in_millions = 0.3;
cf.min_compaction_threshold = 0;
cf.max_compaction_threshold = 0;

One issue is that compaction still appears to be happening, as if I
check using nodetool compactionstats there are minor compactions
piling up (also these get into the thousands, it seems they're being
created faster than they can be addressed)

Can anyone suggest anywhere we might be going wrong? As I say, at the
present we're just looking to do a bulk insert, no read activity until
the writes have completed.

Thanks in advance,

Adam


cassandra.yaml
Description: Binary data


Quorum, Hector, and datacenter preference

2011-03-24 Thread Jonathan Colby
Hi -

Our cluster is spread between 2 datacenters.   We have a straight-forward IP 
assignment so that OldNetworkTopology (rackinferring snitch) works well.We 
have cassandra clients written in Hector in each of those data centers.   The 
Hector clients all have a list of all cassandra nodes across both data centers. 
 RF=3.

Is there an order as to which data center gets the first write?In other 
words, would (or can) the Hector client do its first write to the cassandra 
nodes in its own data center?

It would be ideal it Hector chose the "local" cassandra nodes.  That way, if 
one data center is unreachable, the Quorum of replicas in cassandra is still 
reached (because it was written to the working data center first).

Otherwise, if the cassandra writes are really random from the Hector client 
point-of-view, a data center outage would result in a read failure for any data 
that has 2 replicas in the lost data center.

Is anyone doing this?  Is there a flaw in my logic?




Re: Sizing a Cassandra cluster

2011-03-24 Thread Brian Fitzpatrick
Thanks for the tips on the replication factor.  Any thoughts on the
number of nodes in a cluster to support an RF=3 with a workload of 400
ops/sec (4-8K sized rows, 50/50 read/write)?  Based on the "sweet
spot" hardware referenced in the wiki (8-core, 16-32GB RAM), what kink
of ops/sec could I reasonably expect from each node.  Just looking for
a range to make some educated guesses.

Thanks,
Brian

On Wed, Mar 23, 2011 at 9:04 PM, aaron morton  wrote:
> It really does depend on what your workload is like, and in the end will
> involve a certain amount of fudge factor.
>
> http://wiki.apache.org/cassandra/CassandraHardware provides some guidance.
> http://wiki.apache.org/cassandra/MemtableThresholds can be used to get a
> rough idea of the memory requirements. Note that secondary indexes are also
> CF's with the same memory settings as the parent.
> With RF3 you can lose afford to lose one replica for a key a token range and
> still be available (Assuming Quorum CL). With RF 5 you can lose 2 replicas
> and still be available for the keys in the range.
> I'm been careful to say "lose X replicas" because the other nodes in the
> cluster don't count when considering an operation for a key. Two examples, 9
> node cluster with RF3. If you lose nodes 2 and 3 and they are replicas for
> node 1, Quorum operations on keys in the range for node 1 will fail (ranges
> for 2 and 3 will be ok). If you lose nodes 2 and 5 Quorum operations will
> succeed for all keys.
> RF 3 is reasonable starting point for some redundancy, RF 5 is more. After
> that it's Web Scale (tm).
> Hope that helps
> Aaron
>
> On 24 Mar 2011, at 04:04, Brian Fitzpatrick wrote:
>
> I'm going through the process of specing out the hardware for a
> Cassandra cluster. The relevant specs:
>
> - Support 460 operations/sec (50/50 read/write workload). Row size
> ranges from 4 to 8K.
> - Support 29 million objects for the first year
> - Support 365 GB storage for the first year, based on Cassandra tests
> (data + index + overhead * replication factor of 3)
>
> I'm looking for advice on the node size for this cluster, recommended
> RAM per node, and whether RF=3 seems to be a good choice for general
> availability and resistance to failure.
>
> I've looked at the YCSB benchmark paper and through the archives of
> this email list looking for pointers.  I haven't found any general
> guidelines on recommended cluster size to support X operations/sec
> with Y data size at RF factor of Z, that I could extrapolate from.
>
> Any and all recommendations appreciated.
>
> Thanks,
> Brian
>
>


Re: Quorum, Hector, and datacenter preference

2011-03-24 Thread Jonathan Colby
Indeed I found the big flaw in my own logic.   Even writing to the "local" 
cassandra nodes does not guarantee where the replicas will end up.   The 
decision where to write the first replica is based on the token ring, which is 
spread out on all nodes regardless of datacenter.   right ?

On Mar 24, 2011, at 2:02 PM, Jonathan Colby wrote:

> Hi -
> 
> Our cluster is spread between 2 datacenters.   We have a straight-forward IP 
> assignment so that OldNetworkTopology (rackinferring snitch) works well.
> We have cassandra clients written in Hector in each of those data centers.   
> The Hector clients all have a list of all cassandra nodes across both data 
> centers.  RF=3.
> 
> Is there an order as to which data center gets the first write?In other 
> words, would (or can) the Hector client do its first write to the cassandra 
> nodes in its own data center?
> 
> It would be ideal it Hector chose the "local" cassandra nodes.  That way, if 
> one data center is unreachable, the Quorum of replicas in cassandra is still 
> reached (because it was written to the working data center first).
> 
> Otherwise, if the cassandra writes are really random from the Hector client 
> point-of-view, a data center outage would result in a read failure for any 
> data that has 2 replicas in the lost data center.
> 
> Is anyone doing this?  Is there a flaw in my logic?
> 
> 



Column TTL Hook

2011-03-24 Thread Or Yanay
Hi all,
Is there any way for me to save or pass the columns retired by the column TTL?
I understand that compaction takes care of removing expired columns, I would 
like to know the keys for which columns have expired.

Thanks,
-Orr


RE: Map-Reduce on top of cassandra

2011-03-24 Thread Or Yanay
Worked like a charm!
I have installed hadoop on my Cassandra nodes and ran the MR using Hadoop job 
tracker.

A simple key count improved from ~2 hours to about 25 minutes (150M keys and 
~100G on each node)

Thanks Jeremy.

-Original Message-
From: Jeremy Hanna [mailto:jeremy.hanna1...@gmail.com] 
Sent: Monday, March 14, 2011 8:42 PM
To: user@cassandra.apache.org
Subject: Re: Map-Reduce on top of cassandra

Just for the sake of updating this thread - Orr didn't yet have task trackers 
on the Cassandra nodes so most of the time was likely due to copying the ~100G 
of data to the hadoop cluster prior to processing.  They're going to try after 
installing task trackers on the nodes.

On Mar 14, 2011, at 10:06 AM, Or Yanay wrote:

> Hi All,
>  
> I am trying to write some map-reduce tasks so I can find out stuff like - how 
> many records have X status?
> I am using 0.7.0 and have 5 nodes with ~100G of data on each node.
>  
> I have written the code based on the word_count example and the map-reduce is 
> running successfully BUT is extremely slow (about 2 hours for the simplest 
> key count).
>  
> I am now looking to track down the slowness and tune my process, or explore 
> alternative ways to achieve the same goal.
>  
> Can anyone point me to a way to tune my map-reduce job?
> Does anyone have any experience exploring Cassandra data with Hadoop cluster 
> configuration? ( As suggested 
> inhttp://wiki.apache.org/cassandra/HadoopSupport#ClusterConfig)
>  
> Thanks,
> Orr
>  



Re: Quorum, Hector, and datacenter preference

2011-03-24 Thread Nate McCall
We have a load balancing policy which selects the host best on latency
and uses a Phi convict algorithm in a method similar to DynamicSnitch.
Using this policy, you would inherently get the closest replica
whenever possible as that would most likely be the best performing.

This policy is still in trunk and 0.7.0 tip. We should have a new
release out containing the above in the next few days.

On Thu, Mar 24, 2011 at 8:46 AM, Jonathan Colby
 wrote:
> Indeed I found the big flaw in my own logic.   Even writing to the "local" 
> cassandra nodes does not guarantee where the replicas will end up.   The 
> decision where to write the first replica is based on the token ring, which 
> is spread out on all nodes regardless of datacenter.   right ?
>
> On Mar 24, 2011, at 2:02 PM, Jonathan Colby wrote:
>
>> Hi -
>>
>> Our cluster is spread between 2 datacenters.   We have a straight-forward IP 
>> assignment so that OldNetworkTopology (rackinferring snitch) works well.    
>> We have cassandra clients written in Hector in each of those data centers.   
>> The Hector clients all have a list of all cassandra nodes across both data 
>> centers.  RF=3.
>>
>> Is there an order as to which data center gets the first write?    In other 
>> words, would (or can) the Hector client do its first write to the cassandra 
>> nodes in its own data center?
>>
>> It would be ideal it Hector chose the "local" cassandra nodes.  That way, if 
>> one data center is unreachable, the Quorum of replicas in cassandra is still 
>> reached (because it was written to the working data center first).
>>
>> Otherwise, if the cassandra writes are really random from the Hector client 
>> point-of-view, a data center outage would result in a read failure for any 
>> data that has 2 replicas in the lost data center.
>>
>> Is anyone doing this?  Is there a flaw in my logic?
>>
>>
>
>


unsubscribe

2011-03-24 Thread Mohamed Ibrahim



Re: Why disc access mode conf parameter deleted from yaml in cassandra 0.7 brunch,

2011-03-24 Thread Jonathan Ellis
You can still set it, but it's removed from the example because every
time we've seen someone change it, they were changing it because of
confused ideas of how mmap works rather than actual performance
problems.

On Thu, Mar 24, 2011 at 4:27 AM, ruslan usifov  wrote:
> mmap which will be set default on 64 bit platforms works badly (i don't know
> reason why this happens but this is happens on 4 machines in my case so i
> don't think that it is hardware problems)
>



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


unsubscribe

2011-03-24 Thread Mohamed Ibrahim
unsubscribe


Re: result of get_indexed_slices() seems wrong

2011-03-24 Thread Jonathan Ellis
it's unusual but valid to have an expression on a column w/ no metadata.

2011/3/24 Wangpei (Peter) :
> Thanks aaron.
>
> Maybe we need to do more check at ThriftValidation.validateIndexClauses(),
> add this:
>
> Map colDefs =
> DatabaseDescriptor.getTableDefinition(keyspace).cfMetaData().get(columnFamily).getColumn_metadata();
>
> for (IndexExpression expression : index_clause.expressions)
>
> {
>
> if (!colDefs.containsKey(expression.column_name))
>
> throw new InvalidRequestException("No column definition for
> " + expression.column_name);
>
> }
>
>
>
>
>
> 发件人: aaron morton [mailto:aa...@thelastpickle.com]
> 发送时间: 2011年3月24日 12:24
> 收件人: user@cassandra.apache.org
> 主题: Re: result of get_indexed_slices() seems wrong
>
>
>
> Looks like this https://issues.apache.org/jira/browse/CASSANDRA-2347
>
>
>
> From this
> discussion http://www.mail-archive.com/user@cassandra.apache.org/msg11291.html
>
>
>
>
>
> Aaron
>
>
>
> On 24 Mar 2011, at 17:17, Wangpei (Peter) wrote:
>
> Hi,
>
>
>
> This problem occurs when the clause has multi expression and a expression
> with operator other than EQ.
>
> Is anyone meet the same problem?
>
>
>
> I trace the code, and seen this at ColumnFamilyStore.satisfies() method:
>
> int v = data.getComparator().compare(column.value(),
> expression.value);
>
> It seems when I need the type of column value here, it use the type of my
> column names which is UTF8Type, so give the wrong result.
>
> To fix it, the expression needs a optional "comparator_type" attribute, then
> satisfies() can get the correct type to compare.
>
> pls point out if I am wrong.
>
>
>
>
>
>



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


Re: error connecting to cassandra 0.7.3

2011-03-24 Thread Anurag Gujral
Hi Ruslan
where is this framed transport defined.
I  did TProtocol proto = new TFramedTransport(tr);

I am getting
annot find symbol
[javac] symbol  : class TFramedTransport
Please Suggest
Thanks
Anurag
On Thu, Mar 24, 2011 at 2:13 AM, ruslan usifov wrote:

> and where is transport creation for your thrift interface? Cassandra 0.7
> uses Framed transport as default
>
>
> 2011/3/24 Anurag Gujral 
>
>>
>> I am using the following code to create my client.
>>
>>  tr = new TSocket(url, port);
>> TProtocol proto = new TBinaryProtocol(tr);
>>  client = new Cassandra.Client(proto);
>>   client.set_keyspace(this.keyspace);
>>
>> I am getting the errors I mentioned below
>> Thanks
>> Anurag
>>
>>
>> -- Forwarded message --
>> From: Anurag Gujral 
>> Date: Thu, Mar 24, 2011 at 1:26 AM
>> Subject: error connecting to cassandra 0.7.3
>> To: user@cassandra.apache.org
>>
>>
>> I am using cassandra-0.7.3 and thrift-0.0.5,I wrote a java client using
>> thrift 0.0.5 when I try to connect to
>> local cassandra server I get the following error
>> ERROR com.bluekai.cassandra.validation.ValidationThread  - Failed to
>> connect to 127.0.0.1.
>> org.apache.thrift.transport.TTransportException: Cannot write to null
>> outputStream
>>
>>
>> I am able to connect to the local cassandra server using cassandra-cli
>> though
>>
>> Any suggestions
>> Thanks
>> Anurag
>>
>>
>


Re: Column TTL Hook

2011-03-24 Thread Jonathan Ellis
No.

On Thu, Mar 24, 2011 at 8:50 AM, Or Yanay  wrote:
> Hi all,
>
> Is there any way for me to save or pass the columns retired by the column
> TTL?
>
> I understand that compaction takes care of removing expired columns, I would
> like to know the keys for which columns have expired.
>
>
>
> Thanks,
>
> -Orr



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


Re: Clearsnapshot Problem

2011-03-24 Thread s p
Sounds good. I'll open a ticket. As far as the workaround goes I use:
(a)Flush on the node, (b) copy the database files to backup location.

I tested the backup files in my 3-node cluster (RF=3). (a).Took one node
down(simulated crash. Ip, name key range stays the same). (b) Erased all
keyspace folders and commit log. (c)Copied application related backup files.
(d) Started the node. (e) Ran repair.


Thanks, Stephan



On Tue, Mar 22, 2011 at 4:40 PM, aaron morton wrote:

> AFAIK upgrade from 0.6.2 to 0.6.12 should be a straight forward rolling
> restart. Do check the changes.txt file first and if you have a test env test
> it there. (The large gap in versions makes me a little nervous).
>
> If you feel it's reproducible (even sometimes) can you create a jira ticket
> ?  https://issues.apache.org/jira/browse/CASSANDRA
>
> Windows gets less loving than *nix so any help is appreciated.
>
> Thanks
> Aaron
>
>
>
> On 23 Mar 2011, at 06:48, s p wrote:
>
> Thanks. The problem is intermittent meaning we have separate CA cluster
> environments: In some cases there is no problem running a snapshot followed
> by a later clear snapshot (or for that matter physical delete of the
> snapshot file).
> When I stop Cassandra the snapshot file can be deleted. As soon as
> Cassandra is started the file is locked.
>
> While testing the above I monitored things with sysinternals (Handle,
> ProcessExplorer, ProcMon). None of them show any open file handles/locks.
>
> Am I missing something? I see you suggestion going to 0.6.12. Can the
> existing cluster (0.6.2) be upgraded node by node?
>
> -S
>
> On Mon, Mar 21, 2011 at 11:45 PM, aaron morton wrote:
>
>> There have been some issues to with deleting files on windows, cannot find
>> a reference to it happening for snapshots.
>>
>> If you restart the node can you delete the snapshot?
>>
>> Longer term can you upgrade to 0.6.12 and let us know if it happens again?
>> Any fix will be against that version.
>>
>> Hope that helps.
>> Aaron
>>
>>
>> On 22 Mar 2011, at 08:11, s p wrote:
>>
>> > I'm running 3-way CA cluster (0.62 ) on a windows 2008 (jre 1.6.24)
>> 64-bit. Things are running fine except when trying to remove old snaphsot
>> files. When running clearsnapshot I get an error msg like below.  I can't
>> remove any daily snapshot files. When trying to delete the actual snapshot
>> file os cmd file I get "access denied. File used by another process". Seems
>> CA or JRE is sitting on file?
>> >
>> > Feedback much appreciated.
>> >
>> >
>> > C:\Cassandra\
>> > Exception in thread "main" java.io.IOException: Failed to delete
>> c:\cassandra\da
>> >
>> ta\data\ks_SnapshotTest\snapshots\1300731301822-ks_SnapshotTest\cf_SnapshotTest-135-Data.db
>> > at
>> org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.ja
>> > va:47)
>> > at
>> org.apache.cassandra.io.util.FileUtils.deleteDir(FileUtils.java:189)
>> > at
>> org.apache.cassandra.io.util.FileUtils.deleteDir(FileUtils.java:184)
>> > at
>> org.apache.cassandra.io.util.FileUtils.deleteDir(FileUtils.java:184)
>> > at org.apache.cassandra.db.Table.clearSnapshot(Table.java:274)
>> > at
>> org.apache.cassandra.service.StorageService.clearSnapshot(StorageServ
>> > ice.java:1023)
>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>> > at java.lang.reflect.Method.invoke(Unknown Source)
>> > at
>> com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(Unknown So
>> > urce)
>> > at
>> com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(Unknown So
>> > urce)
>> > at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(Unknown
>> Source)
>> > at com.sun.jmx.mbeanserver.PerInterface.invoke(Unknown Source)
>> > at com.sun.jmx.mbeanserver.MBeanSupport.invoke(Unknown Source)
>> > at
>> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown
>> > Source)
>> > at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
>> > at
>> javax.management.remote.rmi.RMIConnectionImpl.doOperation(Unknown Sou
>> > rce)
>> > at
>> javax.management.remote.rmi.RMIConnectionImpl.access$200(Unknown Sour
>> > ce)
>> > at
>> javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run
>> > (Unknown Source)
>> > at
>> javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(U
>> > nknown Source)
>> > at javax.management.remote.rmi.RMIConnectionImpl.invoke(Unknown
>> Source)
>> > at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
>> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>> > at java.lang.reflect.Method.invoke(Unknown Source)
>> > at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
>> > a

Re: error connecting to cassandra 0.7.3

2011-03-24 Thread Anurag Gujral
Hi All,
  I am using the following code as per suggestion by Ruslan
   tr = new TSocket(url, port,timeout);
   TTransport transport= new TFramedTransport(tr);
TProtocol proto = new TBinaryProtocol(transport);
client = new Cassandra.Client(proto);
client.set_keyspace(this.keyspace);

But I am getting the error

at
org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:142)
at
org.apache.thrift.transport.TFramedTransport.flush(TFramedTransport.java:156)
at
org.apache.cassandra.thrift.Cassandra$Client.send_set_keyspace(Cassandra.java:414)
at
org.apache.cassandra.thrift.Cassandra$Client.set_keyspace(Cassandra.java:403)
Please suggest why is this an error
Thanks
Anurag

On Thu, Mar 24, 2011 at 7:15 AM, Anurag Gujral wrote:

> Hi Ruslan
> where is this framed transport defined.
> I  did TProtocol proto = new TFramedTransport(tr);
>
> I am getting
> annot find symbol
> [javac] symbol  : class TFramedTransport
> Please Suggest
> Thanks
> Anurag
>
> On Thu, Mar 24, 2011 at 2:13 AM, ruslan usifov wrote:
>
>> and where is transport creation for your thrift interface? Cassandra 0.7
>> uses Framed transport as default
>>
>>
>> 2011/3/24 Anurag Gujral 
>>
>>>
>>> I am using the following code to create my client.
>>>
>>>  tr = new TSocket(url, port);
>>> TProtocol proto = new TBinaryProtocol(tr);
>>>  client = new Cassandra.Client(proto);
>>>   client.set_keyspace(this.keyspace);
>>>
>>> I am getting the errors I mentioned below
>>> Thanks
>>> Anurag
>>>
>>>
>>> -- Forwarded message --
>>> From: Anurag Gujral 
>>> Date: Thu, Mar 24, 2011 at 1:26 AM
>>> Subject: error connecting to cassandra 0.7.3
>>> To: user@cassandra.apache.org
>>>
>>>
>>> I am using cassandra-0.7.3 and thrift-0.0.5,I wrote a java client using
>>> thrift 0.0.5 when I try to connect to
>>> local cassandra server I get the following error
>>> ERROR com.bluekai.cassandra.validation.ValidationThread  - Failed to
>>> connect to 127.0.0.1.
>>> org.apache.thrift.transport.TTransportException: Cannot write to null
>>> outputStream
>>>
>>>
>>> I am able to connect to the local cassandra server using cassandra-cli
>>> though
>>>
>>> Any suggestions
>>> Thanks
>>> Anurag
>>>
>>>
>>
>


Re: unsubscribe

2011-03-24 Thread Brandon Williams
On Thu, Mar 24, 2011 at 9:11 AM, Mohamed Ibrahim  wrote:

> unsubscribe


http://bit.ly/ho9zoY

http://wiki.apache.org/cassandra/FAQ#unsubscribe


WriteMultiColumns just write one column ... amazing!

2011-03-24 Thread cbert...@libero.it
Hi all,
I'm almost sure I'm just tired and I am doing something stupid however I can't 
understand this problem.
In one Super Column Family I have just 2 rows, called ALL and INCREMENTAL.

For some reason I sometimes need to duplicate a SuperColumn from the row ALL 
to the INCREMENTAL one ... very easy 
(cassandra 0.7.4, java, pelops)

private static void mirrorizeEngineSuperColumn(Bytes superColumnId) {
Mutator mutator = Pelops.createMutator(SocialContext.POOL_NAME_VALUE);
Selector selector = Pelops.createSelector(SocialContext.
POOL_NAME_VALUE);
try {
SuperColumn sc = selector.getSuperColumnFromRow(MotoreFamily, 
SocialColumn.MOTORE_ALL_ROW, superColumnId, ConsistencyLevel.QUORUM);
LOG.debug("Column list size of supercolumn is " + sc.
getColumnsSize());
mutator.writeSubColumns(MotoreFamily, SocialColumn.
MOTORE_INCREMENTALI_ROW, superColumnId, sc.getColumns());
mutator.execute(ConsistencyLevel.QUORUM);
} catch (NotFoundException nfe) {
LOG.debug("Supercolumn not found ...");
} catch (Exception e) {
LOG.error(e.toString());
}
}

When I print it the column list size is exact (3, 4 it depends on which 
supercolumn I'm working) but when I write them I find only one column of this 
column list ... here is the output produced (viewing with cassandra cli ...) -- 
compare the 3 super_column in the row INCREMENTAL and you'll see they're 
different from the one in the row ALL

RowKey: ALL
=> (super_column=54b05120-552f-11e0-9d1f-020054554e01,
 (column=54fc9c60-552f-11e0-9d1f-020054554e01, value=0003, 
timestamp=1300872296917000)
 (column=746595b0-553f-11e0-9e66-020054554e01, value=0002, 
timestamp=1300879284037000)
 (column=6ec46ef0-5540-11e0-9e66-020054554e01, value=0004, 
timestamp=1300879641811000)
 (column=99d911d0-5541-11e0-af7b-020054554e01, value=0001, 
timestamp=1300880138869000))
=> (super_column=97351e20-5545-11e0-9464-001d72d09363,
 (column=9763cf40-5545-11e0-9464-001d72d09363, value=0004, 
timestamp=1300881876938000)
 (column=1e5b7a40-5549-11e0-8da1-020054554e01, value=0005, 
timestamp=1300883402593000)
 (column=89f7c3e0-560b-11e0-a6ac-020054554e01, value=0005, 
timestamp=1300966880883000))
=> (super_column=cadf5940-55ed-11e0-9b97-020054554e01,
 (column=cb03aa20-55ed-11e0-9b97-020054554e01, value=0004, 
timestamp=1300954178721000)
 (column=27092500-5609-11e0-b1f1-020054554e01, value=0004, 
timestamp=1300965858839000)
 (column=5cdf88d0-560a-11e0-a6ac-020054554e01, value=0005, 
timestamp=1300966438198000)
 (column=c6e34110-561c-11e0-9399-020054554e01, value=0005, 
timestamp=1300974305208000))
=> (super_column=309d66a0-5602-11e0-9cc8-020054554e01,
 (column=30d8e900-5602-11e0-9cc8-020054554e01, value=0005, 
timestamp=1300963602927000)
 (column=8c8a4f40-5603-11e0-9cc8-020054554e01, value=0005, 
timestamp=1300963728307000)
 (column=62246620-5606-11e0-9e06-020054554e01, value=0005, 
timestamp=1300964702748000)
 (column=db951080-561b-11e0-8880-020054554e01, value=0003, 
timestamp=1300973895462000))
=> (super_column=e44f1860-560c-11e0-b696-020054554e01,
 (column=e5045ea0-560c-11e0-b696-020054554e01, value=0005, 
timestamp=1300967480905000))
=> (super_column=e53d7000-560c-11e0-b696-020054554e01,
 (column=e56395a0-560c-11e0-b696-020054554e01, value=0005, 
timestamp=1300967620609000))
=> (super_column=90ce8370-5615-11e0-b696-020054554e01,
 (column=9100de10-5615-11e0-b696-020054554e01, value=0005, 
timestamp=1300971213814000)
 (column=a5171450-5615-11e0-b696-020054554e01, value=0005, 
timestamp=1300971294115000)
 (column=9fb68390-5617-11e0-9ed9-020054554e01, value=0002, 
timestamp=1300972093565000)
 (column=79889ed0-561a-11e0-bf27-020054554e01, value=0002, 
timestamp=130097330153))
---
RowKey: INCREMENTAL
=> (super_column=cadf5940-55ed-11e0-9b97-020054554e01,
 (column=c6e34110-561c-11e0-9399-020054554e01, value=0005, 
timestamp=1300974305208000))
=> (super_column=309d66a0-5602-11e0-9cc8-020054554e01,
 (column=db951080-561b-11e0-8880-020054554e01, value=0003, 
timestamp=1300973895462000))
=> (super_column=90ce8370-5615-11e0-b696-020054554e01,
 (column=9fb68390-5617-11e0-9ed9-020054554e01, value=0002, 
timestamp=1300972093565000))

I think I'm getting crazy!
TIA for any help

Best regards

Carlo


Re: error connecting to cassandra 0.7.3

2011-03-24 Thread Anurag Gujral
Hi All,
   I was able to resolve by making socket open.
Thanks
Anurag

On Thu, Mar 24, 2011 at 7:48 AM, Anurag Gujral wrote:

> Hi All,
>   I am using the following code as per suggestion by Ruslan
>tr = new TSocket(url, port,timeout);
>TTransport transport= new TFramedTransport(tr);
> TProtocol proto = new TBinaryProtocol(transport);
>
> client = new Cassandra.Client(proto);
> client.set_keyspace(this.keyspace);
>
> But I am getting the error
>
> at
> org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:142)
> at
> org.apache.thrift.transport.TFramedTransport.flush(TFramedTransport.java:156)
> at
> org.apache.cassandra.thrift.Cassandra$Client.send_set_keyspace(Cassandra.java:414)
> at
> org.apache.cassandra.thrift.Cassandra$Client.set_keyspace(Cassandra.java:403)
> Please suggest why is this an error
> Thanks
> Anurag
>
>
> On Thu, Mar 24, 2011 at 7:15 AM, Anurag Gujral wrote:
>
>> Hi Ruslan
>> where is this framed transport defined.
>> I  did TProtocol proto = new TFramedTransport(tr);
>>
>> I am getting
>> annot find symbol
>> [javac] symbol  : class TFramedTransport
>> Please Suggest
>> Thanks
>> Anurag
>>
>> On Thu, Mar 24, 2011 at 2:13 AM, ruslan usifov 
>> wrote:
>>
>>> and where is transport creation for your thrift interface? Cassandra 0.7
>>> uses Framed transport as default
>>>
>>>
>>> 2011/3/24 Anurag Gujral 
>>>

 I am using the following code to create my client.

  tr = new TSocket(url, port);
 TProtocol proto = new TBinaryProtocol(tr);
  client = new Cassandra.Client(proto);
   client.set_keyspace(this.keyspace);

 I am getting the errors I mentioned below
 Thanks
 Anurag


 -- Forwarded message --
 From: Anurag Gujral 
 Date: Thu, Mar 24, 2011 at 1:26 AM
 Subject: error connecting to cassandra 0.7.3
 To: user@cassandra.apache.org


 I am using cassandra-0.7.3 and thrift-0.0.5,I wrote a java client using
 thrift 0.0.5 when I try to connect to
 local cassandra server I get the following error
 ERROR com.bluekai.cassandra.validation.ValidationThread  - Failed to
 connect to 127.0.0.1.
 org.apache.thrift.transport.TTransportException: Cannot write to null
 outputStream


 I am able to connect to the local cassandra server using cassandra-cli
 though

 Any suggestions
 Thanks
 Anurag


>>>
>>
>


Re: Re: Quorum, Hector, and datacenter preference

2011-03-24 Thread jonathan . colby

Hi Nate -

That sounds really promising and I'm looking forward to trying that out.

My original question came up while thinking how to achieve quorum (with  
rf=3) with a loss of 1 of 2 data centers. My logic was that if you had 2  
replicas in the same data center where the client originally written to,  
then that client is guaranteed to be able to satisfy quorum, even if the  
other data center is unreachable.


But I think there is no way to guarantee where the first write is written  
to. That would be based on the token range, which could very well be in any  
data center.


Jon



On Mar 24, 2011 3:05pm, Nate McCall  wrote:

We have a load balancing policy which selects the host best on latency



and uses a Phi convict algorithm in a method similar to DynamicSnitch.



Using this policy, you would inherently get the closest replica



whenever possible as that would most likely be the best performing.





This policy is still in trunk and 0.7.0 tip. We should have a new



release out containing the above in the next few days.





On Thu, Mar 24, 2011 at 8:46 AM, Jonathan Colby



jonathan.co...@gmail.com> wrote:


> Indeed I found the big flaw in my own logic. Even writing to  
the "local" cassandra nodes does not guarantee where the replicas will  
end up. The decision where to write the first replica is based on the  
token ring, which is spread out on all nodes regardless of datacenter.  
right ?



>



> On Mar 24, 2011, at 2:02 PM, Jonathan Colby wrote:



>



>> Hi -



>>


>> Our cluster is spread between 2 datacenters. We have a  
straight-forward IP assignment so that OldNetworkTopology (rackinferring  
snitch) works well. We have cassandra clients written in Hector in each  
of those data centers. The Hector clients all have a list of all  
cassandra nodes across both data centers. RF=3.



>>


>> Is there an order as to which data center gets the first write? In  
other words, would (or can) the Hector client do its first write to the  
cassandra nodes in its own data center?



>>


>> It would be ideal it Hector chose the "local" cassandra nodes. That  
way, if one data center is unreachable, the Quorum of replicas in  
cassandra is still reached (because it was written to the working data  
center first).



>>


>> Otherwise, if the cassandra writes are really random from the Hector  
client point-of-view, a data center outage would result in a read failure  
for any data that has 2 replicas in the lost data center.



>>



>> Is anyone doing this? Is there a flaw in my logic?



>>



>>



>



>




access.properties

2011-03-24 Thread Hayden Andrews
Hi ya,

I'm few days into the Cassandra experience and this is my first message
here :)

I've set up a dev instance of Cassandra and have got logins and access
working. Well, I thought I did, but I have found that my user that can add
and remove column families, can not insert or get the rows.

I really hope that I do not have to edit the access file to set
permissions for every user for every column family. I would like users to
either be able to update the keyspace (including any and all column
families) or only have read-only access to everything.

Since column families can be added and removed from a client app, it would
be really painfully hacky to have to write a script to update the access
file every time the client app adds or removes column families!

Anyway, some parts of my config files and a test below,


Cheers,

Hayden

Cassandra v0.7.4

cassandra.yaml:
authenticator: org.apache.cassandra.auth.SimpleAuthenticator
authority: org.apache.cassandra.auth.SimpleAuthority

access.properties:
=hayden
test.=hayden
test.=other,users

Now, if I login, using the cassandra-cli program, and attach to the
keyspace and then ...

[hayden@test] describe keyspace;

Keyspace: test:
  Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
Replication Factor: 1
  Column Families:

[hayden@test] create column family potato;
[hayden@test] describe keyspace;

Keyspace: test:
  Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
Replication Factor: 1
  Column Families:
ColumnFamily: potato
  Columns sorted by: org.apache.cassandra.db.marshal.BytesType
  Row cache size / save period: 0.0/0
  Key cache size / save period: 20.0/14400
  Memtable thresholds: 0.056244/12/1440
  GC grace seconds: 864000
  Compaction min/max thresholds: 4/32
  Read repair chance: 1.0
  Built indexes: []

[hayden@test] list potato;

# does not have permission READ for
/cassandra/keyspaces/test/potato



Cassandra apt repository gives 403 forbidden

2011-03-24 Thread Luke Biddell
I'm having trouble accessing the apt repository.

I get:

W: Failed to fetch
http://www.apache.org/dist/cassandra/debian/dists/unstable/main/binary-i386/Packages.gz
403  Forbidden

Anyone else having the same problem?


R: WriteMultiColumns just write one column ... amazing!

2011-03-24 Thread cbert...@libero.it
I answer myself :)
But i put the answer here maybe is useful for someone in future.
The problem was in the Timestamp, if you "copy" a column from another row but 
you don't change the timestamp then it will be written only if in the past, a 
column with the same name (key) has not been erased after the set timestamp.

Best regards

Carlo

>Messaggio originale
>Da: cbert...@libero.it
>Data: 24/03/2011 16.03
>A: 
>Ogg: WriteMultiColumns just write one column ... amazing!
>
>Hi all,
>I'm almost sure I'm just tired and I am doing something stupid however I 
can't 
>understand this problem.
>In one Super Column Family I have just 2 rows, called ALL and INCREMENTAL.
>
>For some reason I sometimes need to duplicate a SuperColumn from the row ALL 
>to the INCREMENTAL one ... very easy 
>(cassandra 0.7.4, java, pelops)
>
>private static void mirrorizeEngineSuperColumn(Bytes superColumnId) {
>Mutator mutator = Pelops.createMutator(SocialContext.
POOL_NAME_VALUE);
>Selector selector = Pelops.createSelector(SocialContext.
>POOL_NAME_VALUE);
>try {
>SuperColumn sc = selector.getSuperColumnFromRow(MotoreFamily, 
>SocialColumn.MOTORE_ALL_ROW, superColumnId, ConsistencyLevel.QUORUM);
>LOG.debug("Column list size of supercolumn is " + sc.
>getColumnsSize());
>mutator.writeSubColumns(MotoreFamily, SocialColumn.
>MOTORE_INCREMENTALI_ROW, superColumnId, sc.getColumns());
>mutator.execute(ConsistencyLevel.QUORUM);
>} catch (NotFoundException nfe) {
>LOG.debug("Supercolumn not found ...");
>} catch (Exception e) {
>LOG.error(e.toString());
>}
>}
>
>When I print it the column list size is exact (3, 4 it depends on which 
>supercolumn I'm working) but when I write them I find only one column of 
this 
>column list ... here is the output produced (viewing with cassandra cli ...) 
-- 
>compare the 3 super_column in the row INCREMENTAL and you'll see they're 
>different from the one in the row ALL
>
>RowKey: ALL
>=> (super_column=54b05120-552f-11e0-9d1f-020054554e01,
> (column=54fc9c60-552f-11e0-9d1f-020054554e01, value=0003, 
>timestamp=1300872296917000)
> (column=746595b0-553f-11e0-9e66-020054554e01, value=0002, 
>timestamp=1300879284037000)
> (column=6ec46ef0-5540-11e0-9e66-020054554e01, value=0004, 
>timestamp=1300879641811000)
> (column=99d911d0-5541-11e0-af7b-020054554e01, value=0001, 
>timestamp=1300880138869000))
>=> (super_column=97351e20-5545-11e0-9464-001d72d09363,
> (column=9763cf40-5545-11e0-9464-001d72d09363, value=0004, 
>timestamp=1300881876938000)
> (column=1e5b7a40-5549-11e0-8da1-020054554e01, value=0005, 
>timestamp=1300883402593000)
> (column=89f7c3e0-560b-11e0-a6ac-020054554e01, value=0005, 
>timestamp=1300966880883000))
>=> (super_column=cadf5940-55ed-11e0-9b97-020054554e01,
> (column=cb03aa20-55ed-11e0-9b97-020054554e01, value=0004, 
>timestamp=1300954178721000)
> (column=27092500-5609-11e0-b1f1-020054554e01, value=0004, 
>timestamp=1300965858839000)
> (column=5cdf88d0-560a-11e0-a6ac-020054554e01, value=0005, 
>timestamp=1300966438198000)
> (column=c6e34110-561c-11e0-9399-020054554e01, value=0005, 
>timestamp=1300974305208000))
>=> (super_column=309d66a0-5602-11e0-9cc8-020054554e01,
> (column=30d8e900-5602-11e0-9cc8-020054554e01, value=0005, 
>timestamp=1300963602927000)
> (column=8c8a4f40-5603-11e0-9cc8-020054554e01, value=0005, 
>timestamp=1300963728307000)
> (column=62246620-5606-11e0-9e06-020054554e01, value=0005, 
>timestamp=1300964702748000)
> (column=db951080-561b-11e0-8880-020054554e01, value=0003, 
>timestamp=1300973895462000))
>=> (super_column=e44f1860-560c-11e0-b696-020054554e01,
> (column=e5045ea0-560c-11e0-b696-020054554e01, value=0005, 
>timestamp=1300967480905000))
>=> (super_column=e53d7000-560c-11e0-b696-020054554e01,
> (column=e56395a0-560c-11e0-b696-020054554e01, value=0005, 
>timestamp=1300967620609000))
>=> (super_column=90ce8370-5615-11e0-b696-020054554e01,
> (column=9100de10-5615-11e0-b696-020054554e01, value=0005, 
>timestamp=1300971213814000)
> (column=a5171450-5615-11e0-b696-020054554e01, value=0005, 
>timestamp=1300971294115000)
> (column=9fb68390-5617-11e0-9ed9-020054554e01, value=0002, 
>timestamp=1300972093565000)
> (column=79889ed0-561a-11e0-bf27-020054554e01, value=0002, 
>timestamp=130097330153))
>---
>RowKey: INCREMENTAL
>=> (super_column=cadf5940-55ed-11e0-9b97-020054554e01,
> (column=c6e34110-561c-11e0-9399-020054554e01, value=0005, 
>timestamp=1300974305208000))
>=> (super_column=309d66a0-5602-11e0-9cc8-020054554e01,
> (column=db951080-561b-11e0-8880-020054554e01, value=0003, 
>timestamp=1300973895462000))
>=> (super_column=90ce8370-5615-11e0-b696-020054554e01,
> (column=9fb68390-5617-11e0-9ed9-020054554e01, value=0002, 
>timestamp

Re: Cassandra apt repository gives 403 forbidden

2011-03-24 Thread Brandon Williams
https://issues.apache.org/jira/browse/CASSANDRA-2370

On Thu, Mar 24, 2011 at 11:53 AM, Luke Biddell wrote:

>
> I'm having trouble accessing the apt repository.
>
> I get:
>
> W: Failed to fetch
> http://www.apache.org/dist/cassandra/debian/dists/unstable/main/binary-i386/Packages.gz
>  403  Forbidden
>
> Anyone else having the same problem?
>
>


pig counting question

2011-03-24 Thread Jeffrey Wang
Hey all,

I'm trying to run a very simple Pig script against my Cassandra cluster (5 
nodes, 0.7.3). I've gotten it all set up and working, but the script is giving 
me some strange results. Here is my script:

rows = LOAD 'cassandra://Keyspace/ColumnFamily' USING CassandraStorage();
rowct = FOREACH rows GENERATE $0, COUNT($1);
dump rowct;

If I understand Pig correctly, this should output (row name, column count) 
tuples, but I'm always seeing 1024 for the column count even though the rows 
have highly variable number of columns. Am I missing something? Thanks.

-Jeffrey



Re: pig counting question

2011-03-24 Thread Jeremy Hanna
The limit defaults to 1024 but you can set it when you use CassandraStorage in 
pig, like so:
rows = LOAD 'cassandra://Keyspace/ColumnFamily' USING CassandraStorage(4096);
or whatever value you wish.

Give that a try and see if it gives you more of what you're looking for.

On Mar 24, 2011, at 1:16 PM, Jeffrey Wang wrote:

> Hey all,
>  
> I’m trying to run a very simple Pig script against my Cassandra cluster (5 
> nodes, 0.7.3). I’ve gotten it all set up and working, but the script is 
> giving me some strange results. Here is my script:
>  
> rows = LOAD 'cassandra://Keyspace/ColumnFamily' USING CassandraStorage();
> rowct = FOREACH rows GENERATE $0, COUNT($1);
> dump rowct;
>  
> If I understand Pig correctly, this should output (row name, column count) 
> tuples, but I’m always seeing 1024 for the column count even though the rows 
> have highly variable number of columns. Am I missing something? Thanks.
>  
> -Jeffrey
>  



Central monitoring of Cassandra cluster

2011-03-24 Thread mcasandra
Can someone share if they have centralized monitoring for all cassandra
servers. With many nodes it becomes difficult to monitor them individually
unless we can look at data in one place. I am looking at solutions where
this can be done. Looking at Cacti currently but not sure how to integrate
it with JMX.

--
View this message in context: 
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Central-monitoring-of-Cassandra-cluster-tp6205275p6205275.html
Sent from the cassandra-u...@incubator.apache.org mailing list archive at 
Nabble.com.


Re: Central monitoring of Cassandra cluster

2011-03-24 Thread vineet daniel
...in process of using nagios to monitor three servers. Will post updates
shortly.
Regards
Vineet Daniel
Cell  : +918106217121
Websites :
Blog    |
Linkedin
|  Twitter 




On Fri, Mar 25, 2011 at 12:14 AM, mcasandra  wrote:

> Can someone share if they have centralized monitoring for all cassandra
> servers. With many nodes it becomes difficult to monitor them individually
> unless we can look at data in one place. I am looking at solutions where
> this can be done. Looking at Cacti currently but not sure how to integrate
> it with JMX.
>
> --
> View this message in context:
> http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Central-monitoring-of-Cassandra-cluster-tp6205275p6205275.html
> Sent from the cassandra-u...@incubator.apache.org mailing list archive at
> Nabble.com.
>


RE: Central monitoring of Cassandra cluster

2011-03-24 Thread Gregory Szorc
We have Collectd (http://www.collectd.org/) monitoring Cassandra via its 
Java/JMX plugin. Collectd feeds data to a central Graphite/Carbon 
(http://graphite.wikidot.com/start) instance via 
https://github.com/indygreg/collectd-carbon . With Graphite, you can 
effortlessly utilize the web UI (or HTTP API) to build and save graph 
definitions that sum/display/etc related values over the whole cluster. You can 
also utilize Graphite's HTTP API to export raw data. Your monitoring 
infrastructure could then poll this for alerting.

I have a script that parses a storage-conf.xml file into a Collectd config 
snippet. But, I don't have that posted in public domain at the moment. In lieu 
of that, here are some samples that work with Cassandra 0.6.12:

Add the following to a Collectd types file:

cassandra_pool   active:GAUGE:0:U, pending:GAUGE:0:U, 
completed:COUNTER:0:U
cassandra_stage  active:GAUGE:0:2147483648, 
pending:GAUGE:0:2147483648, completed:COUNTER:0:U
cassandra_cf_cache   rcnt_hit_rate:GAUGE:0:1, size:GAUGE:0:2147483648, 
capacity:GAUGE:0:2147483648, hits:COUNTER:0:U, requests:COUNTER:0:U
cassandra_cf_store   pending_tasks:GAUGE:0:2147483648, 
min_row_size:GAUGE:0:U, max_row_size:GAUGE:0:U, mean_row_size:GAUGE:0:U, 
memtbl_col_cnt:GAUGE:0:U, memtbl_data_size:GAUGE:0:U, 
memtbl_switch_cnt:COUNTER:0:U, read_cnt:COUNTER:0:U, 
rcnt_rd_latency:GAUGE:0:2147483648, tot_rd_latency:COUNTER:0:U, 
write_cnt:COUNTER:0:U, rcnt_wr_latency:GAUGE:0:2147483648, 
tot_wr_latency:COUNTER:0:U, disk_used_total:GAUGE:0:U, 
disk_used_live:GAUGE:0:U, ss_table_count:GAUGE:0:100, 
bloom_false_pos:COUNTER:0:U, bloom_rcnt_f_ratio:GAUGE:0:1, 
bloom_false_ratio:GAUGE:0:1
cassandra_compaction_manager pending:GAUGE:0:U, bytes_in_progress:GAUGE:0:U, 
bytes_compacted:GAUGE:0:U
cassandra_storage_proxy  rcnt_rd_latency:GAUGE:0:2147483648, 
tot_rd_latency:COUNTER:0:U, rcnt_wr_latency:GAUGE:0:2147483648, 
tot_wr_latency:COUNTER:0:U, read_operations:COUNTER:0:U, 
range_operations:COUNTER:0:U tot_rg_latency:COUNTER:0:U 
rcnt_rg_latency:GAUGE:0:2147483648 write_operations:COUNTER:0:U

(The weird names are due to a character length limitation in Collectd, which 
enforces the restrictions of RRD, since it uses that out of the box.)

And add the following to your Collectd config file:


JVMArg 
"-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar"
LoadPlugin "org.collectd.java.GenericJMX"




ObjectName "org.apache.cassandra.concurrent:type=ROW-READ-STAGE"
InstancePrefix "cassandra_row_read_stage"

Type "cassandra_stage"
Attribute "ActiveCount"
Attribute "PendingTasks"
Attribute "CompletedTasks"


   

ObjectName 
"org.apache.cassandra.db:columnfamily=Foo,keyspace=KeySpace,type=ColumnFamilyStores"
InstancePrefix "cassandra_cf_foo"

Type "cassandra_cf_store"
Attribute "PendingTasks"
Attribute "MinRowCompactedSize"
Attribute "MaxRowCompactedSize"
Attribute "MeanRowCompactedSize"
Attribute "MemtableColumnsCount"
Attribute "MemtableDataSize"
Attribute "MemtableSwitchCount"
Attribute "ReadCount"
Attribute "RecentReadLatencyMicros"
Attribute "TotalReadLatencyMicros"
Attribute "WriteCount"
Attribute "RecentWriteLatencyMicros"
Attribute "TotalWriteLatencyMicros"
Attribute "TotalDiskSpaceUsed"
Attribute "LiveDiskSpaceUsed"
Attribute "LiveSSTableCount"
Attribute "BloomFilterFalsePositives"
Attribute "RecentBloomFilterFalseRatio"
Attribute "BloomFilterFalseRatio"


  
  
Host "cassandra"
Collect "cassandra-row-read-stage"
Collect "cassandra-cf-foo"
ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:8080/jmxrmi"




Greg

> -Original Message-
> From: mcasandra [mailto:mohitanch...@gmail.com]
> Sent: Thursday, March 24, 2011 11:45 AM
> To: cassandra-u...@incubator.apache.org
> Subject: Central monitoring of Cassandra cluster
> 
> Can someone share if they have centralized monitoring for all cassandra
> servers. With many nodes it becomes difficult to monitor them individually
> unless we can look at data in one place. I am looking at solutions where this
> can be done. Looking at Cacti currently but not sure how to integrate it with
> JMX.
> 
> --
> View this message in context: http://cassandra-user-incubator-apache-
> org.3065146.n2.nabble.com/Central-monitoring-of-Cassandra-cluster-
> tp6205275p6205275.html
> Sent from the cassandra-u...@incubator.apache.org

RE: Central monitoring of Cassandra cluster

2011-03-24 Thread Prasanna Jayapalan
We at Evident Software have ClearStone, a comprehensive JMX based
monitoring solution for Cassandra (and other NoSQL technologies). You can
get more details here
http://www.evidentsoftware.com/products/clearstone-for-cassandra/. You
should be able to connect to individual ndoes and also get an aggregated
view of you whole cluster. Check out the heatmaps to get holistic view of
all the nodes in your cluster

Prasanna Jayapalan ,  Senior Solution Consultant , Evident Software
-Original Message-
From: mcasandra [mailto:mohitanch...@gmail.com]
Sent: Thursday, March 24, 2011 2:45 PM
To: cassandra-u...@incubator.apache.org
Subject: Central monitoring of Cassandra cluster

Can someone share if they have centralized monitoring for all cassandra
servers. With many nodes it becomes difficult to monitor them individually
unless we can look at data in one place. I am looking at solutions where
this can be done. Looking at Cacti currently but not sure how to integrate
it with JMX.

--
View this message in context:
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Central-m
onitoring-of-Cassandra-cluster-tp6205275p6205275.html
Sent from the cassandra-u...@incubator.apache.org mailing list archive at
Nabble.com.


RE: Central monitoring of Cassandra cluster

2011-03-24 Thread Prasanna Jayapalan
Forgot to mention, you can use the product for free upto 10 Cassandra
nodes. We want every developer to use this as much as they want.

Prasanna

-Original Message-
From: Prasanna Jayapalan [mailto:pjayapa...@evidentsoftware.com]
Sent: Thursday, March 24, 2011 3:31 PM
To: user@cassandra.apache.org
Subject: RE: Central monitoring of Cassandra cluster

We at Evident Software have ClearStone, a comprehensive JMX based
monitoring solution for Cassandra (and other NoSQL technologies). You can
get more details here
http://www.evidentsoftware.com/products/clearstone-for-cassandra/. You
should be able to connect to individual ndoes and also get an aggregated
view of you whole cluster. Check out the heatmaps to get holistic view of
all the nodes in your cluster

Prasanna Jayapalan ,  Senior Solution Consultant , Evident Software
-Original Message-
From: mcasandra [mailto:mohitanch...@gmail.com]
Sent: Thursday, March 24, 2011 2:45 PM
To: cassandra-u...@incubator.apache.org
Subject: Central monitoring of Cassandra cluster

Can someone share if they have centralized monitoring for all cassandra
servers. With many nodes it becomes difficult to monitor them individually
unless we can look at data in one place. I am looking at solutions where
this can be done. Looking at Cacti currently but not sure how to integrate
it with JMX.

--
View this message in context:
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Central-m
onitoring-of-Cassandra-cluster-tp6205275p6205275.html
Sent from the cassandra-u...@incubator.apache.org mailing list archive at
Nabble.com.


Re: Re: Quorum, Hector, and datacenter preference

2011-03-24 Thread Patricio Echagüe
Doesn't CL=LOCAL_QUORUM solve your problem?

On Thu, Mar 24, 2011 at 9:33 AM,  wrote:

> Hi Nate -
>
> That sounds really promising and I'm looking forward to trying that out.
>
> My original question came up while thinking how to achieve quorum (with
> rf=3) with a loss of 1 of 2 data centers. My logic was that if you had 2
> replicas in the same data center where the client originally written to,
> then that client is guaranteed to be able to satisfy quorum, even if the
> other data center is unreachable.
>
> But I think there is no way to guarantee where the first write is written
> to. That would be based on the token range, which could very well be in any
> data center.
>
> Jon
>
>
>
>
> On Mar 24, 2011 3:05pm, Nate McCall  wrote:
> > We have a load balancing policy which selects the host best on latency
> >
> > and uses a Phi convict algorithm in a method similar to DynamicSnitch.
> >
> > Using this policy, you would inherently get the closest replica
> >
> > whenever possible as that would most likely be the best performing.
> >
> >
> >
> > This policy is still in trunk and 0.7.0 tip. We should have a new
> >
> > release out containing the above in the next few days.
> >
> >
> >
> > On Thu, Mar 24, 2011 at 8:46 AM, Jonathan Colby
> >
> > jonathan.co...@gmail.com> wrote:
> >
> > > Indeed I found the big flaw in my own logic.   Even writing to the
> "local" cassandra nodes does not guarantee where the replicas will end up.
> The decision where to write the first replica is based on the token ring,
> which is spread out on all nodes regardless of datacenter.   right ?
> >
> > >
> >
> > > On Mar 24, 2011, at 2:02 PM, Jonathan Colby wrote:
> >
> > >
> >
> > >> Hi -
> >
> > >>
> >
> > >> Our cluster is spread between 2 datacenters.   We have a
> straight-forward IP assignment so that OldNetworkTopology (rackinferring
> snitch) works well.We have cassandra clients written in Hector in each
> of those data centers.   The Hector clients all have a list of all cassandra
> nodes across both data centers.  RF=3.
> >
> > >>
> >
> > >> Is there an order as to which data center gets the first write?In
> other words, would (or can) the Hector client do its first write to the
> cassandra nodes in its own data center?
> >
> > >>
> >
> > >> It would be ideal it Hector chose the "local" cassandra nodes.  That
> way, if one data center is unreachable, the Quorum of replicas in cassandra
> is still reached (because it was written to the working data center first).
> >
> > >>
> >
> > >> Otherwise, if the cassandra writes are really random from the Hector
> client point-of-view, a data center outage would result in a read failure
> for any data that has 2 replicas in the lost data center.
> >
> > >>
> >
> > >> Is anyone doing this?  Is there a flaw in my logic?
> >
> > >>
> >
> > >>
> >
> > >
> >
> > >
> >
>


Re: log4j settings inquiry

2011-03-24 Thread aaron morton
Just checking the obvious thing, are you running cassandra or cassandra.bat ? 
(cannot imagine you would even get as far as you did but I like asking 
questions).

It's all a bit strange because the code in 0.7.4 will throw some errors if it 
cannot resolve a path to load the config from. 

You can hard code the log config path by modifying the line 
 -Dlog4j.configuration=log4j-server.properties^

in cassandra.bat and specifying a path using the file:// protocol 

Hope that helps. 
Aaron

On 24 Mar 2011, at 19:40, david lee wrote:

> hi,
> i'm trying to run cassandra 0.7 on my windows machine,
> and i don't seem to be able to go beyond the warning message
> 
> C:\Program Files\Apache Software 
> Foundation\apache-cassandra-0.7.4\bin>cassandra
>  -f
> Starting Cassandra Server
> log4j:WARN No appenders could be found for logger 
> (org.apache.cassandra.service.
> AbstractCassandraDaemon).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more 
> in
> fo.
> 
> in my conf folder, i have log4j-server.properties which looks like 
> log4j.rootLogger=INFO,stdout,R
> 
> # stdout
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=%5p %d{HH:mm:ss,SSS} %m%n
> 
> # rolling log file
> log4j.appender.R=org.apache.log4j.RollingFileAppender
> log4j.appender.R.maxFileSize=20MB
> log4j.appender.R.maxBackupIndex=50
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> log4j.appender.R.layout.ConversionPattern=%5p [%t] %d{ISO8601} %F (line %L) 
> %m%n
> # Edit the next line to point to your logs directory
> log4j.appender.R.File=file:C:/var/log/cassandra/system.log
> 
> any help will be much appreciated.
> 
> thanx in advnace



Re: Configuration for large number of inserts

2011-03-24 Thread aaron morton
With only 2Gb heap you are pushing things a little, see 
http://wiki.apache.org/cassandra/MemtableThresholds for guidelines on how to 
estimate the size. 

- turn off key and column caches
- consider reducing the memtable ops, AFAIK throughput in MB calculates using 
the col values only. So if you have lots of small columns it will take a while 
to trigger. 
- check the min + max compaction settings sing JConsole or cassandra-cli. If 
compaction is disabled you should see "Compaction is currently disabled." 
logged at DEBUG level
- throttle your app to allow GC to catch up 

Hope that helps. 
Aaron

On 25 Mar 2011, at 00:17, Adam Briffett wrote:

> Hi,
> 
> When doing bulk inserts of data using Pelops (~1000 million rows,
> column counts varying from 1 - 100,000 but more skewed towards fewer
> columns), we're ultimately getting a server OOME using 0.7.4. I've
> attempted to follow other pointers on this issue (reducing threshold
> before memtables flushed to disk, increasing heap space), turned off
> compaction (although it seems to still be happening), and also tried
> reducing the value of index_interval to avoid using up space.
> 
> We're using a single box for this test with attached .yaml and a heap
> size of 2GB, we're also using a single keyspace and column family, the
> settings for which are below (we're creating it using Pelops rather
> than in the .yaml):
> 
> cf.column_type = "Standard";
> cf.comparator_type = "UTF8Type";
> cf.key_cache_size = 200d;
> cf.row_cache_size = 16d;
> cf.memtable_throughput_in_mb = 128;
> cf.memtable_operations_in_millions = 0.3;
> cf.min_compaction_threshold = 0;
> cf.max_compaction_threshold = 0;
> 
> One issue is that compaction still appears to be happening, as if I
> check using nodetool compactionstats there are minor compactions
> piling up (also these get into the thousands, it seems they're being
> created faster than they can be addressed)
> 
> Can anyone suggest anywhere we might be going wrong? As I say, at the
> present we're just looking to do a bulk insert, no read activity until
> the writes have completed.
> 
> Thanks in advance,
> 
> Adam
> 



Option for ordering columns by timestamp in CF

2011-03-24 Thread Narendra Sharma
Cassandra 0.7.4
Column names in my CF are of type byte[] but I want to order columns by
timestamp. What is the best way to achieve this? Does it make sense for
Cassandra to support ordering of columns by timestamp as option for a column
family irrespective of the column name type?

Thanks,
Naren


Re: access.properties

2011-03-24 Thread Benjamin Coverston

Hi Hayden,

What you are describing certainly seems useful. I am not aware of anyone 
using the security features of the SimpleAuthenticator anywhere in 
production. If you have a real world use case and would like to see the 
authenticator improved please open a JIRA ticket. If you have something 
specific in mind please contribute!


Thanks,
Ben

On 3/24/11 10:52 AM, Hayden Andrews wrote:

Hi ya,

I'm few days into the Cassandra experience and this is my first message
here :)

I've set up a dev instance of Cassandra and have got logins and access
working. Well, I thought I did, but I have found that my user that can add
and remove column families, can not insert or get the rows.

I really hope that I do not have to edit the access file to set
permissions for every user for every column family. I would like users to
either be able to update the keyspace (including any and all column
families) or only have read-only access to everything.

Since column families can be added and removed from a client app, it would
be really painfully hacky to have to write a script to update the access
file every time the client app adds or removes column families!

Anyway, some parts of my config files and a test below,


Cheers,

Hayden

Cassandra v0.7.4

cassandra.yaml:
authenticator: org.apache.cassandra.auth.SimpleAuthenticator
authority: org.apache.cassandra.auth.SimpleAuthority

access.properties:
=hayden
test.=hayden
test.=other,users

Now, if I login, using the cassandra-cli program, and attach to the
keyspace and then ...

[hayden@test] describe keyspace;

Keyspace: test:
   Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
 Replication Factor: 1
   Column Families:

[hayden@test] create column family potato;
[hayden@test] describe keyspace;

Keyspace: test:
   Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
 Replication Factor: 1
   Column Families:
 ColumnFamily: potato
   Columns sorted by: org.apache.cassandra.db.marshal.BytesType
   Row cache size / save period: 0.0/0
   Key cache size / save period: 20.0/14400
   Memtable thresholds: 0.056244/12/1440
   GC grace seconds: 864000
   Compaction min/max thresholds: 4/32
   Read repair chance: 1.0
   Built indexes: []

[hayden@test] list potato;

#  does not have permission READ for
/cassandra/keyspaces/test/potato



--
Ben Coverston
DataStax -- The Apache Cassandra Company
http://www.datastax.com/



Re: Sizing a Cassandra cluster

2011-03-24 Thread aaron morton
Big old guess of something in the 1000's. 

Try benchmarking your work load and plug the numbers (my 5m is pretty high) 
in...

- 8 cores * 8 writers per core = 64 if each write request takes 5ms  = 1280 max 
per sec
- 1 spindle * 16 readers per spindle = 16 readers if each read request takes 
5ms =  320 max per sec
(reader and writer sizes from the help in conf/cassandra.yaml)

This is really just a guess, there are a lot more things going on in the system 
and it gets even more complicated once it's turned on. But I know sometimes you 
just need to show you've thought about it :)

Hope that helps.
Aaron

On 25 Mar 2011, at 02:27, Brian Fitzpatrick wrote:

> Thanks for the tips on the replication factor.  Any thoughts on the
> number of nodes in a cluster to support an RF=3 with a workload of 400
> ops/sec (4-8K sized rows, 50/50 read/write)?  Based on the "sweet
> spot" hardware referenced in the wiki (8-core, 16-32GB RAM), what kink
> of ops/sec could I reasonably expect from each node.  Just looking for
> a range to make some educated guesses.
> 
> Thanks,
> Brian
> 
> On Wed, Mar 23, 2011 at 9:04 PM, aaron morton  wrote:
>> It really does depend on what your workload is like, and in the end will
>> involve a certain amount of fudge factor.
>> 
>> http://wiki.apache.org/cassandra/CassandraHardware provides some guidance.
>> http://wiki.apache.org/cassandra/MemtableThresholds can be used to get a
>> rough idea of the memory requirements. Note that secondary indexes are also
>> CF's with the same memory settings as the parent.
>> With RF3 you can lose afford to lose one replica for a key a token range and
>> still be available (Assuming Quorum CL). With RF 5 you can lose 2 replicas
>> and still be available for the keys in the range.
>> I'm been careful to say "lose X replicas" because the other nodes in the
>> cluster don't count when considering an operation for a key. Two examples, 9
>> node cluster with RF3. If you lose nodes 2 and 3 and they are replicas for
>> node 1, Quorum operations on keys in the range for node 1 will fail (ranges
>> for 2 and 3 will be ok). If you lose nodes 2 and 5 Quorum operations will
>> succeed for all keys.
>> RF 3 is reasonable starting point for some redundancy, RF 5 is more. After
>> that it's Web Scale (tm).
>> Hope that helps
>> Aaron
>> 
>> On 24 Mar 2011, at 04:04, Brian Fitzpatrick wrote:
>> 
>> I'm going through the process of specing out the hardware for a
>> Cassandra cluster. The relevant specs:
>> 
>> - Support 460 operations/sec (50/50 read/write workload). Row size
>> ranges from 4 to 8K.
>> - Support 29 million objects for the first year
>> - Support 365 GB storage for the first year, based on Cassandra tests
>> (data + index + overhead * replication factor of 3)
>> 
>> I'm looking for advice on the node size for this cluster, recommended
>> RAM per node, and whether RF=3 seems to be a good choice for general
>> availability and resistance to failure.
>> 
>> I've looked at the YCSB benchmark paper and through the archives of
>> this email list looking for pointers.  I haven't found any general
>> guidelines on recommended cluster size to support X operations/sec
>> with Y data size at RF factor of Z, that I could extrapolate from.
>> 
>> Any and all recommendations appreciated.
>> 
>> Thanks,
>> Brian
>> 
>> 



RE: pig counting question

2011-03-24 Thread Jeffrey Wang
It looks like this functionality is not in the 0.7.3 version of 
CassandraStorage. I tried to add the constructor which takes the limit to the 
class, but I ran into some Pig parsing errors, so I had to make the parameter a 
string. How did you get around this for the version of CassandraStorage in 
trunk? I'm running Pig 0.8.0.

Also, when I bump the limit up very high (e.g. 1M columns), my Cassandra starts 
eating up huge amounts of memory, maxing out my 16GB heap size. I suspect this 
is because of the get_range_slices() call from ColumnFamilyRecordReader. Are 
there plans to make this streaming/paged?

-Jeffrey

-Original Message-
From: Jeremy Hanna [mailto:jeremy.hanna1...@gmail.com] 
Sent: Thursday, March 24, 2011 11:34 AM
To: user@cassandra.apache.org
Subject: Re: pig counting question

The limit defaults to 1024 but you can set it when you use CassandraStorage in 
pig, like so:
rows = LOAD 'cassandra://Keyspace/ColumnFamily' USING CassandraStorage(4096);
or whatever value you wish.

Give that a try and see if it gives you more of what you're looking for.

On Mar 24, 2011, at 1:16 PM, Jeffrey Wang wrote:

> Hey all,
>  
> I'm trying to run a very simple Pig script against my Cassandra cluster (5 
> nodes, 0.7.3). I've gotten it all set up and working, but the script is 
> giving me some strange results. Here is my script:
>  
> rows = LOAD 'cassandra://Keyspace/ColumnFamily' USING CassandraStorage();
> rowct = FOREACH rows GENERATE $0, COUNT($1);
> dump rowct;
>  
> If I understand Pig correctly, this should output (row name, column count) 
> tuples, but I'm always seeing 1024 for the column count even though the rows 
> have highly variable number of columns. Am I missing something? Thanks.
>  
> -Jeffrey
>  



Re: Central monitoring of Cassandra cluster

2011-03-24 Thread aaron morton
http://www.datastax.com/products/opscenter

https://www.cloudkick.com/features/monitoring

Aaron

On 25 Mar 2011, at 08:36, Prasanna Jayapalan wrote:

> Forgot to mention, you can use the product for free upto 10 Cassandra
> nodes. We want every developer to use this as much as they want.
> 
> Prasanna
> 
> -Original Message-
> From: Prasanna Jayapalan [mailto:pjayapa...@evidentsoftware.com]
> Sent: Thursday, March 24, 2011 3:31 PM
> To: user@cassandra.apache.org
> Subject: RE: Central monitoring of Cassandra cluster
> 
> We at Evident Software have ClearStone, a comprehensive JMX based
> monitoring solution for Cassandra (and other NoSQL technologies). You can
> get more details here
> http://www.evidentsoftware.com/products/clearstone-for-cassandra/. You
> should be able to connect to individual ndoes and also get an aggregated
> view of you whole cluster. Check out the heatmaps to get holistic view of
> all the nodes in your cluster
> 
> Prasanna Jayapalan ,  Senior Solution Consultant , Evident Software
> -Original Message-
> From: mcasandra [mailto:mohitanch...@gmail.com]
> Sent: Thursday, March 24, 2011 2:45 PM
> To: cassandra-u...@incubator.apache.org
> Subject: Central monitoring of Cassandra cluster
> 
> Can someone share if they have centralized monitoring for all cassandra
> servers. With many nodes it becomes difficult to monitor them individually
> unless we can look at data in one place. I am looking at solutions where
> this can be done. Looking at Cacti currently but not sure how to integrate
> it with JMX.
> 
> --
> View this message in context:
> http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Central-m
> onitoring-of-Cassandra-cluster-tp6205275p6205275.html
> Sent from the cassandra-u...@incubator.apache.org mailing list archive at
> Nabble.com.



Re: Sizing a Cassandra cluster

2011-03-24 Thread Jose Juarez-Comboni

Aaron,

How did you get to 1280 writes/sec? Counting 64 writers each taking 5ms for a 
write cycle, assuming real parallel access with no speed hits, I get 12,800 
writes/sec. Am I missing something?

From Jose's iPhone

On Mar 24, 2011, at 2:52 PM, aaron morton  wrote:

> Big old guess of something in the 1000's. 
> 
> Try benchmarking your work load and plug the numbers (my 5m is pretty high) 
> in...
> 
> - 8 cores * 8 writers per core = 64 if each write request takes 5ms  = 1280 
> max per sec
> - 1 spindle * 16 readers per spindle = 16 readers if each read request takes 
> 5ms =  320 max per sec
> (reader and writer sizes from the help in conf/cassandra.yaml)
> 
> This is really just a guess, there are a lot more things going on in the 
> system and it gets even more complicated once it's turned on. But I know 
> sometimes you just need to show you've thought about it :)
> 
> Hope that helps.
> Aaron
> 
> On 25 Mar 2011, at 02:27, Brian Fitzpatrick wrote:
> 
>> Thanks for the tips on the replication factor.  Any thoughts on the
>> number of nodes in a cluster to support an RF=3 with a workload of 400
>> ops/sec (4-8K sized rows, 50/50 read/write)?  Based on the "sweet
>> spot" hardware referenced in the wiki (8-core, 16-32GB RAM), what kink
>> of ops/sec could I reasonably expect from each node.  Just looking for
>> a range to make some educated guesses.
>> 
>> Thanks,
>> Brian
>> 
>> On Wed, Mar 23, 2011 at 9:04 PM, aaron morton  
>> wrote:
>>> It really does depend on what your workload is like, and in the end will
>>> involve a certain amount of fudge factor.
>>> 
>>> http://wiki.apache.org/cassandra/CassandraHardware provides some guidance.
>>> http://wiki.apache.org/cassandra/MemtableThresholds can be used to get a
>>> rough idea of the memory requirements. Note that secondary indexes are also
>>> CF's with the same memory settings as the parent.
>>> With RF3 you can lose afford to lose one replica for a key a token range and
>>> still be available (Assuming Quorum CL). With RF 5 you can lose 2 replicas
>>> and still be available for the keys in the range.
>>> I'm been careful to say "lose X replicas" because the other nodes in the
>>> cluster don't count when considering an operation for a key. Two examples, 9
>>> node cluster with RF3. If you lose nodes 2 and 3 and they are replicas for
>>> node 1, Quorum operations on keys in the range for node 1 will fail (ranges
>>> for 2 and 3 will be ok). If you lose nodes 2 and 5 Quorum operations will
>>> succeed for all keys.
>>> RF 3 is reasonable starting point for some redundancy, RF 5 is more. After
>>> that it's Web Scale (tm).
>>> Hope that helps
>>> Aaron
>>> 
>>> On 24 Mar 2011, at 04:04, Brian Fitzpatrick wrote:
>>> 
>>> I'm going through the process of specing out the hardware for a
>>> Cassandra cluster. The relevant specs:
>>> 
>>> - Support 460 operations/sec (50/50 read/write workload). Row size
>>> ranges from 4 to 8K.
>>> - Support 29 million objects for the first year
>>> - Support 365 GB storage for the first year, based on Cassandra tests
>>> (data + index + overhead * replication factor of 3)
>>> 
>>> I'm looking for advice on the node size for this cluster, recommended
>>> RAM per node, and whether RF=3 seems to be a good choice for general
>>> availability and resistance to failure.
>>> 
>>> I've looked at the YCSB benchmark paper and through the archives of
>>> this email list looking for pointers.  I haven't found any general
>>> guidelines on recommended cluster size to support X operations/sec
>>> with Y data size at RF factor of Z, that I could extrapolate from.
>>> 
>>> Any and all recommendations appreciated.
>>> 
>>> Thanks,
>>> Brian
>>> 
>>> 
> 


Re: Option for ordering columns by timestamp in CF

2011-03-24 Thread aaron morton
If you mean order by the column timestamp (as passed by the client) that it not 
possible. 

Can you use your own timestamps as the column name and store them as long 
values ? 

Aaron

On 25 Mar 2011, at 09:30, Narendra Sharma wrote:

> Cassandra 0.7.4
> Column names in my CF are of type byte[] but I want to order columns by 
> timestamp. What is the best way to achieve this? Does it make sense for 
> Cassandra to support ordering of columns by timestamp as option for a column 
> family irrespective of the column name type?
> 
> Thanks,
> Naren



Re: Sizing a Cassandra cluster

2011-03-24 Thread aaron morton
Ops you're right, off by 10.

should be 12,800 write and 3,200 read. 

Will also take the opportunity again to say this are just "some numbers" that 
may help when understanding how your app will behave when moving to new HW. And 
that there are a lot of other things the nodes have to do (like compactions, 
handling connections, repairs, GC) that take up resources as well . 

Thanks
Aaron

On 25 Mar 2011, at 10:04, Jose Juarez-Comboni wrote:

> 
> Aaron,
> 
> How did you get to 1280 writes/sec? Counting 64 writers each taking 5ms for a 
> write cycle, assuming real parallel access with no speed hits, I get 12,800 
> writes/sec. Am I missing something?
> 
> From Jose's iPhone
> 
> On Mar 24, 2011, at 2:52 PM, aaron morton  wrote:
> 
>> Big old guess of something in the 1000's. 
>> 
>> Try benchmarking your work load and plug the numbers (my 5m is pretty high) 
>> in...
>> 
>> - 8 cores * 8 writers per core = 64 if each write request takes 5ms  = 1280 
>> max per sec
>> - 1 spindle * 16 readers per spindle = 16 readers if each read request takes 
>> 5ms =  320 max per sec
>> (reader and writer sizes from the help in conf/cassandra.yaml)
>> 
>> This is really just a guess, there are a lot more things going on in the 
>> system and it gets even more complicated once it's turned on. But I know 
>> sometimes you just need to show you've thought about it :)
>> 
>> Hope that helps.
>> Aaron
>> 
>> On 25 Mar 2011, at 02:27, Brian Fitzpatrick wrote:
>> 
>>> Thanks for the tips on the replication factor.  Any thoughts on the
>>> number of nodes in a cluster to support an RF=3 with a workload of 400
>>> ops/sec (4-8K sized rows, 50/50 read/write)?  Based on the "sweet
>>> spot" hardware referenced in the wiki (8-core, 16-32GB RAM), what kink
>>> of ops/sec could I reasonably expect from each node.  Just looking for
>>> a range to make some educated guesses.
>>> 
>>> Thanks,
>>> Brian
>>> 
>>> On Wed, Mar 23, 2011 at 9:04 PM, aaron morton  
>>> wrote:
 It really does depend on what your workload is like, and in the end will
 involve a certain amount of fudge factor.
 
 http://wiki.apache.org/cassandra/CassandraHardware provides some guidance.
 http://wiki.apache.org/cassandra/MemtableThresholds can be used to get a
 rough idea of the memory requirements. Note that secondary indexes are also
 CF's with the same memory settings as the parent.
 With RF3 you can lose afford to lose one replica for a key a token range 
 and
 still be available (Assuming Quorum CL). With RF 5 you can lose 2 replicas
 and still be available for the keys in the range.
 I'm been careful to say "lose X replicas" because the other nodes in the
 cluster don't count when considering an operation for a key. Two examples, 
 9
 node cluster with RF3. If you lose nodes 2 and 3 and they are replicas for
 node 1, Quorum operations on keys in the range for node 1 will fail (ranges
 for 2 and 3 will be ok). If you lose nodes 2 and 5 Quorum operations will
 succeed for all keys.
 RF 3 is reasonable starting point for some redundancy, RF 5 is more. After
 that it's Web Scale (tm).
 Hope that helps
 Aaron
 
 On 24 Mar 2011, at 04:04, Brian Fitzpatrick wrote:
 
 I'm going through the process of specing out the hardware for a
 Cassandra cluster. The relevant specs:
 
 - Support 460 operations/sec (50/50 read/write workload). Row size
 ranges from 4 to 8K.
 - Support 29 million objects for the first year
 - Support 365 GB storage for the first year, based on Cassandra tests
 (data + index + overhead * replication factor of 3)
 
 I'm looking for advice on the node size for this cluster, recommended
 RAM per node, and whether RF=3 seems to be a good choice for general
 availability and resistance to failure.
 
 I've looked at the YCSB benchmark paper and through the archives of
 this email list looking for pointers.  I haven't found any general
 guidelines on recommended cluster size to support X operations/sec
 with Y data size at RF factor of Z, that I could extrapolate from.
 
 Any and all recommendations appreciated.
 
 Thanks,
 Brian
 
 
>> 



Re: access.properties

2011-03-24 Thread Hayden Andrews
Thanks for that Ben,

Just to clarify:

The current behavior is that if a user is given access to create and
destroy column families, then they will be unable to edit/view any data in
any column family they create unless they are also specifically given
access to the new column family in the access.properties file.

Right?

Hayden :)


> Hi Hayden,
>
> What you are describing certainly seems useful. I am not aware of anyone
> using the security features of the SimpleAuthenticator anywhere in
> production. If you have a real world use case and would like to see the
> authenticator improved please open a JIRA ticket. If you have something
> specific in mind please contribute!
>
> Thanks,
> Ben
>
> On 3/24/11 10:52 AM, Hayden Andrews wrote:
>> Hi ya,
>>
>> I'm few days into the Cassandra experience and this is my first message
>> here :)
>>
>> I've set up a dev instance of Cassandra and have got logins and access
>> working. Well, I thought I did, but I have found that my user that can
>> add
>> and remove column families, can not insert or get the rows.
>>
>> I really hope that I do not have to edit the access file to set
>> permissions for every user for every column family. I would like users
>> to
>> either be able to update the keyspace (including any and all column
>> families) or only have read-only access to everything.
>>
>> Since column families can be added and removed from a client app, it
>> would
>> be really painfully hacky to have to write a script to update the access
>> file every time the client app adds or removes column families!
>>
>> Anyway, some parts of my config files and a test below,
>>
>>
>> Cheers,
>>
>> Hayden
>>
>> Cassandra v0.7.4
>>
>> cassandra.yaml:
>> authenticator: org.apache.cassandra.auth.SimpleAuthenticator
>> authority: org.apache.cassandra.auth.SimpleAuthority
>>
>> access.properties:
>> =hayden
>> test.=hayden
>> test.=other,users
>>
>> Now, if I login, using the cassandra-cli program, and attach to the
>> keyspace and then ...
>>
>> [hayden@test] describe keyspace;
>>
>> Keyspace: test:
>>Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
>>  Replication Factor: 1
>>Column Families:
>>
>> [hayden@test] create column family potato;
>> [hayden@test] describe keyspace;
>>
>> Keyspace: test:
>>Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
>>  Replication Factor: 1
>>Column Families:
>>  ColumnFamily: potato
>>Columns sorted by: org.apache.cassandra.db.marshal.BytesType
>>Row cache size / save period: 0.0/0
>>Key cache size / save period: 20.0/14400
>>Memtable thresholds: 0.056244/12/1440
>>GC grace seconds: 864000
>>Compaction min/max thresholds: 4/32
>>Read repair chance: 1.0
>>Built indexes: []
>>
>> [hayden@test] list potato;
>>
>> #  does not have permission READ for
>> /cassandra/keyspaces/test/potato
>>
>
> --
> Ben Coverston
> DataStax -- The Apache Cassandra Company
> http://www.datastax.com/
>
>
> !DSPAM:7,4d8baed9224092596520844!
>
>



Add node to balanced cluster?

2011-03-24 Thread ruslan usifov
Hello

Which strategy should i use to and new node to fully balanced cluster (nodes
tokens are generated by python script:

def tokens(nodes):
  for x in xrange(nodes):
print 2 ** 127 / nodes * x

tokens(3);
)

How to get balanced cluster after adding ne node without big stress for
current cluster?


Re: SSTable Corruption

2011-03-24 Thread Thibaut Britz
Just accidently hard resetet a node running 0.7.2 (with some patches from
0.7.3) and had the same problem.

I'm a little hesitating upgrading to 0.7.4

Can I always delete the Statistics.db without any data loss?

Thibaut


On Thu, Mar 24, 2011 at 1:37 AM, Brandon Williams  wrote:

> On Wed, Mar 23, 2011 at 6:52 PM, Erik Onnen  wrote:
>
>> Thanks, so is it the "[Index.db, Statistics.db, Data.db, Filter.db];
>> skipped" that indicates it's in Statistics? Basically I need a way to
>> know if the same is true of all the other tables showing this issue.
>
>
> It's the at
> org.apache.cassandra.utils.EstimatedHistogram$EstimatedHistogramSerializer.deserialize(EstimatedHistogram.java:207)
> that clued me in.
>
> -Brandon
>


Re: pig counting question

2011-03-24 Thread Jeremy Hanna
Hmmm, for wide rows, you can page it with I believe some changes on 0.7 branch 
that made it in as part of https://issues.apache.org/jira/browse/CASSANDRA-1618 
recently.  Specifically, using the 0.7 branch version of CassandraStorage, you 
can specify it using this basic template:
cassandra:///[?slice_start=&slice_end=[&reversed=true][&limit=1]]
That goes in your pig LOAD block.
So it's a pain to do what you're doing I would imagine but it's possible to 
page in the latest on 0.7 branch.

On Mar 24, 2011, at 3:57 PM, Jeffrey Wang wrote:

> It looks like this functionality is not in the 0.7.3 version of 
> CassandraStorage. I tried to add the constructor which takes the limit to the 
> class, but I ran into some Pig parsing errors, so I had to make the parameter 
> a string. How did you get around this for the version of CassandraStorage in 
> trunk? I'm running Pig 0.8.0.
> 
> Also, when I bump the limit up very high (e.g. 1M columns), my Cassandra 
> starts eating up huge amounts of memory, maxing out my 16GB heap size. I 
> suspect this is because of the get_range_slices() call from 
> ColumnFamilyRecordReader. Are there plans to make this streaming/paged?
> 
> -Jeffrey
> 
> -Original Message-
> From: Jeremy Hanna [mailto:jeremy.hanna1...@gmail.com] 
> Sent: Thursday, March 24, 2011 11:34 AM
> To: user@cassandra.apache.org
> Subject: Re: pig counting question
> 
> The limit defaults to 1024 but you can set it when you use CassandraStorage 
> in pig, like so:
> rows = LOAD 'cassandra://Keyspace/ColumnFamily' USING CassandraStorage(4096);
> or whatever value you wish.
> 
> Give that a try and see if it gives you more of what you're looking for.
> 
> On Mar 24, 2011, at 1:16 PM, Jeffrey Wang wrote:
> 
>> Hey all,
>> 
>> I'm trying to run a very simple Pig script against my Cassandra cluster (5 
>> nodes, 0.7.3). I've gotten it all set up and working, but the script is 
>> giving me some strange results. Here is my script:
>> 
>> rows = LOAD 'cassandra://Keyspace/ColumnFamily' USING CassandraStorage();
>> rowct = FOREACH rows GENERATE $0, COUNT($1);
>> dump rowct;
>> 
>> If I understand Pig correctly, this should output (row name, column count) 
>> tuples, but I'm always seeing 1024 for the column count even though the rows 
>> have highly variable number of columns. Am I missing something? Thanks.
>> 
>> -Jeffrey
>> 
> 



Re: access.properties

2011-03-24 Thread Benjamin Coverston
Looking at the code I think your assumption is correct. When you choose 
the simple authority you have to explicitly set permissions.


On 3/24/11 3:50 PM, Hayden Andrews wrote:

Thanks for that Ben,

Just to clarify:

The current behavior is that if a user is given access to create and
destroy column families, then they will be unable to edit/view any data in
any column family they create unless they are also specifically given
access to the new column family in the access.properties file.

Right?

Hayden :)



Hi Hayden,

What you are describing certainly seems useful. I am not aware of anyone
using the security features of the SimpleAuthenticator anywhere in
production. If you have a real world use case and would like to see the
authenticator improved please open a JIRA ticket. If you have something
specific in mind please contribute!

Thanks,
Ben

On 3/24/11 10:52 AM, Hayden Andrews wrote:

Hi ya,

I'm few days into the Cassandra experience and this is my first message
here :)

I've set up a dev instance of Cassandra and have got logins and access
working. Well, I thought I did, but I have found that my user that can
add
and remove column families, can not insert or get the rows.

I really hope that I do not have to edit the access file to set
permissions for every user for every column family. I would like users
to
either be able to update the keyspace (including any and all column
families) or only have read-only access to everything.

Since column families can be added and removed from a client app, it
would
be really painfully hacky to have to write a script to update the access
file every time the client app adds or removes column families!

Anyway, some parts of my config files and a test below,


Cheers,

Hayden

Cassandra v0.7.4

cassandra.yaml:
authenticator: org.apache.cassandra.auth.SimpleAuthenticator
authority: org.apache.cassandra.auth.SimpleAuthority

access.properties:
=hayden
test.=hayden
test.=other,users

Now, if I login, using the cassandra-cli program, and attach to the
keyspace and then ...

[hayden@test] describe keyspace;

Keyspace: test:
Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
  Replication Factor: 1
Column Families:

[hayden@test] create column family potato;
[hayden@test] describe keyspace;

Keyspace: test:
Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
  Replication Factor: 1
Column Families:
  ColumnFamily: potato
Columns sorted by: org.apache.cassandra.db.marshal.BytesType
Row cache size / save period: 0.0/0
Key cache size / save period: 20.0/14400
Memtable thresholds: 0.056244/12/1440
GC grace seconds: 864000
Compaction min/max thresholds: 4/32
Read repair chance: 1.0
Built indexes: []

[hayden@test] list potato;

#   does not have permission READ for
/cassandra/keyspaces/test/potato


--
Ben Coverston
DataStax -- The Apache Cassandra Company
http://www.datastax.com/


!DSPAM:7,4d8baed9224092596520844!




--
Ben Coverston
DataStax -- The Apache Cassandra Company
http://www.datastax.com/



Re: pig counting question

2011-03-24 Thread Jeremy Hanna
And if you download the 0.7 branch and build the cassandra_storage.jar in the 
contrib/pig section with that update, you should be able to use it with your 
0.7.3 cluster.  Those changes are typically independent of the Cassandra 
version.

On Mar 24, 2011, at 5:49 PM, Jeremy Hanna wrote:

> Hmmm, for wide rows, you can page it with I believe some changes on 0.7 
> branch that made it in as part of 
> https://issues.apache.org/jira/browse/CASSANDRA-1618 recently.  Specifically, 
> using the 0.7 branch version of CassandraStorage, you can specify it using 
> this basic template:
> cassandra:///[?slice_start=&slice_end=[&reversed=true][&limit=1]]
> That goes in your pig LOAD block.
> So it's a pain to do what you're doing I would imagine but it's possible to 
> page in the latest on 0.7 branch.
> 
> On Mar 24, 2011, at 3:57 PM, Jeffrey Wang wrote:
> 
>> It looks like this functionality is not in the 0.7.3 version of 
>> CassandraStorage. I tried to add the constructor which takes the limit to 
>> the class, but I ran into some Pig parsing errors, so I had to make the 
>> parameter a string. How did you get around this for the version of 
>> CassandraStorage in trunk? I'm running Pig 0.8.0.
>> 
>> Also, when I bump the limit up very high (e.g. 1M columns), my Cassandra 
>> starts eating up huge amounts of memory, maxing out my 16GB heap size. I 
>> suspect this is because of the get_range_slices() call from 
>> ColumnFamilyRecordReader. Are there plans to make this streaming/paged?
>> 
>> -Jeffrey
>> 
>> -Original Message-
>> From: Jeremy Hanna [mailto:jeremy.hanna1...@gmail.com] 
>> Sent: Thursday, March 24, 2011 11:34 AM
>> To: user@cassandra.apache.org
>> Subject: Re: pig counting question
>> 
>> The limit defaults to 1024 but you can set it when you use CassandraStorage 
>> in pig, like so:
>> rows = LOAD 'cassandra://Keyspace/ColumnFamily' USING CassandraStorage(4096);
>> or whatever value you wish.
>> 
>> Give that a try and see if it gives you more of what you're looking for.
>> 
>> On Mar 24, 2011, at 1:16 PM, Jeffrey Wang wrote:
>> 
>>> Hey all,
>>> 
>>> I'm trying to run a very simple Pig script against my Cassandra cluster (5 
>>> nodes, 0.7.3). I've gotten it all set up and working, but the script is 
>>> giving me some strange results. Here is my script:
>>> 
>>> rows = LOAD 'cassandra://Keyspace/ColumnFamily' USING CassandraStorage();
>>> rowct = FOREACH rows GENERATE $0, COUNT($1);
>>> dump rowct;
>>> 
>>> If I understand Pig correctly, this should output (row name, column count) 
>>> tuples, but I'm always seeing 1024 for the column count even though the 
>>> rows have highly variable number of columns. Am I missing something? Thanks.
>>> 
>>> -Jeffrey
>>> 
>> 
> 



Re: Error connection to remote JMX agent! on nodetool

2011-03-24 Thread ko...@vivinavi.com

Hi Aaron

Thank you so much for your reply and advice.
I did describe cluster.
Then I found multiple version as following.

[default@unknown] describe cluster;
Cluster Information:
   Snitch: org.apache.cassandra.locator.SimpleSnitch
   Partitioner: org.apache.cassandra.dht.RandomPartitioner
   Schema versions:
d24cdd50-5567-11e0-a96a-cc92cc024db2: [**.**.254.53]
2db1c0ff-51b1-11e0-8dc8-e700f669bcfc: [**.**.254.54]

So maybe I have to drop cluster.
I have to drop both clusters? or only one side?

And then I don't know how to drop the entire cluster.
I checked help of Cassandra-cli or Cassandra wiki etc.
I can find only drop keyspace,CF but drop cluster.
Please let me know how to drop cluster.

And I have another question.
I found a command "get  where  =  [and  > 
 and ...] [limit int];"

on Cassandra-Cli help.
Is this command available in PHP program?

Thank you for your reply in advance.

Mamoru Mac Kondo


(2011/03/23 18:45), aaron morton wrote:
If you are getting the "Cluster schema does not agree" then you have a 
sick cluster and replication will not be working properly.


Open the cassandra-cli client and type "describe cluster;" you should 
see a single schema version such as...


[default@unknown] describe cluster;
Cluster Information:
   Snitch: org.apache.cassandra.locator.SimpleSnitch
   Partitioner: org.apache.cassandra.dht.RandomPartitioner
   Schema versions:
e69ffb30-5525-11e0--242d50cf1fbd: [127.0.0.1, 127.0.0.2]
But I think you will see multiple versions.

The easiest thing to do is drop the entire cluster and start again.

Hope that helps.
Aaron

On 24 Mar 2011, at 11:45, ko...@vivinavi.com 
 wrote:



Hi Aaron

Thank you so much for your reply and advice.
I watched your presentation. it"s helpful for me.

Anyway I did as following with 2 node servers.(53;1st node,54;2nd node)
I started the following write/read.php program by through Thrift at 
53 server.

$users->insert($Key, array('Movie' => 'Hollywood', 'Seaside' => 
'SantaMonica' , 'Museum' => 'Getty' , 'Japanese' => 'Little Tokyo' ));

$ret=$users->get($Key);
print_r($ret);
?>
I could get $ret at 53 server.
Then I started the following read.php program at 54 server.
get($Key);
print_r($ret);
?>
I could get $ret at 54 server.
So I confirmed these data are replicated from 53 to 54.
However I did same thing from 54 to 53 with only changed 
data(key='hahaha').

(These are same keyspace,CF)
I could see data on 54 server.(no problem)
But on 53 server I had an following error message.
*Fatal error*:  Uncaught exception 'cassandra_TimedOutException' in 
/usr/share/php5/Thrift/thrift/packages/cassandra/Cassandra.php:253
Stack trace:
#0 /usr/share/php5/Thrift/thrift/packages/cassandra/Cassandra.php(253): 
thrift_protocol_read_binary(Object(TBinaryProtocolAccelerated), 
'cassandra_Cassa...', false)
#1 /usr/share/php5/Thrift/thrift/packages/cassandra/Cassandra.php(226): 
CassandraClient->recv_get_slice()
#2 /usr/share/php5/Thrift/columnfamily.php(254): 
CassandraClient->get_slice('hahaha', Object(cassandra_ColumnParent), 
Object(cassandra_SlicePredicate), 1)
#3 /var/www/thrift/PhpcassaRead.php(44): ColumnFamily->get('hahaha')
#4 {main}
   thrown in*/usr/share/php5/Thrift/thrift/packages/cassandra/Cassandra.php*  
on line*253*
I checked on Cassandra-cli at 53 server.
[default@Twissandra] get user['hahaha'];
null

So I think replication doesn't work from 54 to 53.
I know when I add node and then set data at 1st node, this data will 
be provided to  all other nodes.
But I'm not sure when I set data at 2nd node, this data should be 
replicated from 2nd to 1st node.

I though this will be replicated because of ring.

And when I tried to create keyspace or CF several times on 54(2nd 
server), I had a following error message.

"Cluster schema does not yet agree"
i don't know how to schema agree.

Am I wrong?
Thank you for your advice in advance.

Mamoru Mac Kondo

(2011/03/23 11:32), Aaron Morton wrote:

What process are you using to confirm the data was replicated to another server 
? And what makes you say the data is not replicated ? I think your 
understanding of the replication may be a little off, you rarely read from one 
node. Have a look 
athttp://thelastpickle.com/2011/02/07/Introduction-to-Cassandra/

What happens when you try to create a keyspace or CF and it fails?

It's easier to help if you provide the commands you use and any error messages. 
Also remember to check the logs on the servers for errors.

Aaron

On 24/03/2011, at 5:58 AM,"ko...@vivinavi.com"wrote:


Hi maki-san

I am so sorry this was my mistake.
I expected when I set data at one node, the data should be copied to the other 
node
at the same keyspace and same column family by replication.
This replication was working.
I just made a mistake to get data by wrong Key.(First character of key was 
lower-case character
but I thought first character was capitalized. I tried to get by key=User but 
key=user)
I am 

Re: Error connection to remote JMX agent! on nodetool

2011-03-24 Thread aaron morton
Simple solution is to stop the nodes and delete the contents of the commitlog, 
data and saved_caches directories. Normally these are in /var/lib/cassandra 

This will give you a clean starting point. 

The cli statement is using secondary indexes 
http://www.datastax.com/dev/blog/whats-new-cassandra-07-secondary-indexes

phpcassa has support for it, http://thobbs.github.com/phpcassa/api/index.html

I've managed to avoid php so far so cannot help there. 

Aaron

On 25 Mar 2011, at 12:18, ko...@vivinavi.com wrote:

> Hi Aaron
> 
> Thank you so much for your reply and advice.
> I did describe cluster.
> Then I found multiple version as following.
> 
> [default@unknown] describe cluster;
> Cluster Information:
>Snitch: org.apache.cassandra.locator.SimpleSnitch
>Partitioner: org.apache.cassandra.dht.RandomPartitioner
>Schema versions:
> d24cdd50-5567-11e0-a96a-cc92cc024db2: [**.**.254.53]
> 2db1c0ff-51b1-11e0-8dc8-e700f669bcfc: [**.**.254.54]
> 
> So maybe I have to drop cluster.
> I have to drop both clusters? or only one side?
> 
> And then I don't know how to drop the entire cluster.
> I checked help of Cassandra-cli or Cassandra wiki etc.
> I can find only drop keyspace,CF but drop cluster.
> Please let me know how to drop cluster.
> 
> And I have another question.
> I found a command "get  where  =  [and  >  
> and ...] [limit int];"
> on Cassandra-Cli help.
> Is this command available in PHP program?
> 
> Thank you for your reply in advance.
> 
> Mamoru Mac Kondo
> 
> 
> (2011/03/23 18:45), aaron morton wrote:
>> 
>> If you are getting the "Cluster schema does not agree" then you have a sick 
>> cluster and replication will not be working properly. 
>> 
>> Open the cassandra-cli client and type "describe cluster;" you should see a 
>> single schema version such as... 
>> 
>> [default@unknown] describe cluster;
>> Cluster Information:
>>Snitch: org.apache.cassandra.locator.SimpleSnitch
>>Partitioner: org.apache.cassandra.dht.RandomPartitioner
>>Schema versions: 
>>  e69ffb30-5525-11e0--242d50cf1fbd: [127.0.0.1, 127.0.0.2]
>>  
>> But I think you will see multiple versions.
>> 
>> The easiest thing to do is drop the entire cluster and start again. 
>> 
>> Hope that helps. 
>> Aaron
>> 
>> On 24 Mar 2011, at 11:45, ko...@vivinavi.com wrote:
>> 
>>> Hi Aaron
>>> 
>>> Thank you so much for your reply and advice.
>>> I watched your presentation. it"s helpful for me.
>>> 
>>> Anyway I did as following with 2 node servers.(53;1st node,54;2nd node)
>>> I started the following write/read.php program by through Thrift at 53 
>>> server.
>>> >> include_once...
>>> $servers[0]['host'] = '**.**.254.53';
>>> $servers[0]['port'] = '9160';
>>> $KeyspaceName = 'Twissandra';
>>> $ColumnFamilyName = 'user';
>>> $Key = 'LA';
>>> $conn = new Connection($KeyspaceName, $servers);
>>> $users = new ColumnFamily($conn, $ColumnFamilyName);
>>> $users->insert($Key, array('Movie' => 'Hollywood', 'Seaside' => 
>>> 'SantaMonica' , 'Museum' => 'Getty' , 'Japanese' => 'Little Tokyo' ));
>>> $ret=$users->get($Key);
>>> print_r($ret);
>>> ?>
>>> I could get $ret at 53 server.
>>> Then I started the following read.php program at 54 server.
>>> >> include_once...
>>> $servers[0]['host'] = '**.**.254.54';
>>> $servers[0]['port'] = '9160';
>>> $KeyspaceName = 'Twissandra';
>>> $ColumnFamilyName = 'user';
>>> $Key = 'LA';
>>> $conn = new Connection($KeyspaceName, $servers);
>>> $users = new ColumnFamily($conn, $ColumnFamilyName);
>>> $ret=$users->get($Key);
>>> print_r($ret);
>>> ?>
>>> I could get $ret at 54 server.
>>> So I confirmed these data are replicated from 53 to 54.
>>> However I did same thing from 54 to 53 with only changed data(key='hahaha').
>>> (These are same keyspace,CF)
>>> I could see data on 54 server.(no problem)
>>> But on 53 server I had an following error message.
>>> Fatal error:  Uncaught exception 'cassandra_TimedOutException' in 
>>> /usr/share/php5/Thrift/thrift/packages/cassandra/Cassandra.php:253
>>> Stack trace:
>>> #0 /usr/share/php5/Thrift/thrift/packages/cassandra/Cassandra.php(253): 
>>> thrift_protocol_read_binary(Object(TBinaryProtocolAccelerated), 
>>> 'cassandra_Cassa...', false)
>>> #1 /usr/share/php5/Thrift/thrift/packages/cassandra/Cassandra.php(226): 
>>> CassandraClient->recv_get_slice()
>>> #2 /usr/share/php5/Thrift/columnfamily.php(254): 
>>> CassandraClient->get_slice('hahaha', Object(cassandra_ColumnParent), 
>>> Object(cassandra_SlicePredicate), 1)
>>> #3 /var/www/thrift/PhpcassaRead.php(44): ColumnFamily->get('hahaha')
>>> #4 {main}
>>>   thrown in /usr/share/php5/Thrift/thrift/packages/cassandra/Cassandra.php 
>>> on line 253
>>> I checked on Cassandra-cli at 53 server.
>>> [default@Twissandra] get user['hahaha'];
>>> null
>>> 
>>> So I think replication doesn't work from 54 to 53.
>>> I know when I add node and then set data at 1st node, this data will be 
>>> provid

Re: Add node to balanced cluster?

2011-03-24 Thread Jonathan Ellis
http://wiki.apache.org/cassandra/Operations

On Thu, Mar 24, 2011 at 5:15 PM, ruslan usifov  wrote:
> Hello
>
> Which strategy should i use to and new node to fully balanced cluster (nodes
> tokens are generated by python script:
>
> def tokens(nodes):
>   for x in xrange(nodes):
>     print 2 ** 127 / nodes * x
>
> tokens(3);
> )
>
> How to get balanced cluster after adding ne node without big stress for
> current cluster?
>



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


URGENT HELP PLEASE!

2011-03-24 Thread Jared Laprise
Hello all, I'm running 2 Cassandra 6.5 nodes and I brought down the secondary 
node and restarted the primary node. After Cassandra came back up all data has 
been reverted to several months ago.

I could really use some incite here, this is a production website and I need to 
act quickly. I have a cron job that takes a snapshot every night, but even with 
that I tried to restore a snapshot on my local development environment and it 
was also missing a ton of data.

Any help will be so appreciated.




Re: Add node to balanced cluster?

2011-03-24 Thread Eric Gilmore
Also: http://www.datastax.com/docs/0.7/operations/clustering#adding-capacity

On Thu, Mar 24, 2011 at 5:20 PM, Jonathan Ellis  wrote:

> http://wiki.apache.org/cassandra/Operations
>
> On Thu, Mar 24, 2011 at 5:15 PM, ruslan usifov 
> wrote:
> > Hello
> >
> > Which strategy should i use to and new node to fully balanced cluster
> (nodes
> > tokens are generated by python script:
> >
> > def tokens(nodes):
> >   for x in xrange(nodes):
> > print 2 ** 127 / nodes * x
> >
> > tokens(3);
> > )
> >
> > How to get balanced cluster after adding ne node without big stress for
> > current cluster?
> >
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
>


OOM during compaction with half the heap still available?

2011-03-24 Thread Dan Washusen
Hey All,
I've noticed that the Cassandra instance I have running on our build machine 
occasionally crashes with an OOM error during compaction. I'm going to dial 
down the memtable thresholds etc but I was wondering if anyone could help 
explain the heap usage at the time of the crash. I just happened to leave a JMX 
console window open and it's showing that just before the crash roughly 50% of 
the heap was still available.

Screenshot of heap usage: http://img3.imageshack.us/img3/2822/memoryf.png

The above screenshot was taken a few weeks ago on Cassandra 0.7.2 (I think) 
with nmap disabled on Java 1.6.0_24-b07. I'm now running 0.7.4 with nmap 
enabled and just got the same crash (based on the error message in the log)...

Log snippet from crash that matches screenshot: http://pastebin.com/ACa8fKUu
Log snippet from 0.7.4 crash: http://pastebin.com/SwSQawUM

Cheers,
-- 
Dan Washusen


Re: URGENT HELP PLEASE!

2011-03-24 Thread aaron morton
Was there anything in the server logs during startup ?

I've not heard of this happening before and it's hard think of how / why 
cassandra could revert it's data. Other than something external playing with 
the files on disk 

Aaron

On 25 Mar 2011, at 13:49, Jared Laprise wrote:

> Hello all, I’m running 2 Cassandra 6.5 nodes and I brought down the secondary 
> node and restarted the primary node. After Cassandra came back up all data 
> has been reverted to several months ago.
>  
> I could really use some incite here, this is a production website and I need 
> to act quickly. I have a cron job that takes a snapshot every night, but even 
> with that I tried to restore a snapshot on my local development environment 
> and it was also missing a ton of data.
>  
> Any help will be so appreciated.
>  
>  



Re: log4j settings inquiry

2011-03-24 Thread david lee
specifying the path using the file:// protocol worked like a charm.
thank you very much Aaron for your help.

but i was wondering why
 -Dlog4j.configuration=log4j-server.properties didn't work and
 -Dlog4j.configuration=file://"C:\Program Files\Apache Software
Foundation\apache-cassandra-0.7.4\conf\log4j-server.properties"^ worked so i
tried to place cassandra's home folder to a folder without any space
characters
and it worked without using file:// protocol as well.

i guess it's the issue with log4j not being able to handle space characters
well.



On 25 March 2011 05:14, aaron morton  wrote:

> Just checking the obvious thing, are you running cassandra or cassandra.bat
> ? (cannot imagine you would even get as far as you did but I like asking
> questions).
>
> It's all a bit strange because the code in 0.7.4 will throw some errors if
> it cannot resolve a path to load the config from.
>
> You can hard code the log config path by modifying the line
>  -Dlog4j.configuration=log4j-server.properties^
>
> in cassandra.bat and specifying a path using the file:// protocol
>
> Hope that helps.
> Aaron
>
> On 24 Mar 2011, at 19:40, david lee wrote:
>
> hi,
> i'm trying to run cassandra 0.7 on my windows machine,
> and i don't seem to be able to go beyond the warning message
>
> C:\Program Files\Apache Software
> Foundation\apache-cassandra-0.7.4\bin>cassandra
>  -f
> Starting Cassandra Server
> log4j:WARN No appenders could be found for logger
> (org.apache.cassandra.service.
> AbstractCassandraDaemon).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
> more in
> fo.
>
> in my conf folder, i have log4j-server.properties which looks like
> log4j.rootLogger=INFO,stdout,R
>
> # stdout
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=%5p %d{HH:mm:ss,SSS} %m%n
>
> # rolling log file
> log4j.appender.R=org.apache.log4j.RollingFileAppender
> log4j.appender.R.maxFileSize=20MB
> log4j.appender.R.maxBackupIndex=50
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> log4j.appender.R.layout.ConversionPattern=%5p [%t] %d{ISO8601} %F (line %L)
> %m%n
> # Edit the next line to point to your logs directory
> log4j.appender.R.File=file:C:/var/log/cassandra/system.log
>
> any help will be much appreciated.
>
> thanx in advnace
>
>
>


Re: log4j settings inquiry

2011-03-24 Thread Jonathan Ellis
we've had issues in the past w/ the .bat file not quoting paths, which
you need to do to support paths w/ spaces.  can you open a ticket and
we'll fix this one too?

On Thu, Mar 24, 2011 at 9:29 PM, david lee  wrote:
> specifying the path using the file:// protocol worked like a charm.
> thank you very much Aaron for your help.
> but i was wondering why
>  -Dlog4j.configuration=log4j-server.properties didn't work and
>  -Dlog4j.configuration=file://"C:\Program Files\Apache Software
> Foundation\apache-cassandra-0.7.4\conf\log4j-server.properties"^ worked so i
> tried to place cassandra's home folder to a folder without any space
> characters
> and it worked without using file:// protocol as well.
> i guess it's the issue with log4j not being able to handle space characters
> well.
>
>
> On 25 March 2011 05:14, aaron morton  wrote:
>>
>> Just checking the obvious thing, are you running cassandra or
>> cassandra.bat ? (cannot imagine you would even get as far as you did but I
>> like asking questions).
>> It's all a bit strange because the code in 0.7.4 will throw some errors if
>> it cannot resolve a path to load the config from.
>> You can hard code the log config path by modifying the line
>>  -Dlog4j.configuration=log4j-server.properties^
>> in cassandra.bat and specifying a path using the file:// protocol
>> Hope that helps.
>> Aaron
>> On 24 Mar 2011, at 19:40, david lee wrote:
>>
>> hi,
>> i'm trying to run cassandra 0.7 on my windows machine,
>> and i don't seem to be able to go beyond the warning message
>> C:\Program Files\Apache Software
>> Foundation\apache-cassandra-0.7.4\bin>cassandra
>>  -f
>> Starting Cassandra Server
>> log4j:WARN No appenders could be found for logger
>> (org.apache.cassandra.service.
>> AbstractCassandraDaemon).
>> log4j:WARN Please initialize the log4j system properly.
>> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
>> more in
>> fo.
>> in my conf folder, i have log4j-server.properties which looks like
>> log4j.rootLogger=INFO,stdout,R
>> # stdout
>> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
>> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>> log4j.appender.stdout.layout.ConversionPattern=%5p %d{HH:mm:ss,SSS} %m%n
>> # rolling log file
>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>> log4j.appender.R.maxFileSize=20MB
>> log4j.appender.R.maxBackupIndex=50
>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>> log4j.appender.R.layout.ConversionPattern=%5p [%t] %d{ISO8601} %F (line
>> %L) %m%n
>> # Edit the next line to point to your logs directory
>> log4j.appender.R.File=file:C:/var/log/cassandra/system.log
>> any help will be much appreciated.
>> thanx in advnace
>
>



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


Re: URGENT HELP PLEASE!

2011-03-24 Thread Jonathan Ellis
Right, Cassandra doesn't keep old versions around so to see an old
version you have to have uncompacted data and whack the new data --
either by blowing away sstables or not replaying the commitlog.

Snapshots flush before creating their hard links, which rules out any
commitlog problems.

If you ran out of disk space you wouldn't get past the commitlog
append, so you'd never get new data in at all after that.

Sounds like an environmental problem, not Cassandra specific.

On Thu, Mar 24, 2011 at 9:10 PM, aaron morton  wrote:
> Was there anything in the server logs during startup ?
> I've not heard of this happening before and it's hard think of how / why
> cassandra could revert it's data. Other than something external playing with
> the files on disk
> Aaron
> On 25 Mar 2011, at 13:49, Jared Laprise wrote:
>
> Hello all, I’m running 2 Cassandra 6.5 nodes and I brought down the
> secondary node and restarted the primary node. After Cassandra came back up
> all data has been reverted to several months ago.
>
> I could really use some incite here, this is a production website and I need
> to act quickly. I have a cron job that takes a snapshot every night, but
> even with that I tried to restore a snapshot on my local development
> environment and it was also missing a ton of data.
>
> Any help will be so appreciated.
>
>
>



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


Re: OOM during compaction with half the heap still available?

2011-03-24 Thread Jonathan Ellis
Have you run nodetool scrub?  The data versioning problem scrub fixes
can manifest itself as trying to read GB of data into memory during
compaction.

On Thu, Mar 24, 2011 at 8:52 PM, Dan Washusen  wrote:
> Hey All,
> I've noticed that the Cassandra instance I have running on our build machine
> occasionally crashes with an OOM error during compaction.  I'm going to dial
> down the memtable thresholds etc but I was wondering if anyone could help
> explain the heap usage at the time of the crash.  I just happened to leave a
> JMX console window open and it's showing that just before the crash roughly
> 50% of the heap was still available.
> Screenshot of heap usage: http://img3.imageshack.us/img3/2822/memoryf.png
> The above screenshot was taken a few weeks ago on Cassandra 0.7.2 (I think)
> with nmap disabled on Java 1.6.0_24-b07.  I'm now running 0.7.4 with nmap
> enabled and just got the same crash (based on the error message in the
> log)...
> Log snippet from crash that matches screenshot: http://pastebin.com/ACa8fKUu
> Log snippet from 0.7.4 crash: http://pastebin.com/SwSQawUM
> Cheers,
> --
> Dan Washusen
>



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


Re: SSTable Corruption

2011-03-24 Thread Jonathan Ellis
Yes, Statistics is convenient because as part of supporting old 0.6
data Cassandra will just build it if it's not there.

Technically you can rebuild filter and index too but it's not automatic.

It looks like when we added statistics we didn't make sure to fsync it
when we fsync the other components.  Patch attached to
https://issues.apache.org/jira/browse/CASSANDRA-2382.

On Thu, Mar 24, 2011 at 5:47 PM, Thibaut Britz
 wrote:
> Just accidently hard resetet a node running 0.7.2 (with some patches from
> 0.7.3) and had the same problem.
>
> I'm a little hesitating upgrading to 0.7.4
>
> Can I always delete the Statistics.db without any data loss?
>
> Thibaut
>
>
> On Thu, Mar 24, 2011 at 1:37 AM, Brandon Williams  wrote:
>>
>> On Wed, Mar 23, 2011 at 6:52 PM, Erik Onnen  wrote:
>>>
>>> Thanks, so is it the "[Index.db, Statistics.db, Data.db, Filter.db];
>>> skipped" that indicates it's in Statistics? Basically I need a way to
>>> know if the same is true of all the other tables showing this issue.
>>
>> It's the at
>> org.apache.cassandra.utils.EstimatedHistogram$EstimatedHistogramSerializer.deserialize(EstimatedHistogram.java:207)
>> that clued me in.
>> -Brandon
>



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


RE: URGENT HELP PLEASE!

2011-03-24 Thread Jared Laprise
Thanks for the responses. I got everything working again, and have some ideas 
on why but am not completely sure.

How I got it working again was simply bring the second node back online. I was 
under the assumption that all data is replicated between nodes (eventually). Am 
I incorrect? It would seem that each node stores different data and delegates 
the read request to whichever node holds the data. Although I've spent a lot of 
time with Cassandra in a single node environment I think I may be lacking a bit 
of understanding on how Cassandra behaves in a clustered environment.


-Original Message-
From: Jonathan Ellis [mailto:jbel...@gmail.com] 
Sent: Thursday, March 24, 2011 8:22 PM
To: user@cassandra.apache.org
Cc: aaron morton
Subject: Re: URGENT HELP PLEASE!

Right, Cassandra doesn't keep old versions around so to see an old version you 
have to have uncompacted data and whack the new data -- either by blowing away 
sstables or not replaying the commitlog.

Snapshots flush before creating their hard links, which rules out any commitlog 
problems.

If you ran out of disk space you wouldn't get past the commitlog append, so 
you'd never get new data in at all after that.

Sounds like an environmental problem, not Cassandra specific.

On Thu, Mar 24, 2011 at 9:10 PM, aaron morton  wrote:
> Was there anything in the server logs during startup ?
> I've not heard of this happening before and it's hard think of how / 
> why cassandra could revert it's data. Other than something external 
> playing with the files on disk Aaron On 25 Mar 2011, at 13:49, Jared 
> Laprise wrote:
>
> Hello all, I'm running 2 Cassandra 6.5 nodes and I brought down the 
> secondary node and restarted the primary node. After Cassandra came 
> back up all data has been reverted to several months ago.
>
> I could really use some incite here, this is a production website and 
> I need to act quickly. I have a cron job that takes a snapshot every 
> night, but even with that I tried to restore a snapshot on my local 
> development environment and it was also missing a ton of data.
>
> Any help will be so appreciated.
>
>
>



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


Re: error connecting to cassandra 0.7.3

2011-03-24 Thread Tyler Hobbs
I highly recommend using one of the existing Cassandra
clientsinstead of
writing your own.

On Thu, Mar 24, 2011 at 10:17 AM, Anurag Gujral wrote:

> Hi All,
>I was able to resolve by making socket open.
> Thanks
> Anurag
>
>
> On Thu, Mar 24, 2011 at 7:48 AM, Anurag Gujral wrote:
>
>> Hi All,
>>   I am using the following code as per suggestion by Ruslan
>>tr = new TSocket(url, port,timeout);
>>TTransport transport= new TFramedTransport(tr);
>> TProtocol proto = new TBinaryProtocol(transport);
>>
>> client = new Cassandra.Client(proto);
>> client.set_keyspace(this.keyspace);
>>
>> But I am getting the error
>>
>> at
>> org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:142)
>> at
>> org.apache.thrift.transport.TFramedTransport.flush(TFramedTransport.java:156)
>> at
>> org.apache.cassandra.thrift.Cassandra$Client.send_set_keyspace(Cassandra.java:414)
>> at
>> org.apache.cassandra.thrift.Cassandra$Client.set_keyspace(Cassandra.java:403)
>> Please suggest why is this an error
>> Thanks
>> Anurag
>>
>>
>> On Thu, Mar 24, 2011 at 7:15 AM, Anurag Gujral 
>> wrote:
>>
>>> Hi Ruslan
>>> where is this framed transport defined.
>>> I  did TProtocol proto = new TFramedTransport(tr);
>>>
>>> I am getting
>>> annot find symbol
>>> [javac] symbol  : class TFramedTransport
>>> Please Suggest
>>> Thanks
>>> Anurag
>>>
>>> On Thu, Mar 24, 2011 at 2:13 AM, ruslan usifov 
>>> wrote:
>>>
 and where is transport creation for your thrift interface? Cassandra 0.7
 uses Framed transport as default


 2011/3/24 Anurag Gujral 

>
> I am using the following code to create my client.
>
>  tr = new TSocket(url, port);
> TProtocol proto = new TBinaryProtocol(tr);
>  client = new Cassandra.Client(proto);
>   client.set_keyspace(this.keyspace);
>
> I am getting the errors I mentioned below
> Thanks
> Anurag
>
>
> -- Forwarded message --
> From: Anurag Gujral 
> Date: Thu, Mar 24, 2011 at 1:26 AM
> Subject: error connecting to cassandra 0.7.3
> To: user@cassandra.apache.org
>
>
> I am using cassandra-0.7.3 and thrift-0.0.5,I wrote a java client using
> thrift 0.0.5 when I try to connect to
> local cassandra server I get the following error
> ERROR com.bluekai.cassandra.validation.ValidationThread  - Failed to
> connect to 127.0.0.1.
> org.apache.thrift.transport.TTransportException: Cannot write to null
> outputStream
>
>
> I am able to connect to the local cassandra server using cassandra-cli
> though
>
> Any suggestions
> Thanks
> Anurag
>
>

>>>
>>
>


-- 
Tyler Hobbs
Software Engineer, DataStax 
Maintainer of the pycassa  Cassandra
Python client library


Re: URGENT HELP PLEASE!

2011-03-24 Thread Benjamin Coverston

Hi Jared,

Sounds like you have two nodes in the cluster. What is your replication 
factor set to? 1? 2?


Have you ever run repair? What consistency level do you use for reads 
and writes?


From the way you are speaking it sounds like you are sending all of 
your traffic to a single node (primary, secondary).


If you never repair the ranges, and you read the data infrequently (or 
only with range slices) I can guess that your data never got replicated 
to your secondary node.


Ben

On 3/24/11 9:44 PM, Jared Laprise wrote:

Thanks for the responses. I got everything working again, and have some ideas 
on why but am not completely sure.

How I got it working again was simply bring the second node back online. I was 
under the assumption that all data is replicated between nodes (eventually). Am 
I incorrect? It would seem that each node stores different data and delegates 
the read request to whichever node holds the data. Although I've spent a lot of 
time with Cassandra in a single node environment I think I may be lacking a bit 
of understanding on how Cassandra behaves in a clustered environment.


-Original Message-
From: Jonathan Ellis [mailto:jbel...@gmail.com]
Sent: Thursday, March 24, 2011 8:22 PM
To: user@cassandra.apache.org
Cc: aaron morton
Subject: Re: URGENT HELP PLEASE!

Right, Cassandra doesn't keep old versions around so to see an old version you 
have to have uncompacted data and whack the new data -- either by blowing away 
sstables or not replaying the commitlog.

Snapshots flush before creating their hard links, which rules out any commitlog 
problems.

If you ran out of disk space you wouldn't get past the commitlog append, so 
you'd never get new data in at all after that.

Sounds like an environmental problem, not Cassandra specific.

On Thu, Mar 24, 2011 at 9:10 PM, aaron morton  wrote:

Was there anything in the server logs during startup ?
I've not heard of this happening before and it's hard think of how /
why cassandra could revert it's data. Other than something external
playing with the files on disk Aaron On 25 Mar 2011, at 13:49, Jared
Laprise wrote:

Hello all, I'm running 2 Cassandra 6.5 nodes and I brought down the
secondary node and restarted the primary node. After Cassandra came
back up all data has been reverted to several months ago.

I could really use some incite here, this is a production website and
I need to act quickly. I have a cron job that takes a snapshot every
night, but even with that I tried to restore a snapshot on my local
development environment and it was also missing a ton of data.

Any help will be so appreciated.






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


--
Ben Coverston
DataStax -- The Apache Cassandra Company
http://www.datastax.com/



is it possible to mutate Columns and CounterColumn in the same batch mutation?

2011-03-24 Thread Patricio Echagüe
Hi folks, I'm modeling the partitioned counters into Hector and given the
non-inheritance of Thrift, I don't see how to add a ColumnCounter and a
Column in the same batch mutation.

Is it possible do achieve? or are both in fact different mutations?

Thanks


Re: OOM during compaction with half the heap still available?

2011-03-24 Thread Dan Washusen
Ah, it would appear I forgot to do that on the hudson machine. Thanks!

-- 
Dan Washusen
On Friday, 25 March 2011 at 2:23 PM, Jonathan Ellis wrote: 
> Have you run nodetool scrub? The data versioning problem scrub fixes
> can manifest itself as trying to read GB of data into memory during
> compaction.
> 
> On Thu, Mar 24, 2011 at 8:52 PM, Dan Washusen  wrote:
> > Hey All,
> > I've noticed that the Cassandra instance I have running on our build machine
> > occasionally crashes with an OOM error during compaction. I'm going to dial
> > down the memtable thresholds etc but I was wondering if anyone could help
> > explain the heap usage at the time of the crash. I just happened to leave a
> > JMX console window open and it's showing that just before the crash roughly
> > 50% of the heap was still available.
> > Screenshot of heap usage: http://img3.imageshack.us/img3/2822/memoryf.png
> > The above screenshot was taken a few weeks ago on Cassandra 0.7.2 (I think)
> > with nmap disabled on Java 1.6.0_24-b07. I'm now running 0.7.4 with nmap
> > enabled and just got the same crash (based on the error message in the
> > log)...
> > Log snippet from crash that matches screenshot: http://pastebin.com/ACa8fKUu
> > Log snippet from 0.7.4 crash: http://pastebin.com/SwSQawUM
> > Cheers,
> > --
> > Dan Washusen
> 
> 
> 
> -- 
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
> 


Re: URGENT HELP PLEASE!

2011-03-24 Thread Jonathan Ellis
Each row is replicated to replication_factor nodes, not the entire
cluster (or you couldn't scale writes by adding machines).

Sounds like you're running with RF=1.

On Thu, Mar 24, 2011 at 10:44 PM, Jared Laprise  wrote:
> Thanks for the responses. I got everything working again, and have some ideas 
> on why but am not completely sure.
>
> How I got it working again was simply bring the second node back online. I 
> was under the assumption that all data is replicated between nodes 
> (eventually). Am I incorrect? It would seem that each node stores different 
> data and delegates the read request to whichever node holds the data. 
> Although I've spent a lot of time with Cassandra in a single node environment 
> I think I may be lacking a bit of understanding on how Cassandra behaves in a 
> clustered environment.
>
>
> -Original Message-
> From: Jonathan Ellis [mailto:jbel...@gmail.com]
> Sent: Thursday, March 24, 2011 8:22 PM
> To: user@cassandra.apache.org
> Cc: aaron morton
> Subject: Re: URGENT HELP PLEASE!
>
> Right, Cassandra doesn't keep old versions around so to see an old version 
> you have to have uncompacted data and whack the new data -- either by blowing 
> away sstables or not replaying the commitlog.
>
> Snapshots flush before creating their hard links, which rules out any 
> commitlog problems.
>
> If you ran out of disk space you wouldn't get past the commitlog append, so 
> you'd never get new data in at all after that.
>
> Sounds like an environmental problem, not Cassandra specific.
>
> On Thu, Mar 24, 2011 at 9:10 PM, aaron morton  wrote:
>> Was there anything in the server logs during startup ?
>> I've not heard of this happening before and it's hard think of how /
>> why cassandra could revert it's data. Other than something external
>> playing with the files on disk Aaron On 25 Mar 2011, at 13:49, Jared
>> Laprise wrote:
>>
>> Hello all, I'm running 2 Cassandra 6.5 nodes and I brought down the
>> secondary node and restarted the primary node. After Cassandra came
>> back up all data has been reverted to several months ago.
>>
>> I could really use some incite here, this is a production website and
>> I need to act quickly. I have a cron job that takes a snapshot every
>> night, but even with that I tried to restore a snapshot on my local
>> development environment and it was also missing a ton of data.
>>
>> Any help will be so appreciated.
>>
>>
>>
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support 
> http://www.datastax.com
>



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


Re: is it possible to mutate Columns and CounterColumn in the same batch mutation?

2011-03-24 Thread Jonathan Ellis
You can't have them both in the same Mutation struct, but you can have
them in the map>> that is the "batch."

2011/3/24 Patricio Echagüe :
> Hi folks, I'm modeling the partitioned counters into Hector and given the
> non-inheritance of Thrift, I don't see how to add a ColumnCounter and a
> Column in the same batch mutation.
> Is it possible do achieve? or are both in fact different mutations?
> Thanks



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


RE: URGENT HELP PLEASE!

2011-03-24 Thread Jared Laprise
My replication factor is 1

I haven't run repair until today, I'm using ONE for consistency level.

I have two servers that are load balanced (per session) which both run 
Cassandra and each server connects to Cassandra on localhost.

Based on what you're saying, and being I'm using session (cookie) based load 
balancing it would be true that data is rarely read or written (per user) on a 
different server, that could be why data isn't replicating. 

Again, I'm extremely appreciative of your feedback as I haven't had the luxury 
of delving into all aspects of Cassandra and especially related to multi-node 
deployments. Thanks!

-Original Message-
From: Benjamin Coverston [mailto:ben.covers...@datastax.com] 
Sent: Thursday, March 24, 2011 8:59 PM
To: user@cassandra.apache.org
Subject: Re: URGENT HELP PLEASE!

Hi Jared,

Sounds like you have two nodes in the cluster. What is your replication factor 
set to? 1? 2?

Have you ever run repair? What consistency level do you use for reads and 
writes?

 From the way you are speaking it sounds like you are sending all of your 
traffic to a single node (primary, secondary).

If you never repair the ranges, and you read the data infrequently (or only 
with range slices) I can guess that your data never got replicated to your 
secondary node.

Ben

On 3/24/11 9:44 PM, Jared Laprise wrote:
> Thanks for the responses. I got everything working again, and have some ideas 
> on why but am not completely sure.
>
> How I got it working again was simply bring the second node back online. I 
> was under the assumption that all data is replicated between nodes 
> (eventually). Am I incorrect? It would seem that each node stores different 
> data and delegates the read request to whichever node holds the data. 
> Although I've spent a lot of time with Cassandra in a single node environment 
> I think I may be lacking a bit of understanding on how Cassandra behaves in a 
> clustered environment.
>
>
> -Original Message-
> From: Jonathan Ellis [mailto:jbel...@gmail.com]
> Sent: Thursday, March 24, 2011 8:22 PM
> To: user@cassandra.apache.org
> Cc: aaron morton
> Subject: Re: URGENT HELP PLEASE!
>
> Right, Cassandra doesn't keep old versions around so to see an old version 
> you have to have uncompacted data and whack the new data -- either by blowing 
> away sstables or not replaying the commitlog.
>
> Snapshots flush before creating their hard links, which rules out any 
> commitlog problems.
>
> If you ran out of disk space you wouldn't get past the commitlog append, so 
> you'd never get new data in at all after that.
>
> Sounds like an environmental problem, not Cassandra specific.
>
> On Thu, Mar 24, 2011 at 9:10 PM, aaron morton  wrote:
>> Was there anything in the server logs during startup ?
>> I've not heard of this happening before and it's hard think of how / 
>> why cassandra could revert it's data. Other than something external 
>> playing with the files on disk Aaron On 25 Mar 2011, at 13:49, Jared 
>> Laprise wrote:
>>
>> Hello all, I'm running 2 Cassandra 6.5 nodes and I brought down the 
>> secondary node and restarted the primary node. After Cassandra came 
>> back up all data has been reverted to several months ago.
>>
>> I could really use some incite here, this is a production website and 
>> I need to act quickly. I have a cron job that takes a snapshot every 
>> night, but even with that I tried to restore a snapshot on my local 
>> development environment and it was also missing a ton of data.
>>
>> Any help will be so appreciated.
>>
>>
>>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support 
> http://www.datastax.com

--
Ben Coverston
DataStax -- The Apache Cassandra Company http://www.datastax.com/



cassandra client sample code for 0.7.3

2011-03-24 Thread Anurag Gujral
I am in need of sample code(basically cassandra client) in java using
batch_mutate
If someone has please reply back
Thanks
Anurag


RE: URGENT HELP PLEASE!

2011-03-24 Thread Jared Laprise
Correct, replication factor of 1. 

I've been reading and researching as fast as possible so I'm also starting to 
realize what some of the configurations actually mean and getting a clearer 
picture. My request to the Cassandra community was a desperate, "Oh man! I F'd 
up!" moment, and didn't have the time to Google it myself :-)


-Original Message-
From: Jonathan Ellis [mailto:jbel...@gmail.com] 
Sent: Thursday, March 24, 2011 9:49 PM
To: user@cassandra.apache.org
Cc: Jared Laprise; aaron morton
Subject: Re: URGENT HELP PLEASE!

Each row is replicated to replication_factor nodes, not the entire cluster (or 
you couldn't scale writes by adding machines).

Sounds like you're running with RF=1.

On Thu, Mar 24, 2011 at 10:44 PM, Jared Laprise  wrote:
> Thanks for the responses. I got everything working again, and have some ideas 
> on why but am not completely sure.
>
> How I got it working again was simply bring the second node back online. I 
> was under the assumption that all data is replicated between nodes 
> (eventually). Am I incorrect? It would seem that each node stores different 
> data and delegates the read request to whichever node holds the data. 
> Although I've spent a lot of time with Cassandra in a single node environment 
> I think I may be lacking a bit of understanding on how Cassandra behaves in a 
> clustered environment.
>
>
> -Original Message-
> From: Jonathan Ellis [mailto:jbel...@gmail.com]
> Sent: Thursday, March 24, 2011 8:22 PM
> To: user@cassandra.apache.org
> Cc: aaron morton
> Subject: Re: URGENT HELP PLEASE!
>
> Right, Cassandra doesn't keep old versions around so to see an old version 
> you have to have uncompacted data and whack the new data -- either by blowing 
> away sstables or not replaying the commitlog.
>
> Snapshots flush before creating their hard links, which rules out any 
> commitlog problems.
>
> If you ran out of disk space you wouldn't get past the commitlog append, so 
> you'd never get new data in at all after that.
>
> Sounds like an environmental problem, not Cassandra specific.
>
> On Thu, Mar 24, 2011 at 9:10 PM, aaron morton  wrote:
>> Was there anything in the server logs during startup ?
>> I've not heard of this happening before and it's hard think of how / 
>> why cassandra could revert it's data. Other than something external 
>> playing with the files on disk Aaron On 25 Mar 2011, at 13:49, Jared 
>> Laprise wrote:
>>
>> Hello all, I'm running 2 Cassandra 6.5 nodes and I brought down the 
>> secondary node and restarted the primary node. After Cassandra came 
>> back up all data has been reverted to several months ago.
>>
>> I could really use some incite here, this is a production website and 
>> I need to act quickly. I have a cron job that takes a snapshot every 
>> night, but even with that I tried to restore a snapshot on my local 
>> development environment and it was also missing a ton of data.
>>
>> Any help will be so appreciated.
>>
>>
>>
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support 
> http://www.datastax.com
>



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


Re: URGENT HELP PLEASE!

2011-03-24 Thread Brandon Williams
On Thu, Mar 24, 2011 at 11:58 PM, Jared Laprise  wrote:

> My replication factor is 1
>

Then you are living dangerously.


> I haven't run repair until today, I'm using ONE for consistency level.
>

Repair at rf=1 won't do anything.

I have two servers that are load balanced (per session) which both run
> Cassandra and each server connects to Cassandra on localhost.
>
> Based on what you're saying, and being I'm using session (cookie) based
> load balancing it would be true that data is rarely read or written (per
> user) on a different server, that could be why data isn't replicating.
>
> Again, I'm extremely appreciative of your feedback as I haven't had the
> luxury of delving into all aspects of Cassandra and especially related to
> multi-node deployments. Thanks!


Here is the key point: replication_factor refers to the total replicas
(where replica means 'instance of the data', not 'copy of it'.)  You only
have one, which is why half your data disappeared when a node was down.  I
would go to 2 and then run repair (see
http://wiki.apache.org/cassandra/FAQ#change_replication) so you have
redundancy.

-Brandon


Index name is not optional in Cassandra 0.7.4?

2011-03-24 Thread Yeh Zheng Tan

Hi all,
I'm using Hector 0.7.0-28 to access Cassandra. On Cassandra 0.7.0 when 
I'm trying to create new column family with indexes, I create it without 
specifying the indexName(String). But I found that the code does not 
work in Cassandra 0.7.4. It breaks by throwing an 
InvalidRequestException with the message "No indexed columns present in 
index clause with operator EQ" when I try to call query using secondary 
index.  The problem is fixed by specifying the index name. Can anybody 
confirm of this change? Hope it helps others that faces this problem.


--
Yours Sincerely,

Yeh Zheng Tan

 ChartNexus® :: Chart Your Success 

ChartNexus Pte. Ltd.

15 Enggor Street #10-01

Realty Center

Singapore 079716

Website: www.chartnexus.com


Disclaimer

This email is confidential and intended only for the use of the individual or 
individuals named above and may contain information that is privileged. If you 
are not the intended recipient, you are notified that any dissemination, 
distribution or copying of this email is strictly prohibited.



Re: Central monitoring of Cassandra cluster

2011-03-24 Thread Jonathan Colby
Cacti and Munin are great for graphing, nagios is good for monitoring.

I wrote a very simple JMX proxy that you can send a request to and it retrieves 
the desired JMX beans.

there are jmx proxys out there if you don't want to write your own, for example 
http://code.google.com/p/polarrose-jmx-rest-bridge/

There is even a JMX proxy that integrates with nagios.  I don't remember the 
name but google will help you.



On Mar 24, 2011, at 7:44 PM, mcasandra wrote:

> Can someone share if they have centralized monitoring for all cassandra
> servers. With many nodes it becomes difficult to monitor them individually
> unless we can look at data in one place. I am looking at solutions where
> this can be done. Looking at Cacti currently but not sure how to integrate
> it with JMX.
> 
> --
> View this message in context: 
> http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Central-monitoring-of-Cassandra-cluster-tp6205275p6205275.html
> Sent from the cassandra-u...@incubator.apache.org mailing list archive at 
> Nabble.com.