Re: Cassandra yaml configuration

2011-09-22 Thread Maki Watanabe
You have a chance to write it by your own. I'll buy one :-)

maki

2011/9/22 Sajith Kariyawasam :
> Thanks Maki.
> If you came across with any other book supporting latest Cassandara
> versions, pls let me know.
>
> On Thu, Sep 22, 2011 at 12:03 PM, Maki Watanabe 
> wrote:
>>
>> The book is a bit out dated now.
>> You should better to use cassandra-cli to define your application schema.
>> Please refer to conf/schema-sample.txt and help in cassandra-cli.
>>
>> % cassandra-cli
>> [default@unknown] help;
>> [default@unknown] help create keyspace;
>> [default@unknown] help create column family;
>>
>> You can load schema defined in text file by cassandra-cli:
>> % cassandra-cli -h host -p port --file your-schema-definition.txt
>>
>> maki
>>
>>
>>
>> 2011/9/22 Sajith Kariyawasam :
>> > Hi all,
>> > Im refering to the book authored by Eben Hewitt, named Cassandra The
>> > Definitive Guide
>> >
>> > There, in the Sample Application chapter (Chapter 4), example 4.1, a
>> > sample
>> > schema is given in a file named "cassandra.yaml". (I have mentioned it
>> > below)
>> > I'm using Cassandra 0.8.6 version.
>> > My question is that, whether the given format of the file is correct? if
>> > so,
>> > where i have to mention in the cassandra configuration to load this yaml
>> > file?
>> > because the format of the sample schema  comes with Cassandra
>> > (conf/schema-sample.txt) is bit different from the sample given in the
>> > book.
>> >
>> > Schema definition in cassandra.yaml
>> > 
>> > keyspaces:
>> > - name: Hotelier
>> > replica_placement_strategy:
>> > org.apache.cassandra.locator.RackUnawareStrategy
>> > replication_factor: 1
>> > column_families:
>> > - name: Hotel
>> > compare_with: UTF8Type
>> > - name: HotelByCity
>> > compare_with: UTF8Type
>> > - name: Guest
>> > compare_with: BytesType
>> > - name: Reservation
>> > compare_with: TimeUUIDType
>> > - name: PointOfInterest
>> > column_type: Super
>> > compare_with: UTF8Type
>> > compare_subcolumns_with: UTF8Type
>> > - name: Room
>> > compare_with: BytesType
>> > compare_subcolumns_with: BytesType
>> > - name: RoomAvailability
>> > column_type: Super
>> > compare_with: BytesType
>> > compare_subcolumns_with: BytesType
>> >
>> > --
>> > Best Regards
>> > Sajith
>> >
>>
>>
>>
>> --
>> w3m
>
>
>
> --
> Best Regards
> Sajith
>



-- 
w3m


Re: Moving to a new cluster

2011-09-22 Thread Philippe
Hi Aaron
Thanks for the reply

I should hhave mentionned that all current nodes are running 0.8.4.
All current and future services have 2TB disks of which i have allocated
only half. I don't expect any issues here. Should I?
Le 22 sept. 2011 01:26, "aaron morton"  a écrit :
> How much data is on the nodes in cluster 1 and how much disk space on
cluster 2 ? Be aware that Cassandra 0.8 has an issue where repair can go
crazy and use a lot of space.
>
> If you are not regularly running repair I would also repair before the
move.
>
> The repair after the copy is a good idea but should technically not be
necessary. If you can practice the move watch the repair to see if much is
transferred (check the logs). There is always a small transfer, but if you
see data been transferred for several minutes I would investigate.
>
> When you start a repair it will repair will the other nodes it replicates
data with. So you only need to run it every RF nodes. Start it one one,
watch the logs to see who it talks to and then start it on the first node it
does not talk to. And so on.
>
> Add a snapshot before the clean (repair will also snapshot before it runs)
>
> Scrub is not needed unless you are migrating or you have file errors.
>
> If your cluster is online, consider running the clean every RFth node
rather than all at once (e.g. 1,4, 7, 10 then 2,5,8,11). It will have less
impact on clients.
>
> Cheers
>
> -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 22/09/2011, at 10:27 AM, Philippe wrote:
>
>> Hello,
>> We're currently running on a 3-node RF=3 cluster. Now that we have a
better grip on things, we want to replace it with a 12-node RF=3 cluster of
"smaller" servers. So I wonder what the best way to move the data to the new
cluster would be. I can afford to stop writing to the current cluster for
whatever time is necessary. Has anyone written up something on this subject
?
>>
>> My plan is the following (nodes in cluster 1 are node1.1->1.3, nodes in
cluster 2 are node2.1->2.12)
>> stop writing to current cluster & drain it
>> get a snapshot on each node
>> Since it's RF=3, each node should have all the data, so assuming I set
the tokens correctly I would move the snapshot from node1.1 to node2.1, 2.2,
2.3 and 2.4 then node1.2->node2.5,2.6,2.,2.8, etc. This is because the range
for node1.1 is now spread across 2.1->2.4
>> Run repair & clean & scrub on each node (more or less in //)
>> What do you think ?
>> Thanks
>


Re: benefits of off-heap (serializing) row cache?

2011-09-22 Thread Boris Yen
I think the cassandra team did not re-implement their own GC. I guess what
they meant is the less heap being used, the better GC performance.

AFAIK, only data that is not been updated frequently can benefit from
off-heap row cache, because when a row is modified, the row inside cache
need be invalidated.

On Mon, Sep 19, 2011 at 9:56 AM, Yang  wrote:

> this comment in JIRA mentions it
>
> https://issues.apache.org/jira/browse/CASSANDRA-1969?focusedCommentId=12985038&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12985038
>
> but in the end,  it's not immediately clear. could someone give a
> summary of its advantages?
> (if it's just re-implement your own GC, why would your own GC be better?)
>
> Thanks
> Yang
>


Re: Unable to create compaction marker

2011-09-22 Thread aaron morton
It's in the yaml file…

# directories where Cassandra should store data on disk.
data_file_directories:
- /var/lib/cassandra/data

The permissions are normally cassandra:cassandra

Cheers

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

On 22/09/2011, at 12:06 PM, Daning wrote:

> Thanks Jonathan. where is the data directory configured? since I did not any 
> permission problem.
> 
> Daning
> 
> On 09/21/2011 11:01 AM, Jonathan Ellis wrote:
>> Means Cassandra couldn't create an empty file in the data directory
>> designating a sstable as compacted.  I'd look for permissions
>> problems.
>> 
>> Short term there is no dire consequence, although it will keep
>> re-compacting that sstable.  Longer term you'll run out of disk space
>> since nothing gets deleted.
>> 
>> On Wed, Sep 21, 2011 at 1:44 PM, Daning  wrote:
>>> I got this exception in system.log several times a day, do you have idea
>>> what caused this problem and what is the consequence?
>>> 
>>> 
>>> ERROR [CompactionExecutor:12] 2011-09-15 14:29:19,578
>>> AbstractCassandraDaemon.java (line 139) Fatal exception in thread
>>> Thread[CompactionExecutor:12,1,main]
>>> java.io.IOError: java.io.IOException: Unable to create compaction marker
>>>at
>>> org.apache.cassandra.io.sstable.SSTableReader.markCompacted(SSTableReader.java:642)
>>>at
>>> org.apache.cassandra.db.DataTracker.removeOldSSTablesSize(DataTracker.java:280)
>>>at org.apache.cassandra.db.DataTracker.replace(DataTracker.java:253)
>>>at
>>> org.apache.cassandra.db.DataTracker.replaceCompactedSSTables(DataTracker.java:214)
>>>at
>>> org.apache.cassandra.db.ColumnFamilyStore.replaceCompactedSSTables(ColumnFamilyStore.java:1094)
>>>at
>>> org.apache.cassandra.db.compaction.CompactionManager.doCompactionWithoutSizeEstimation(CompactionManager.java:599)
>>>at
>>> org.apache.cassandra.db.compaction.CompactionManager.doCompaction(CompactionManager.java:507)
>>>at
>>> org.apache.cassandra.db.compaction.CompactionManager$1.call(CompactionManager.java:142)
>>>at
>>> org.apache.cassandra.db.compaction.CompactionManager$1.call(CompactionManager.java:108)
>>>at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
>>>at java.util.concurrent.FutureTask.run(Unknown Source)
>>>at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
>>> Source)
>>>at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>>>at java.lang.Thread.run(Unknown Source)
>>> Caused by: java.io.IOException: Unable to create compaction marker
>>>at
>>> org.apache.cassandra.io.sstable.SSTableReader.markCompacted(SSTableReader.java:638)
>>>... 13 more
>>> 
>>> 
>>> Thank you in advance.
>>> 
>>> Daning
>>> 
>> 
>> 
> 



Re: Possibility of going OOM using get_count

2011-09-22 Thread Boris Yen
I was wondering if it is possible to use similar way as
CASSANDRA-2894
to
have the slice_predict support the offset concept? With the offset, it would
be much easier to implement the paging from the client side.

Boris

On Mon, Sep 19, 2011 at 9:45 PM, Jonathan Ellis  wrote:

> Unfortunately no, because you don't know what the actual
> last-column-counted was.
>
> On Mon, Sep 19, 2011 at 4:25 AM, aaron morton 
> wrote:
> > get_count() supports the same predicate as get_slice. So you can
> implement
> > the paging yourself.
> > Cheers
> > -
> > Aaron Morton
> > Freelance Cassandra Developer
> > @aaronmorton
> > http://www.thelastpickle.com
> > On 19/09/2011, at 8:45 PM, Tharindu Mathew wrote:
> >
> >
> > On Mon, Sep 19, 2011 at 12:40 PM, Benoit Perroud 
> wrote:
> >>
> >> The workaround for 0.7 is calling get_slice and count on client side.
> >> It's heavier, sure, but you will then be able to set start column
> >> accordingly.
> >
> > I was afraid of that :(
> > Will follow that method. Thanks.
> >>
> >>
> >> 2011/9/19 Tharindu Mathew :
> >> > Thanks Aaron and Jake for the replies.
> >> > Any chance of a possible workaround to use for Cassandra 0.7?
> >> >
> >> > On Mon, Sep 19, 2011 at 3:48 AM, aaron morton <
> aa...@thelastpickle.com>
> >> > wrote:
> >> >>
> >> >> Cool
> >> >> Thanks, A
> >> >> -
> >> >> Aaron Morton
> >> >> Freelance Cassandra Developer
> >> >> @aaronmorton
> >> >> http://www.thelastpickle.com
> >> >> On 19/09/2011, at 9:55 AM, Jake Luciani wrote:
> >> >>
> >> >> This is fixed in 1.0
> >> >> https://issues.apache.org/jira/browse/CASSANDRA-2894
> >> >>
> >> >> On Sun, Sep 18, 2011 at 2:16 PM, Tharindu Mathew <
> mcclou...@gmail.com>
> >> >> wrote:
> >> >>>
> >> >>> Hi everyone,
> >> >>> I noticed this line in the API docs,
> >> >>>
> >> >>> The method is not O(1). It takes all the columns from disk to
> >> >>> calculate
> >> >>> the answer. The only benefit of the method is that you do not need
> to
> >> >>> pull
> >> >>> all the columns over Thrift interface to count them.
> >> >>>
> >> >>> Does this mean if a row has a large number of columns calling this
> >> >>> method
> >> >>> might make it go OOM?
> >> >>> Thanks in advance.
> >> >>> --
> >> >>> Regards,
> >> >>>
> >> >>> Tharindu
> >> >>> blog: http://mackiemathew.com/
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> http://twitter.com/tjake
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Regards,
> >> >
> >> > Tharindu
> >> > blog: http://mackiemathew.com/
> >> >
> >
> >
> >
> > --
> > Regards,
> >
> > Tharindu
> > blog: http://mackiemathew.com/
> >
> >
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
>


Re: Thrift 7

2011-09-22 Thread Sylvain Lebresne
Cassandra uses Thrift 6 for now (a ticket is open for upgrading to Thrift 7
(https://issues.apache.org/jira/browse/CASSANDRA-3213), I refer you to
the discussion there). That being said I don't know what is the story of Thrift
for having a client and server of different versions, but I suspect this is the
problem here.

--
Sylvain


On Thu, Sep 22, 2011 at 7:46 AM, Suman Ghosh  wrote:
> Any suggestions on this, folks?
>
>
> On Tue, Sep 6, 2011 at 12:59 AM, tushar pal  wrote:
>>
>> Hi,
>>     I am facing some problem using Thrift 7.
>> I downloaded the tar file.I downloaded the windows exe too for . Created a
>> thrift jar from the lib java path and then generated the java class from
>> tutorial.thrift file.Now while I use run the ant file inside example I got
>> some error that some of the package are used in that generated java files do
>> not exists in that generated thrift jar.
>> Can anybody please help ?
>>
>> --
>> TUSHAR KANTI PAL
>>
>>
>
>
>
> --
> Get me at GMail    --> sumanthewhiz[at]gmail[dot]com
> ... or there's Yahoo --> sumanthewhiz[at]yahoo[dot]com
>


Re: Moving to a new cluster

2011-09-22 Thread Jonas Borgström
On 09/22/2011 01:25 AM, aaron morton wrote:
*snip*
> When you start a repair it will repair will the other nodes it
> replicates data with. So you only need to run it every RF nodes. Start
> it one one, watch the logs to see who it talks to and then start it on
> the first node it does not talk to. And so on. 

Is this new in 0.8 or has it always been this way?

From
http://wiki.apache.org/cassandra/Operations#Frequency_of_nodetool_repair

"""
Unless your application performs no deletes, it is vital that production
clusters run nodetool repair periodically on all nodes in the cluster.
"""

So for a 3 node cluster using RF=3, is it sufficient to run "nodetool
repair" on one node?

/ Jonas


Re: Unable to create compaction marker

2011-09-22 Thread Radim Kolar

Dne 21.9.2011 20:01, Jonathan Ellis napsal(a):

Means Cassandra couldn't create an empty file in the data directory
designating a sstable as compacted.  I'd look for permissions
problems.

Short term there is no dire consequence, although it will keep
re-compacting that sstable.  Longer term you'll run out of disk space
since nothing gets deleted.
how it could run of out disk space? If cassandra is able to create new 
sstable, then it should be able to create empty files too.


Tool for SQL -> Cassandra data movement

2011-09-22 Thread Radim Kolar
I need tool which is able to dump tables via JDBC into JSON format for 
cassandra import. I am pretty sure that somebody already wrote that.


Are there tools which can do direct JDBC -> cassandra import?


Re: Cassandra yaml configuration

2011-09-22 Thread aaron morton
This is pretty up to date
http://www.packtpub.com/cassandra-apache-high-performance-cookbook/book

A

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

On 22/09/2011, at 7:07 PM, Maki Watanabe wrote:

> You have a chance to write it by your own. I'll buy one :-)
> 
> maki
> 
> 2011/9/22 Sajith Kariyawasam :
>> Thanks Maki.
>> If you came across with any other book supporting latest Cassandara
>> versions, pls let me know.
>> 
>> On Thu, Sep 22, 2011 at 12:03 PM, Maki Watanabe 
>> wrote:
>>> 
>>> The book is a bit out dated now.
>>> You should better to use cassandra-cli to define your application schema.
>>> Please refer to conf/schema-sample.txt and help in cassandra-cli.
>>> 
>>> % cassandra-cli
>>> [default@unknown] help;
>>> [default@unknown] help create keyspace;
>>> [default@unknown] help create column family;
>>> 
>>> You can load schema defined in text file by cassandra-cli:
>>> % cassandra-cli -h host -p port --file your-schema-definition.txt
>>> 
>>> maki
>>> 
>>> 
>>> 
>>> 2011/9/22 Sajith Kariyawasam :
 Hi all,
 Im refering to the book authored by Eben Hewitt, named Cassandra The
 Definitive Guide
 
 There, in the Sample Application chapter (Chapter 4), example 4.1, a
 sample
 schema is given in a file named "cassandra.yaml". (I have mentioned it
 below)
 I'm using Cassandra 0.8.6 version.
 My question is that, whether the given format of the file is correct? if
 so,
 where i have to mention in the cassandra configuration to load this yaml
 file?
 because the format of the sample schema  comes with Cassandra
 (conf/schema-sample.txt) is bit different from the sample given in the
 book.
 
 Schema definition in cassandra.yaml
 
 keyspaces:
 - name: Hotelier
 replica_placement_strategy:
 org.apache.cassandra.locator.RackUnawareStrategy
 replication_factor: 1
 column_families:
 - name: Hotel
 compare_with: UTF8Type
 - name: HotelByCity
 compare_with: UTF8Type
 - name: Guest
 compare_with: BytesType
 - name: Reservation
 compare_with: TimeUUIDType
 - name: PointOfInterest
 column_type: Super
 compare_with: UTF8Type
 compare_subcolumns_with: UTF8Type
 - name: Room
 compare_with: BytesType
 compare_subcolumns_with: BytesType
 - name: RoomAvailability
 column_type: Super
 compare_with: BytesType
 compare_subcolumns_with: BytesType
 
 --
 Best Regards
 Sajith
 
>>> 
>>> 
>>> 
>>> --
>>> w3m
>> 
>> 
>> 
>> --
>> Best Regards
>> Sajith
>> 
> 
> 
> 
> -- 
> w3m



Re: Thrift 7

2011-09-22 Thread aaron morton
I'm a bit confused about what you are trying to do. 

Are you trying to install thrift on windows ? Best I can to do help is point 
you to the readme file, or this 
http://wiki.apache.org/thrift/ThriftInstallationWin32

You may get more help on the thrift email list. 

You not need to install thrift to use Cassandra, only to rebuild the interfaces 
which is generally something client developers do.  

Cheers


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

On 22/09/2011, at 5:46 PM, Suman Ghosh wrote:

> Any suggestions on this, folks?
> 
> 
> On Tue, Sep 6, 2011 at 12:59 AM, tushar pal  wrote:
> Hi,
> I am facing some problem using Thrift 7.
> I downloaded the tar file.I downloaded the windows exe too for . Created a 
> thrift jar from the lib java path and then generated the java class from 
> tutorial.thrift file.Now while I use run the ant file inside example I got 
> some error that some of the package are used in that generated java files do 
> not exists in that generated thrift jar.
> Can anybody please help ?
> 
> -- 
> TUSHAR KANTI PAL
> 
> 
> 
> 
> 
> -- 
> Get me at GMail--> sumanthewhiz[at]gmail[dot]com
> ... or there's Yahoo --> sumanthewhiz[at]yahoo[dot]com



Re: Moving to a new cluster

2011-09-22 Thread aaron morton
the new nodes will have 1TB of data disk, but how much data will you put on 
them?

A

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

On 22/09/2011, at 7:23 PM, Philippe wrote:

> Hi Aaron
> Thanks for the reply
> 
> I should hhave mentionned that all current nodes are running 0.8.4.
> All current and future services have 2TB disks of which i have allocated only 
> half. I don't expect any issues here. Should I?
> 
> Le 22 sept. 2011 01:26, "aaron morton"  a écrit :
> > How much data is on the nodes in cluster 1 and how much disk space on 
> > cluster 2 ? Be aware that Cassandra 0.8 has an issue where repair can go 
> > crazy and use a lot of space. 
> > 
> > If you are not regularly running repair I would also repair before the move.
> > 
> > The repair after the copy is a good idea but should technically not be 
> > necessary. If you can practice the move watch the repair to see if much is 
> > transferred (check the logs). There is always a small transfer, but if you 
> > see data been transferred for several minutes I would investigate. 
> > 
> > When you start a repair it will repair will the other nodes it replicates 
> > data with. So you only need to run it every RF nodes. Start it one one, 
> > watch the logs to see who it talks to and then start it on the first node 
> > it does not talk to. And so on. 
> > 
> > Add a snapshot before the clean (repair will also snapshot before it runs)
> > 
> > Scrub is not needed unless you are migrating or you have file errors.
> > 
> > If your cluster is online, consider running the clean every RFth node 
> > rather than all at once (e.g. 1,4, 7, 10 then 2,5,8,11). It will have less 
> > impact on clients. 
> > 
> > Cheers
> > 
> > -
> > Aaron Morton
> > Freelance Cassandra Developer
> > @aaronmorton
> > http://www.thelastpickle.com
> > 
> > On 22/09/2011, at 10:27 AM, Philippe wrote:
> > 
> >> Hello,
> >> We're currently running on a 3-node RF=3 cluster. Now that we have a 
> >> better grip on things, we want to replace it with a 12-node RF=3 cluster 
> >> of "smaller" servers. So I wonder what the best way to move the data to 
> >> the new cluster would be. I can afford to stop writing to the current 
> >> cluster for whatever time is necessary. Has anyone written up something on 
> >> this subject ?
> >> 
> >> My plan is the following (nodes in cluster 1 are node1.1->1.3, nodes in 
> >> cluster 2 are node2.1->2.12)
> >> stop writing to current cluster & drain it
> >> get a snapshot on each node
> >> Since it's RF=3, each node should have all the data, so assuming I set the 
> >> tokens correctly I would move the snapshot from node1.1 to node2.1, 2.2, 
> >> 2.3 and 2.4 then node1.2->node2.5,2.6,2.,2.8, etc. This is because the 
> >> range for node1.1 is now spread across 2.1->2.4
> >> Run repair & clean & scrub on each node (more or less in //)
> >> What do you think ?
> >> Thanks
> > 



Re: Moving to a new cluster

2011-09-22 Thread Sylvain Lebresne
2011/9/22 Jonas Borgström :
> On 09/22/2011 01:25 AM, aaron morton wrote:
> *snip*
>> When you start a repair it will repair will the other nodes it
>> replicates data with. So you only need to run it every RF nodes. Start
>> it one one, watch the logs to see who it talks to and then start it on
>> the first node it does not talk to. And so on.

This is not totally true because of
https://issues.apache.org/jira/browse/CASSANDRA-2610.
Basically, doing this won't make sure the full cluster is in sync
(there is a fair
chance it will, but it's not guaranteed).
It will be true in 1.0 (though in 1.0 it will be simpler and more
efficient to just run
'nodetool repair --partitioner-range' on every node).


> Is this new in 0.8 or has it always been this way?
>
> From
> http://wiki.apache.org/cassandra/Operations#Frequency_of_nodetool_repair
>
> """
> Unless your application performs no deletes, it is vital that production
> clusters run nodetool repair periodically on all nodes in the cluster.
> """
>
> So for a 3 node cluster using RF=3, is it sufficient to run "nodetool
> repair" on one node?

Technically, in the 3 nodes RF=3 case, you would need to do repair on
2 nodes to make sure the cluster has been fully repaired. But it becomes
fairly complicated to know which nodes exactly once you get more than
3 nodes in the cluster or you have RF > 3, so to be safe I would advise
sticking to the wiki instruction (until 1.0 at least).

>
> / Jonas
>


Re: Moving to a new cluster

2011-09-22 Thread Philippe
The current load on the nodes is around 300g.
Le 22 sept. 2011 11:08, "aaron morton"  a écrit :
> the new nodes will have 1TB of data disk, but how much data will you put
on them?
>
> A
>
> -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 22/09/2011, at 7:23 PM, Philippe wrote:
>
>> Hi Aaron
>> Thanks for the reply
>>
>> I should hhave mentionned that all current nodes are running 0.8.4.
>> All current and future services have 2TB disks of which i have allocated
only half. I don't expect any issues here. Should I?
>>
>> Le 22 sept. 2011 01:26, "aaron morton"  a écrit
:
>> > How much data is on the nodes in cluster 1 and how much disk space on
cluster 2 ? Be aware that Cassandra 0.8 has an issue where repair can go
crazy and use a lot of space.
>> >
>> > If you are not regularly running repair I would also repair before the
move.
>> >
>> > The repair after the copy is a good idea but should technically not be
necessary. If you can practice the move watch the repair to see if much is
transferred (check the logs). There is always a small transfer, but if you
see data been transferred for several minutes I would investigate.
>> >
>> > When you start a repair it will repair will the other nodes it
replicates data with. So you only need to run it every RF nodes. Start it
one one, watch the logs to see who it talks to and then start it on the
first node it does not talk to. And so on.
>> >
>> > Add a snapshot before the clean (repair will also snapshot before it
runs)
>> >
>> > Scrub is not needed unless you are migrating or you have file errors.
>> >
>> > If your cluster is online, consider running the clean every RFth node
rather than all at once (e.g. 1,4, 7, 10 then 2,5,8,11). It will have less
impact on clients.
>> >
>> > Cheers
>> >
>> > -
>> > Aaron Morton
>> > Freelance Cassandra Developer
>> > @aaronmorton
>> > http://www.thelastpickle.com
>> >
>> > On 22/09/2011, at 10:27 AM, Philippe wrote:
>> >
>> >> Hello,
>> >> We're currently running on a 3-node RF=3 cluster. Now that we have a
better grip on things, we want to replace it with a 12-node RF=3 cluster of
"smaller" servers. So I wonder what the best way to move the data to the new
cluster would be. I can afford to stop writing to the current cluster for
whatever time is necessary. Has anyone written up something on this subject
?
>> >>
>> >> My plan is the following (nodes in cluster 1 are node1.1->1.3, nodes
in cluster 2 are node2.1->2.12)
>> >> stop writing to current cluster & drain it
>> >> get a snapshot on each node
>> >> Since it's RF=3, each node should have all the data, so assuming I set
the tokens correctly I would move the snapshot from node1.1 to node2.1, 2.2,
2.3 and 2.4 then node1.2->node2.5,2.6,2.,2.8, etc. This is because the range
for node1.1 is now spread across 2.1->2.4
>> >> Run repair & clean & scrub on each node (more or less in //)
>> >> What do you think ?
>> >> Thanks
>> >
>


Re: Cassandra yaml configuration

2011-09-22 Thread Sajith Kariyawasam
Thanks Aaron

On Thu, Sep 22, 2011 at 2:37 PM, aaron morton wrote:

> This is pretty up to date
> http://www.packtpub.com/cassandra-apache-high-performance-cookbook/book
>
> A
>
> -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 22/09/2011, at 7:07 PM, Maki Watanabe wrote:
>
> You have a chance to write it by your own. I'll buy one :-)
>
> maki
>
> 2011/9/22 Sajith Kariyawasam :
>
> Thanks Maki.
>
> If you came across with any other book supporting latest Cassandara
>
> versions, pls let me know.
>
>
> On Thu, Sep 22, 2011 at 12:03 PM, Maki Watanabe 
>
> wrote:
>
>
> The book is a bit out dated now.
>
> You should better to use cassandra-cli to define your application schema.
>
> Please refer to conf/schema-sample.txt and help in cassandra-cli.
>
>
> % cassandra-cli
>
> [default@unknown] help;
>
> [default@unknown] help create keyspace;
>
> [default@unknown] help create column family;
>
>
> You can load schema defined in text file by cassandra-cli:
>
> % cassandra-cli -h host -p port --file your-schema-definition.txt
>
>
> maki
>
>
>
>
> 2011/9/22 Sajith Kariyawasam :
>
> Hi all,
>
> Im refering to the book authored by Eben Hewitt, named Cassandra The
>
> Definitive Guide
>
>
> There, in the Sample Application chapter (Chapter 4), example 4.1, a
>
> sample
>
> schema is given in a file named "cassandra.yaml". (I have mentioned it
>
> below)
>
> I'm using Cassandra 0.8.6 version.
>
> My question is that, whether the given format of the file is correct? if
>
> so,
>
> where i have to mention in the cassandra configuration to load this yaml
>
> file?
>
> because the format of the sample schema  comes with Cassandra
>
> (conf/schema-sample.txt) is bit different from the sample given in the
>
> book.
>
>
> Schema definition in cassandra.yaml
>
> 
>
> keyspaces:
>
> - name: Hotelier
>
> replica_placement_strategy:
>
> org.apache.cassandra.locator.RackUnawareStrategy
>
> replication_factor: 1
>
> column_families:
>
> - name: Hotel
>
> compare_with: UTF8Type
>
> - name: HotelByCity
>
> compare_with: UTF8Type
>
> - name: Guest
>
> compare_with: BytesType
>
> - name: Reservation
>
> compare_with: TimeUUIDType
>
> - name: PointOfInterest
>
> column_type: Super
>
> compare_with: UTF8Type
>
> compare_subcolumns_with: UTF8Type
>
> - name: Room
>
> compare_with: BytesType
>
> compare_subcolumns_with: BytesType
>
> - name: RoomAvailability
>
> column_type: Super
>
> compare_with: BytesType
>
> compare_subcolumns_with: BytesType
>
>
> --
>
> Best Regards
>
> Sajith
>
>
>
>
>
> --
>
> w3m
>
>
>
>
> --
>
> Best Regards
>
> Sajith
>
>
>
>
>
> --
> w3m
>
>
>


-- 
Best Regards
Sajith


How to enable JNA for Cassandra on Windows?

2011-09-22 Thread Viktor Jevdokimov
Hi,

I'm trying without success to enable JNA for Cassandra on Windows.

Tried to place JNA 3.3.0 libs jna.jar and platform.jar into Cassandra 0.8.6
lib dir, but getting in log:
Unable to link C library. Native methods will be disabled.

What is missed or what is wrong?

One thing I've found on inet about JNA and Windows is this sample:

// Library is c for unix and msvcrt for windows
String libName = "c";
if (System.getProperty("os.name").contains("Windows"))
{
  libName = "msvcrt";
}

// Loading dynamically the library
CInterface demo = (CInterface) Native.loadLibrary(libName, CInterface.class);


from http://www.scriptol.com/programming/jna.php

while in Cassandra:

try
{
Native.register("c");
}
catch (NoClassDefFoundError e)
{
logger.info("JNA not found. Native methods will be disabled.");
}
catch (UnsatisfiedLinkError e)
{
logger.info("Unable to link C library. Native methods will be
disabled.");
}
catch (NoSuchMethodError e)
{
logger.warn("Obsolete version of JNA present; unable to
register C library. Upgrade to JNA 3.2.7 or later");
}


Is it true that for Windows Cassandra should do something like:

if (System.getProperty("os.name").contains("Windows"))
{
Native.register("msvcrt");
}
else
{
Native.register("c");
}



Thanks
Viktor


RE: Cassandra reconfiguration

2011-09-22 Thread Hiren Shah
Our RF is 2 and we are planning to keep that. Thanks for addressing the 
decommissioning puzzle. That is where I could not find any doc.

Hiren

From: aaron morton [mailto:aa...@thelastpickle.com]
Sent: Wednesday, September 21, 2011 6:01 PM
To: user@cassandra.apache.org
Subject: Re: Cassandra reconfiguration

What are the token assignments and what is the RF ?

Without knowing the details I would guess...

Make the RF changes you want for DC 1 and 2 and repair.
decomission the nodes in DC3 one at a time.

Cheers

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

On 22/09/2011, at 5:29 AM, Hiren Shah wrote:


Hi,

We have cassandra in production in three data centers with five nodes each. We 
are getting rid of one of the data centers, so I want to reconfig my cluster to 
two data centers, seven nodes each. I first need to shut down DC3. I have 
already shut down traffic to DC3 and am running repairs. My priority #1 is to 
maintain the stability of overall cluster (the two live data centers). Some 
data loss is tolerable, but it will be ideal if I can avoid that.

What is the best way to decommission entire data center? Should I issue 
decommission to the nodes one by one? Will that put additional load on 
remaining nodes in DC3? Or should I just shut them down and then run 
removetoken for these nodes? Or is there a better way?

Thanks in advance,
Hiren Shah




Performance degradation observed through embedded cassandra server - pointers needed

2011-09-22 Thread Roshan Dawrani
Hi,

We recently switched from Cassandra 0.7.2 to 0.8.5 and observing
considerable performance degradation in embedded server's response times
that we use in integration tests.

One thing that we do is that we truncate our app column families after each
integration test so that the next one gets a new DB slate (wierd? but with
RDBMS that we used earlier, we just rolled back the transaction to get rid
of changes done in an integration test. CF truncation is a costly workaround
for that, which we will be very happy to avoid if anyone knows some trick).

So, with the situation we are in, is anyone aware of any cassandra 0.8.5
cofiguration that can be tweaked to at least get the performance we were
getting with 0.7.2? Exactly after the upgrade, our test execution times have
gone up at least by 60-70%.

Some pointers please?

Thanks.

-- 
Roshan
Blog: http://roshandawrani.wordpress.com/
Twitter: @roshandawrani 
Skype: roshandawrani


Re: Performance degradation observed through embedded cassandra server - pointers needed

2011-09-22 Thread Edward Capriolo
On Thu, Sep 22, 2011 at 9:27 AM, Roshan Dawrani wrote:

> Hi,
>
> We recently switched from Cassandra 0.7.2 to 0.8.5 and observing
> considerable performance degradation in embedded server's response times
> that we use in integration tests.
>
> One thing that we do is that we truncate our app column families after each
> integration test so that the next one gets a new DB slate (wierd? but with
> RDBMS that we used earlier, we just rolled back the transaction to get rid
> of changes done in an integration test. CF truncation is a costly workaround
> for that, which we will be very happy to avoid if anyone knows some trick).
>
> So, with the situation we are in, is anyone aware of any cassandra 0.8.5
> cofiguration that can be tweaked to at least get the performance we were
> getting with 0.7.2? Exactly after the upgrade, our test execution times have
> gone up at least by 60-70%.
>
> Some pointers please?
>
> Thanks.
>
> --
> Roshan
> Blog: http://roshandawrani.wordpress.com/
> Twitter: @roshandawrani 
> Skype: roshandawrani
>
>
1) Should should try to dig in an determine why the truncate is slower. Look
for related jira issues on truncation.

Cassandra had some re-entrant code you could fork a JVM each test and use
the CassandraServiceDataCleaner. (However multiple startups could end up
causing more overhead then the truncation)

I avoid this problem by using a different column family and or a different
keyspaces for all my unit tests in a single class. Each class bring up a new
embedded cluster and uses the data cleaner to sanitize the data directories.
So essentially I never call truncate.


progress of sstableloader keeps 0?

2011-09-22 Thread Yan Chunlu
I took a snapshot of one of my node in a cluster 0.7.4(N=RF=3).   use
sstableloader to load the snapshot data to another 1 node cluster(N=RF=1).


after execute  "bin/sstableloader  /disk2/mykeyspace/"


it says"Starting client (and waiting 30 seconds for gossip) ..."
"Streaming revelant part of  cf1.db. to [10.23.2.4]"

then showing the progress indicator and stopped. nothing changed after
then.

progress: [/10.28.53.16 1/72 (0)] [total: 0 - 0MB/s (avg: 0MB/s)]]]


I use nodetool to check the node 10.23.2.4, nothing changed. no data copied
to it. and the data dir also keep its original size. is there anything
wrong? how can I tell what was going on there?

thanks!


Re: Moving to a new cluster

2011-09-22 Thread Yan Chunlu
hi Aaron:

could you explain more about the issue about repair make space usage going
crazy?

I am planning to upgrade my cluster from 0.7.4 to 0.8.6, which is because
the repair never works on 0.7.4 for me.
more specifically,
CASSANDRA-2280
 and CASSANDRA-2156 .


from your description, I really worried about 0.8.6 might make it worse...

thanks!

On Thu, Sep 22, 2011 at 7:25 AM, aaron morton wrote:

> How much data is on the nodes in cluster 1 and how much disk space on
> cluster 2 ? Be aware that Cassandra 0.8 has an issue where repair can go
> crazy and use a lot of space.
>
> If you are not regularly running repair I would also repair before the
> move.
>
> The repair after the copy is a good idea but should technically not be
> necessary. If you can practice the move watch the repair to see if much is
> transferred (check the logs). There is always a small transfer, but if you
> see data been transferred for several minutes I would investigate.
>
> When you start a repair it will repair will the other nodes it replicates
> data with. So you only need to run it every RF nodes. Start it one one,
> watch the logs to see who it talks to and then start it on the first node it
> does not talk to. And so on.
>
> Add a snapshot before the clean (repair will also snapshot before it runs)
>
> Scrub is not needed unless you are migrating or you have file errors.
>
> If your cluster is online, consider running the clean every RFth node
> rather than all at once (e.g. 1,4, 7, 10 then 2,5,8,11). It will have less
> impact on clients.
>
> Cheers
>
>  -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 22/09/2011, at 10:27 AM, Philippe wrote:
>
> Hello,
> We're currently running on a 3-node RF=3 cluster. Now that we have a better
> grip on things, we want to replace it with a 12-node RF=3 cluster of
> "smaller" servers. So I wonder what the best way to move the data to the new
> cluster would be. I can afford to stop writing to the current cluster for
> whatever time is necessary. Has anyone written up something on this subject
> ?
>
> My plan is the following (nodes in cluster 1 are node1.1->1.3, nodes in
> cluster 2 are node2.1->2.12)
>
>- stop writing to current cluster & drain it
>- get a snapshot on each node
>- Since it's RF=3, each node should have all the data, so assuming I
>set the tokens correctly I would move the snapshot from node1.1 to node2.1,
>2.2, 2.3 and 2.4 then node1.2->node2.5,2.6,2.,2.8, etc. This is because the
>range for node1.1 is now spread across 2.1->2.4
>- Run repair & clean & scrub on each node (more or less in //)
>
> What do you think ?
> Thanks
>
>
>


Re: Unable to create compaction marker

2011-09-22 Thread Daning
Thank you guys. I don't think have permission issue or out of space. 
might be ulimit set to low(1024), we will change ulimit -Hn and unlimit 
-Sn to see if that could solve the problem.


Daning

On 09/22/2011 01:12 AM, aaron morton wrote:

It's in the yaml file…

# directories where Cassandra should store data on disk.
data_file_directories:
 - /var/lib/cassandra/data

The permissions are normally cassandra:cassandra

Cheers

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

On 22/09/2011, at 12:06 PM, Daning wrote:


Thanks Jonathan. where is the data directory configured? since I did not any 
permission problem.

Daning

On 09/21/2011 11:01 AM, Jonathan Ellis wrote:

Means Cassandra couldn't create an empty file in the data directory
designating a sstable as compacted.  I'd look for permissions
problems.

Short term there is no dire consequence, although it will keep
re-compacting that sstable.  Longer term you'll run out of disk space
since nothing gets deleted.

On Wed, Sep 21, 2011 at 1:44 PM, Daning   wrote:

I got this exception in system.log several times a day, do you have idea
what caused this problem and what is the consequence?


ERROR [CompactionExecutor:12] 2011-09-15 14:29:19,578
AbstractCassandraDaemon.java (line 139) Fatal exception in thread
Thread[CompactionExecutor:12,1,main]
java.io.IOError: java.io.IOException: Unable to create compaction marker
at
org.apache.cassandra.io.sstable.SSTableReader.markCompacted(SSTableReader.java:642)
at
org.apache.cassandra.db.DataTracker.removeOldSSTablesSize(DataTracker.java:280)
at org.apache.cassandra.db.DataTracker.replace(DataTracker.java:253)
at
org.apache.cassandra.db.DataTracker.replaceCompactedSSTables(DataTracker.java:214)
at
org.apache.cassandra.db.ColumnFamilyStore.replaceCompactedSSTables(ColumnFamilyStore.java:1094)
at
org.apache.cassandra.db.compaction.CompactionManager.doCompactionWithoutSizeEstimation(CompactionManager.java:599)
at
org.apache.cassandra.db.compaction.CompactionManager.doCompaction(CompactionManager.java:507)
at
org.apache.cassandra.db.compaction.CompactionManager$1.call(CompactionManager.java:142)
at
org.apache.cassandra.db.compaction.CompactionManager$1.call(CompactionManager.java:108)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Unable to create compaction marker
at
org.apache.cassandra.io.sstable.SSTableReader.markCompacted(SSTableReader.java:638)
... 13 more


Thank you in advance.

Daning







Re: Thrift 7

2011-09-22 Thread Suman Ghosh
Thanks Sylvain / Aaron!

Can you tell me how to join the "Thrift mailing list"?

Thanks,
Suman.

On Thu, Sep 22, 2011 at 2:37 PM, aaron morton wrote:

> I'm a bit confused about what you are trying to do.
>
> Are you trying to install thrift on windows ? Best I can to do help is
> point you to the readme file, or this
> http://wiki.apache.org/thrift/ThriftInstallationWin32
>
> You may get more help on the thrift email list.
>
> You not need to install thrift to use Cassandra, only to rebuild the
> interfaces which is generally something client developers do.
>
> Cheers
>
>
>  -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 22/09/2011, at 5:46 PM, Suman Ghosh wrote:
>
> Any suggestions on this, folks?
>
>
> On Tue, Sep 6, 2011 at 12:59 AM, tushar pal  wrote:
>
>> Hi,
>> I am facing some problem using Thrift 7.
>> I downloaded the tar file.I downloaded the windows exe too for . Created a
>> thrift jar from the lib java path and then generated the java class from
>> tutorial.thrift file.Now while I use run the ant file inside example I got
>> some error that some of the package are used in that generated java files do
>> not exists in that generated thrift jar.
>> Can anybody please help ?
>>
>> --
>> TUSHAR KANTI PAL
>>
>>
>>
>
>
> --
> Get me at GMail--> sumanthewhiz[at]gmail[dot]com
> ... or there's Yahoo --> sumanthewhiz[at]yahoo[dot]com
>
>
>


-- 
Get me at GMail--> sumanthewhiz[at]gmail[dot]com
... or there's Yahoo --> sumanthewhiz[at]yahoo[dot]com


Lots of GC in log

2011-09-22 Thread Daning
We are testing Cassandra with pretty big load, I saw frequent GCs in the 
log, Do you have suggestion about how to reduce them?


 NFO [ScheduledTasks:1] 2011-09-22 09:38:41,080 GCInspector.java (line 
122) GC for ParNew: 297 ms for 1 collections, 2503106624 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:39:20,873 GCInspector.java (line 
122) GC for ParNew: 376 ms for 1 collections, 2533372976 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:39:22,203 GCInspector.java (line 
122) GC for ParNew: 352 ms for 1 collections, 2543060640 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:39:28,286 GCInspector.java (line 
122) GC for ParNew: 204 ms for 1 collections, 2643405616 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:39:57,827 GCInspector.java (line 
122) GC for ParNew: 231 ms for 1 collections, 2684999576 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:39:59,892 GCInspector.java (line 
122) GC for ParNew: 262 ms for 1 collections, 2592862320 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:40:01,901 GCInspector.java (line 
122) GC for ParNew: 269 ms for 1 collections, 2707133848 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:40:46,471 GCInspector.java (line 
122) GC for ParNew: 340 ms for 1 collections, 2648946352 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:40:48,522 GCInspector.java (line 
122) GC for ParNew: 683 ms for 1 collections, 2744305224 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:40:50,784 GCInspector.java (line 
122) GC for ParNew: 370 ms for 1 collections, 2713584488 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:41:36,857 GCInspector.java (line 
122) GC for ParNew: 241 ms for 1 collections, 2782038560 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:41:50,126 GCInspector.java (line 
122) GC for ParNew: 449 ms for 1 collections, 2928576048 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:42:05,399 GCInspector.java (line 
122) GC for ParNew: 219 ms for 1 collections, 2869447448 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:42:30,139 GCInspector.java (line 
122) GC for ParNew: 207 ms for 1 collections, 3021355184 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:42:31,326 GCInspector.java (line 
122) GC for ParNew: 341 ms for 1 collections, 2920592304 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:42:32,815 GCInspector.java (line 
122) GC for ParNew: 534 ms for 1 collections, 3024423936 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:42:34,822 GCInspector.java (line 
122) GC for ParNew: 216 ms for 1 collections, 3136655600 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:42:42,028 GCInspector.java (line 
122) GC for ParNew: 360 ms for 1 collections, 3053516464 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:42:43,544 GCInspector.java (line 
122) GC for ParNew: 769 ms for 1 collections, 3072173664 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:42:44,584 GCInspector.java (line 
122) GC for ParNew: 279 ms for 1 collections, 3094692872 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:43:00,788 GCInspector.java (line 
122) GC for ParNew: 367 ms for 1 collections, 3192674736 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:43:37,051 GCInspector.java (line 
122) GC for ParNew: 350 ms for 1 collections, 3400034520 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:43:38,138 GCInspector.java (line 
122) GC for ParNew: 270 ms for 1 collections, 3212172456 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:44:00,679 GCInspector.java (line 
122) GC for ParNew: 301 ms for 1 collections, 3239850624 used; max is 
8015314944
 INFO [ScheduledTasks:1] 2011-09-22 09:44:02,690 GCInspector.java (line 
122) GC for ParNew: 534 ms for 1 collections, 3308763856 used; max is 
8015314944


Thanks in advance.

Daning


Re: Tool for SQL -> Cassandra data movement

2011-09-22 Thread Nehal Mehta
We are trying to carry out same stuff, but instead of migrating into JSON,
we are exporting into CSV and than importing CSV into Cassandra.  Which DB
are you currently using?

Thanks,
Nehal Mehta.

2011/9/22 Radim Kolar 

> I need tool which is able to dump tables via JDBC into JSON format for
> cassandra import. I am pretty sure that somebody already wrote that.
>
> Are there tools which can do direct JDBC -> cassandra import?
>


Re: Tool for SQL -> Cassandra data movement

2011-09-22 Thread Jeremy Hanna
Take a look at http://www.datastax.com/dev/blog/bulk-loading

I'm sure there is a way to make it more seamless for what you want to do and it 
could be built on, but the recent bulk loading additions will provide the best 
foundation.

On Sep 22, 2011, at 12:25 PM, Nehal Mehta wrote:

> We are trying to carry out same stuff, but instead of migrating into JSON, we 
> are exporting into CSV and than importing CSV into Cassandra.  Which DB are 
> you currently using? 
> 
> Thanks,
> Nehal Mehta. 
> 
> 2011/9/22 Radim Kolar 
> I need tool which is able to dump tables via JDBC into JSON format for 
> cassandra import. I am pretty sure that somebody already wrote that.
> 
> Are there tools which can do direct JDBC -> cassandra import?
> 



RE: Cassandra reconfiguration

2011-09-22 Thread Hiren Shah
I just started decommissioning one of the nodes. It is streaming data to other 
nodes in the data center, though, which seems waste of time because all the 
nodes will be going away. Wouldn't it be better to just bring cassandra down on 
these nodes? And then run removetoken or change the topology and restart nodes 
on other two datacenters?

Does it make sense to issue decommission to other nodes before one is finished? 
That should also avoid the unnecessary streaming in theory.

Thanks,
Hiren

From: Hiren Shah [mailto:hs...@dotomi.com]
Sent: Thursday, September 22, 2011 8:18 AM
To: user@cassandra.apache.org
Subject: RE: Cassandra reconfiguration

Our RF is 2 and we are planning to keep that. Thanks for addressing the 
decommissioning puzzle. That is where I could not find any doc.

Hiren

From: aaron morton [mailto:aa...@thelastpickle.com]
Sent: Wednesday, September 21, 2011 6:01 PM
To: user@cassandra.apache.org
Subject: Re: Cassandra reconfiguration

What are the token assignments and what is the RF ?

Without knowing the details I would guess...

Make the RF changes you want for DC 1 and 2 and repair.
decomission the nodes in DC3 one at a time.

Cheers

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

On 22/09/2011, at 5:29 AM, Hiren Shah wrote:

Hi,

We have cassandra in production in three data centers with five nodes each. We 
are getting rid of one of the data centers, so I want to reconfig my cluster to 
two data centers, seven nodes each. I first need to shut down DC3. I have 
already shut down traffic to DC3 and am running repairs. My priority #1 is to 
maintain the stability of overall cluster (the two live data centers). Some 
data loss is tolerable, but it will be ideal if I can avoid that.

What is the best way to decommission entire data center? Should I issue 
decommission to the nodes one by one? Will that put additional load on 
remaining nodes in DC3? Or should I just shut them down and then run 
removetoken for these nodes? Or is there a better way?

Thanks in advance,
Hiren Shah




Re: Tool for SQL -> Cassandra data movement

2011-09-22 Thread Radim Kolar

Dne 22.9.2011 19:25, Nehal Mehta napsal(a):
We are trying to carry out same stuff, but instead of migrating into 
JSON, we are exporting into CSV and than importing CSV into Cassandra. 

You are right CSV seems to be more portable


Which DB are you currently using?

Postgresql and Apache Derby.


Re: progress of sstableloader keeps 0?

2011-09-22 Thread Jonathan Ellis
Did you check for errors in logs on both loader + target?

On Thu, Sep 22, 2011 at 10:52 AM, Yan Chunlu  wrote:
> I took a snapshot of one of my node in a cluster 0.7.4(N=RF=3).   use
> sstableloader to load the snapshot data to another 1 node cluster(N=RF=1).
>
> after execute  "bin/sstableloader  /disk2/mykeyspace/"
>
> it says"Starting client (and waiting 30 seconds for gossip) ..."
> "Streaming revelant part of  cf1.db. to [10.23.2.4]"
> then showing the progress indicator and stopped. nothing changed after
> then.
> progress: [/10.28.53.16 1/72 (0)] [total: 0 - 0MB/s (avg: 0MB/s)]]]
>
> I use nodetool to check the node 10.23.2.4, nothing changed. no data copied
> to it. and the data dir also keep its original size. is there anything
> wrong? how can I tell what was going on there?
> thanks!



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


Storing (python) objects

2011-09-22 Thread Ian Danforth
All,

 I find myself considering storing serialized python dicts in Cassandra. I'd
like to store fairly complex, nested dicts, and it's just easier to do this
rather than work out a lot of super columns / columns etc.

 Do others find themselves storing serialized data structures in Cassandra
or is this generally a sign of doing something wrong?

 Thanks in advance!

Ian


Re: Lots of GC in log

2011-09-22 Thread Peter Schuller
> We are testing Cassandra with pretty big load, I saw frequent GCs in the
> log, Do you have suggestion about how to reduce them?

Do you have any actual problem that you are observing?

Frequent young-generation GC:s (ParNew) are expected. If you want to
cut down on the length of them you may want to change the JVM settings
in cassandra-env.sh to use a smaller young-gen, but that will probably
cause overall GC cost to go up as more data is promoted into old gen.

-- 
/ Peter Schuller (@scode on twitter)


Re: Storing (python) objects

2011-09-22 Thread Aaron Turner
On Thu, Sep 22, 2011 at 11:28 AM, Ian Danforth  wrote:
> All,
>  I find myself considering storing serialized python dicts in Cassandra. I'd
> like to store fairly complex, nested dicts, and it's just easier to do this
> rather than work out a lot of super columns / columns etc.
>  Do others find themselves storing serialized data structures in Cassandra
> or is this generally a sign of doing something wrong?
>  Thanks in advance!
> Ian

I just convert my ruby objects to json strings and store it that way.
Works just fine and there's no advantage to use SuperColumns since
Cassandra has to read all the supercolumns anyways, so storing as json
requires less overhead.


-- 
Aaron Turner
http://synfin.net/         Twitter: @synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"


Re: [VOTE] Release Mojo's Cassandra Maven Plugin 0.8.6-1

2011-09-22 Thread Nate McCall
+1

On Wed, Sep 21, 2011 at 4:39 PM, Colin Taylor  wrote:
> +1 (non binding but lgtm)
>
> On Wed, Sep 21, 2011 at 2:27 AM, Stephen Connolly
>  wrote:
>> Hi,
>>
>> I'd like to release version 0.8.6-1 of Mojo's Cassandra Maven Plugin
>> to sync up with the recent 0.8.6 release of Apache Cassandra.
>>
>>
>> We solved 2 issues:
>> http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=12121&version=17425
>>
>>
>> Staging Repository:
>> https://nexus.codehaus.org/content/repositories/orgcodehausmojo-010/
>>
>> Site:
>> http://mojo.codehaus.org/cassandra-maven-plugin/index.html
>>
>> SCM Tag:
>> https://svn.codehaus.org/mojo/tags/cassandra-maven-plugin-0.8.6-1@14748
>>
>>  [ ] +1 Yeah! fire ahead oh and the blind man on the galloping horse
>> says it looks fine too.
>>  [ ] 0 Mehhh! like I care, I don't have any opinions either, I'd
>> follow somebody else if only I could decide who
>>  [ ] -1 No! wait up there I have issues (in general like, ya know,
>> and being a trouble-maker is only one of them)
>>
>> The vote is open for 72 hours and will succeed by lazy consensus.
>>
>> Cheers
>>
>> -Stephen
>>
>> P.S.
>>  In the interest of ensuring (more is) better testing, this vote is
>> also open to subscribers of the dev and user@cassandra.apache.org
>> mailing lists
>>
>


Search over composite Column and Super Column name

2011-09-22 Thread Renato Costa
Hi,

I started do modeling my application over cassandra data model. I will have
to use composite Super columns name, i.e. "username:userid", i know that is
a lot of different ways to deal with this case, but once i have modeled with
composite Super Columns name is there any way to make a sarch over only one
part of the column name? And if so, it works for normal columns too?

Sorry about the English, I know it is not so good, and thanks for answers.


Re: Lots of GC in log

2011-09-22 Thread Daning
Thanks Peter. I saw cpu was shooting much higher. I am not sure if 
frequent GCs are caused by improperly sized generations. I'd like to get 
some tunning tips, or good document about Cassandra tuning.


Daning

On 09/22/2011 12:23 PM, Peter Schuller wrote:

We are testing Cassandra with pretty big load, I saw frequent GCs in the
log, Do you have suggestion about how to reduce them?

Do you have any actual problem that you are observing?

Frequent young-generation GC:s (ParNew) are expected. If you want to
cut down on the length of them you may want to change the JVM settings
in cassandra-env.sh to use a smaller young-gen, but that will probably
cause overall GC cost to go up as more data is promoted into old gen.





Re: Search over composite Column and Super Column name

2011-09-22 Thread Konstantin Naryshkin
One thing you can do is search over the range from "username:" to "username;". 
"username:" is the first possible string starting with "username:". "username;" 
is the first possible sting after all of the stings that start with "username:" 
. This works because ; is the character right after : in ASCII. I believe that 
UNICODE is ordered similarly to ASCII, though I am not 100% sure on that issue.

- Original Message -
From: "Renato Costa" 
To: user@cassandra.apache.org
Sent: Thursday, September 22, 2011 6:35:52 PM
Subject: Search over composite Column and Super Column name

Hi, 


I started do modeling my application over cassandra data model. I will have to 
use composite Super columns name, i.e. "username:userid", i know that is a lot 
of different ways to deal with this case, but once i have modeled with 
composite Super Columns name is there any way to make a sarch over only one 
part of the column name? And if so, it works for normal columns too? 


Sorry about the English, I know it is not so good, and thanks for answers. 


Re: Storing (python) objects

2011-09-22 Thread Alexis Lê-Quôc
On Thu, Sep 22, 2011 at 3:50 PM, Aaron Turner  wrote:

> On Thu, Sep 22, 2011 at 11:28 AM, Ian Danforth 
> wrote:
> > All,
> >  I find myself considering storing serialized python dicts in Cassandra.
> I'd
> > like to store fairly complex, nested dicts, and it's just easier to do
> this
> > rather than work out a lot of super columns / columns etc.
> >  Do others find themselves storing serialized data structures in
> Cassandra
> > or is this generally a sign of doing something wrong?
> >  Thanks in advance!
> > Ian
>
> I just convert my ruby objects to json strings and store it that way.
> Works just fine and there's no advantage to use SuperColumns since
> Cassandra has to read all the supercolumns anyways, so storing as json
> requires less overhead.
>
>
> --
> Aaron Turner
> http://synfin.net/ Twitter: @synfinatic
> http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix &
> Windows
> Those who would give up essential Liberty, to purchase a little temporary
> Safety, deserve neither Liberty nor Safety.
> -- Benjamin Franklin
> "carpe diem quam minimum credula postero"
>

For data accessed through a single path, I use the same trick: pickle, bz2
and insert.

-- 
Alexis Lê-Quôc | Datadog, Inc. | @alq


Re: LevelDB type compaction

2011-09-22 Thread mcasandra
Can someone please help me understand this a little bit?

--
View this message in context: 
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/LevelDB-type-compaction-tp6798334p6822344.html
Sent from the cassandra-u...@incubator.apache.org mailing list archive at 
Nabble.com.


Re: Moving to a new cluster

2011-09-22 Thread Zhu Han
On Thu, Sep 22, 2011 at 11:04 PM, Yan Chunlu  wrote:

>
> hi Aaron:
>
> could you explain more about the issue about repair make space usage going
> crazy?
>

I guess repair defers the compaction progress as it brings a lot of load.
For update-heavy workload, the space usage goes higher and higher during
repair.



>
> I am planning to upgrade my cluster from 0.7.4 to 0.8.6, which is because
> the repair never works on 0.7.4 for me.
> more specifically, 
> CASSANDRA-2280
>  and CASSANDRA-2156 
> .
>
>
> from your description, I really worried about 0.8.6 might make it worse...
>
> thanks!
>
> On Thu, Sep 22, 2011 at 7:25 AM, aaron morton wrote:
>
>> How much data is on the nodes in cluster 1 and how much disk space on
>> cluster 2 ? Be aware that Cassandra 0.8 has an issue where repair can go
>> crazy and use a lot of space.
>>
>> If you are not regularly running repair I would also repair before the
>> move.
>>
>> The repair after the copy is a good idea but should technically not be
>> necessary. If you can practice the move watch the repair to see if much is
>> transferred (check the logs). There is always a small transfer, but if you
>> see data been transferred for several minutes I would investigate.
>>
>> When you start a repair it will repair will the other nodes it replicates
>> data with. So you only need to run it every RF nodes. Start it one one,
>> watch the logs to see who it talks to and then start it on the first node it
>> does not talk to. And so on.
>>
>> Add a snapshot before the clean (repair will also snapshot before it runs)
>>
>> Scrub is not needed unless you are migrating or you have file errors.
>>
>> If your cluster is online, consider running the clean every RFth node
>> rather than all at once (e.g. 1,4, 7, 10 then 2,5,8,11). It will have less
>> impact on clients.
>>
>> Cheers
>>
>>  -
>> Aaron Morton
>> Freelance Cassandra Developer
>> @aaronmorton
>> http://www.thelastpickle.com
>>
>> On 22/09/2011, at 10:27 AM, Philippe wrote:
>>
>> Hello,
>> We're currently running on a 3-node RF=3 cluster. Now that we have a
>> better grip on things, we want to replace it with a 12-node RF=3 cluster of
>> "smaller" servers. So I wonder what the best way to move the data to the new
>> cluster would be. I can afford to stop writing to the current cluster for
>> whatever time is necessary. Has anyone written up something on this subject
>> ?
>>
>> My plan is the following (nodes in cluster 1 are node1.1->1.3, nodes in
>> cluster 2 are node2.1->2.12)
>>
>>- stop writing to current cluster & drain it
>>- get a snapshot on each node
>>- Since it's RF=3, each node should have all the data, so assuming I
>>set the tokens correctly I would move the snapshot from node1.1 to 
>> node2.1,
>>2.2, 2.3 and 2.4 then node1.2->node2.5,2.6,2.,2.8, etc. This is because 
>> the
>>range for node1.1 is now spread across 2.1->2.4
>>- Run repair & clean & scrub on each node (more or less in //)
>>
>> What do you think ?
>> Thanks
>>
>>
>>
>


is it possible for light-traffic CF to hold down many commit logs?

2011-09-22 Thread Yang
in 1.0.0  we don't have memtable_throughput for each individual CF ,
and instead
which memtable/CF to flush is determined by "largest
getTotalMemtableLiveSize() ".
(MeteredFlusher.java line 81)


what would happen in the following case ? : I have only 2 CF, the
traffic for one CF is 1000 times that
of the second CF,
so the high-traffic CF constantly triggers total mem threshold , and
every time, the busy CF is flushed.

but the light-traffic CF is never flushed ( well, until we have
flushed about 1000 times the busy CF),
now we are left with many commit logs , each of them containing a few
entries for the light-traffic table. we have to keep these commit logs
because these entries are not flushed to sstable yet.

then there are 2 problems: 1) to persist the few records from the
light-traffic CF, you have to keep 1000 times the commit logs
necessary, taking up disk space 2) when you do a recover on server
restart, you'll have to read through all those commit logs .

does the above hypothesis sound right?

Thanks
Yang


Re: Tool for SQL -> Cassandra data movement

2011-09-22 Thread Nehal Mehta
Hi Ramdin,

I have cleaned up my code that imports CSV into Cassandra and I have put it
open on https://github.com/nehalmehta/CSV2Cassandra. Have a look if it is
useful to you.

I have used Hector instead of sstableloader. For me it was necessary to have
consistency level of EACH_QUORUM.

Thanks,
Nehal Mehta.

On Thu, Sep 22, 2011 at 11:22 PM, Radim Kolar  wrote:

> Dne 22.9.2011 19:25, Nehal Mehta napsal(a):
>
>  We are trying to carry out same stuff, but instead of migrating into JSON,
>> we are exporting into CSV and than importing CSV into Cassandra.
>>
> You are right CSV seems to be more portable
>
>
>  Which DB are you currently using?
>>
> Postgresql and Apache Derby.
>


MessagingService.sendOneWay sending blank bytes?

2011-09-22 Thread Greg Hinkle
I noticed that on the 0.8 branch the implementation of 
MessagingService.sendOneWay is building up a DataOutputBuffer with a default 
size of 128 bytes, but then sending it as the full buffer no matter how many 
bytes the the data takes. I believe it should be calling 
DataOutputBuffer.asByteArray() or copying just up to the length() into the 
ByteBuffer. This means it appears to be wasting on around 40 to 80 bytes on 
every message. This really adds up in a big cluster.

It looks like things are different in trunk, but can anyone confirm this bug in 
0.8? Thanks. 


Greg Hinkle



Re: Possibility of going OOM using get_count

2011-09-22 Thread aaron morton
Offsets have been discussed in previously. IIRC the main concerns were either:

There is no way to reliably count to start the offset, i.e. we do not lock the 
row

Or performance related in, as there is not a reliable way to skip 10,000 
columns other than counting 10,000 columns. With a start col we can search. 

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

On 22/09/2011, at 8:50 PM, Boris Yen wrote:

> I was wondering if it is possible to use similar way as CASSANDRA-2894 to 
> have the slice_predict support the offset concept? With the offset, it would 
> be much easier to implement the paging from the client side.
> 
> Boris
> 
> On Mon, Sep 19, 2011 at 9:45 PM, Jonathan Ellis  wrote:
> Unfortunately no, because you don't know what the actual
> last-column-counted was.
> 
> On Mon, Sep 19, 2011 at 4:25 AM, aaron morton  wrote:
> > get_count() supports the same predicate as get_slice. So you can implement
> > the paging yourself.
> > Cheers
> > -
> > Aaron Morton
> > Freelance Cassandra Developer
> > @aaronmorton
> > http://www.thelastpickle.com
> > On 19/09/2011, at 8:45 PM, Tharindu Mathew wrote:
> >
> >
> > On Mon, Sep 19, 2011 at 12:40 PM, Benoit Perroud  wrote:
> >>
> >> The workaround for 0.7 is calling get_slice and count on client side.
> >> It's heavier, sure, but you will then be able to set start column
> >> accordingly.
> >
> > I was afraid of that :(
> > Will follow that method. Thanks.
> >>
> >>
> >> 2011/9/19 Tharindu Mathew :
> >> > Thanks Aaron and Jake for the replies.
> >> > Any chance of a possible workaround to use for Cassandra 0.7?
> >> >
> >> > On Mon, Sep 19, 2011 at 3:48 AM, aaron morton 
> >> > wrote:
> >> >>
> >> >> Cool
> >> >> Thanks, A
> >> >> -
> >> >> Aaron Morton
> >> >> Freelance Cassandra Developer
> >> >> @aaronmorton
> >> >> http://www.thelastpickle.com
> >> >> On 19/09/2011, at 9:55 AM, Jake Luciani wrote:
> >> >>
> >> >> This is fixed in 1.0
> >> >> https://issues.apache.org/jira/browse/CASSANDRA-2894
> >> >>
> >> >> On Sun, Sep 18, 2011 at 2:16 PM, Tharindu Mathew 
> >> >> wrote:
> >> >>>
> >> >>> Hi everyone,
> >> >>> I noticed this line in the API docs,
> >> >>>
> >> >>> The method is not O(1). It takes all the columns from disk to
> >> >>> calculate
> >> >>> the answer. The only benefit of the method is that you do not need to
> >> >>> pull
> >> >>> all the columns over Thrift interface to count them.
> >> >>>
> >> >>> Does this mean if a row has a large number of columns calling this
> >> >>> method
> >> >>> might make it go OOM?
> >> >>> Thanks in advance.
> >> >>> --
> >> >>> Regards,
> >> >>>
> >> >>> Tharindu
> >> >>> blog: http://mackiemathew.com/
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> http://twitter.com/tjake
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Regards,
> >> >
> >> > Tharindu
> >> > blog: http://mackiemathew.com/
> >> >
> >
> >
> >
> > --
> > Regards,
> >
> > Tharindu
> > blog: http://mackiemathew.com/
> >
> >
> 
> 
> 
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
> 



Re: Thrift 7

2011-09-22 Thread aaron morton
http://thrift.apache.org/mailing/

Cheers

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

On 23/09/2011, at 4:50 AM, Suman Ghosh wrote:

> Thanks Sylvain / Aaron!
> 
> Can you tell me how to join the "Thrift mailing list"?
> 
> Thanks,
> Suman.
> 
> On Thu, Sep 22, 2011 at 2:37 PM, aaron morton  wrote:
> I'm a bit confused about what you are trying to do. 
> 
> Are you trying to install thrift on windows ? Best I can to do help is point 
> you to the readme file, or this 
> http://wiki.apache.org/thrift/ThriftInstallationWin32
> 
> You may get more help on the thrift email list. 
> 
> You not need to install thrift to use Cassandra, only to rebuild the 
> interfaces which is generally something client developers do.  
> 
> Cheers
> 
> 
> -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
> 
> On 22/09/2011, at 5:46 PM, Suman Ghosh wrote:
> 
>> Any suggestions on this, folks?
>> 
>> 
>> On Tue, Sep 6, 2011 at 12:59 AM, tushar pal  wrote:
>> Hi,
>> I am facing some problem using Thrift 7.
>> I downloaded the tar file.I downloaded the windows exe too for . Created a 
>> thrift jar from the lib java path and then generated the java class from 
>> tutorial.thrift file.Now while I use run the ant file inside example I got 
>> some error that some of the package are used in that generated java files do 
>> not exists in that generated thrift jar.
>> Can anybody please help ?
>> 
>> -- 
>> TUSHAR KANTI PAL
>> 
>> 
>> 
>> 
>> 
>> -- 
>> Get me at GMail--> sumanthewhiz[at]gmail[dot]com
>> ... or there's Yahoo --> sumanthewhiz[at]yahoo[dot]com
> 
> 
> 
> 
> -- 
> Get me at GMail--> sumanthewhiz[at]gmail[dot]com
> ... or there's Yahoo --> sumanthewhiz[at]yahoo[dot]com



Re: Cassandra reconfiguration

2011-09-22 Thread aaron morton
> Our RF is 2 
Are you using the SimpleStrategy or the NetworkTopologyStrategy ? I assumed NTS 
in a multi DC setup. 

I think I sent before my brain caught up before. 

I was thinking that if you had an NTS setup like [ {DC1 : 3}, {DC2: 3}, 
{DC3:3}] you would change it to 
[ {DC1 :3}, {DC2:3}, {DC3 :0}] and then decommission the nodes in DC3. 

I dont want to say to much more without knowing how the data is distributed, 
the token assignments and the placement strategy. 

Cheers


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

On 23/09/2011, at 5:46 AM, Hiren Shah wrote:

> I just started decommissioning one of the nodes. It is streaming data to 
> other nodes in the data center, though, which seems waste of time because all 
> the nodes will be going away. Wouldn’t it be better to just bring cassandra 
> down on these nodes? And then run removetoken or change the topology and 
> restart nodes on other two datacenters?
>  
> Does it make sense to issue decommission to other nodes before one is 
> finished? That should also avoid the unnecessary streaming in theory.
>  
> Thanks,
> Hiren
>  
> From: Hiren Shah [mailto:hs...@dotomi.com] 
> Sent: Thursday, September 22, 2011 8:18 AM
> To: user@cassandra.apache.org
> Subject: RE: Cassandra reconfiguration
>  
> Our RF is 2 and we are planning to keep that. Thanks for addressing the 
> decommissioning puzzle. That is where I could not find any doc.
>  
> Hiren
>  
> From: aaron morton [mailto:aa...@thelastpickle.com] 
> Sent: Wednesday, September 21, 2011 6:01 PM
> To: user@cassandra.apache.org
> Subject: Re: Cassandra reconfiguration
>  
> What are the token assignments and what is the RF ? 
>  
> Without knowing the details I would guess…
>  
> Make the RF changes you want for DC 1 and 2 and repair. 
> decomission the nodes in DC3 one at a time. 
>  
> Cheers
>  
> -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
>  
> On 22/09/2011, at 5:29 AM, Hiren Shah wrote:
>  
> 
> Hi,
>  
> We have cassandra in production in three data centers with five nodes each. 
> We are getting rid of one of the data centers, so I want to reconfig my 
> cluster to two data centers, seven nodes each. I first need to shut down DC3. 
> I have already shut down traffic to DC3 and am running repairs. My priority 
> #1 is to maintain the stability of overall cluster (the two live data 
> centers). Some data loss is tolerable, but it will be ideal if I can avoid 
> that.
>  
> What is the best way to decommission entire data center? Should I issue 
> decommission to the nodes one by one? Will that put additional load on 
> remaining nodes in DC3? Or should I just shut them down and then run 
> removetoken for these nodes? Or is there a better way?
>  
> Thanks in advance,
> Hiren Shah
>  



Re: progress of sstableloader keeps 0?

2011-09-22 Thread Yan Chunlu
sorry I did not look into it  after check it I found version mismatch
exception is in the log:
ERROR [Thread-17] 2011-09-22 08:24:24,248 AbstractCassandraDaemon.java (line
139) Fatal exception in thread Thread[Thread-17,5,main]
java.lang.RuntimeException: Cannot recover SSTable
/disk2/cassandra/data/reddit/Comments-tmp-f-1 due to version mismatch.
(current version is g).
at
org.apache.cassandra.io.sstable.SSTableWriter.createBuilder(SSTableWriter.java:240)
at
org.apache.cassandra.db.compaction.CompactionManager.submitSSTableBuild(CompactionManager.java:1097)
at
org.apache.cassandra.streaming.StreamInSession.finished(StreamInSession.java:110)
at
org.apache.cassandra.streaming.IncomingStreamReader.readFile(IncomingStreamReader.java:104)
at
org.apache.cassandra.streaming.IncomingStreamReader.read(IncomingStreamReader.java:61)
at
org.apache.cassandra.net.IncomingTcpConnection.stream(IncomingTcpConnection.java:189)
at
org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:117)


does that mean I need to run scrub before running the loader?  could I just
delete it and keep going?  thanks!

On Fri, Sep 23, 2011 at 2:16 AM, Jonathan Ellis  wrote:

> Did you check for errors in logs on both loader + target?
>
> On Thu, Sep 22, 2011 at 10:52 AM, Yan Chunlu 
> wrote:
> > I took a snapshot of one of my node in a cluster 0.7.4(N=RF=3).   use
> > sstableloader to load the snapshot data to another 1 node
> cluster(N=RF=1).
> >
> > after execute  "bin/sstableloader  /disk2/mykeyspace/"
> >
> > it says"Starting client (and waiting 30 seconds for gossip) ..."
> > "Streaming revelant part of  cf1.db. to [10.23.2.4]"
> > then showing the progress indicator and stopped. nothing changed after
> > then.
> > progress: [/10.28.53.16 1/72 (0)] [total: 0 - 0MB/s (avg: 0MB/s)]]]
> >
> > I use nodetool to check the node 10.23.2.4, nothing changed. no data
> copied
> > to it. and the data dir also keep its original size. is there anything
> > wrong? how can I tell what was going on there?
> > thanks!
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
>


Re: is it possible for light-traffic CF to hold down many commit logs?

2011-09-22 Thread Philippe
It sure looks like what I'm seeing on my cluster where a 100G commit lot
partition fills up in 12 hours (0.8.x)
Le 23 sept. 2011 03:45, "Yang"  a écrit :
> in 1.0.0 we don't have memtable_throughput for each individual CF ,
> and instead
> which memtable/CF to flush is determined by "largest
> getTotalMemtableLiveSize() ".
> (MeteredFlusher.java line 81)
>
>
> what would happen in the following case ? : I have only 2 CF, the
> traffic for one CF is 1000 times that
> of the second CF,
> so the high-traffic CF constantly triggers total mem threshold , and
> every time, the busy CF is flushed.
>
> but the light-traffic CF is never flushed ( well, until we have
> flushed about 1000 times the busy CF),
> now we are left with many commit logs , each of them containing a few
> entries for the light-traffic table. we have to keep these commit logs
> because these entries are not flushed to sstable yet.
>
> then there are 2 problems: 1) to persist the few records from the
> light-traffic CF, you have to keep 1000 times the commit logs
> necessary, taking up disk space 2) when you do a recover on server
> restart, you'll have to read through all those commit logs .
>
> does the above hypothesis sound right?
>
> Thanks
> Yang


Re: is it possible for light-traffic CF to hold down many commit logs?

2011-09-22 Thread Yang
thanks for the input.

if that's the case, I think the solution would be to sort the CFs to
flush by a more complex criteria than just size. for example the
number of dirty commit logs that contain this CF should be considered
as a score.

Yang

On Thu, Sep 22, 2011 at 10:40 PM, Philippe  wrote:
> It sure looks like what I'm seeing on my cluster where a 100G commit lot
> partition fills up in 12 hours (0.8.x)
>
> Le 23 sept. 2011 03:45, "Yang"  a écrit :
>> in 1.0.0 we don't have memtable_throughput for each individual CF ,
>> and instead
>> which memtable/CF to flush is determined by "largest
>> getTotalMemtableLiveSize() ".
>> (MeteredFlusher.java line 81)
>>
>>
>> what would happen in the following case ? : I have only 2 CF, the
>> traffic for one CF is 1000 times that
>> of the second CF,
>> so the high-traffic CF constantly triggers total mem threshold , and
>> every time, the busy CF is flushed.
>>
>> but the light-traffic CF is never flushed ( well, until we have
>> flushed about 1000 times the busy CF),
>> now we are left with many commit logs , each of them containing a few
>> entries for the light-traffic table. we have to keep these commit logs
>> because these entries are not flushed to sstable yet.
>>
>> then there are 2 problems: 1) to persist the few records from the
>> light-traffic CF, you have to keep 1000 times the commit logs
>> necessary, taking up disk space 2) when you do a recover on server
>> restart, you'll have to read through all those commit logs .
>>
>> does the above hypothesis sound right?
>>
>> Thanks
>> Yang
>


Re: Possibility of going OOM using get_count

2011-09-22 Thread Boris Yen
On Fri, Sep 23, 2011 at 12:28 PM, aaron morton wrote:

> Offsets have been discussed in previously. IIRC the main concerns were
> either:
>
> There is no way to reliably count to start the offset, i.e. we do not lock
> the row
>

In the new get_count function, cassandra does the internal paging in order
to get the total count. Without locking the row,  the count could still be
unreliable (someone might be deleting some columns while cassandra is
counting the columns).


>
> Or performance related in, as there is not a reliable way to skip 10,000
> columns other than counting 10,000 columns. With a start col we can search.
>
>
I am just curious, basically "skip 10,000 columns to get the start column"
can be done as what cassandra does for new get_count function (internal
paging). I just can not think of a reason why it is doable for get_count but
it can not be done for the offset.

I know the result might not be reliable and the performance might be varied
depends on the offset, but if cassandra can using internal paging to get
count, it should be able the apply the same method to get the start column
for the offset.


> Cheers
>
> -
> Aaron Morton
> Freelance Cassandra Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 22/09/2011, at 8:50 PM, Boris Yen wrote:
>
> I was wondering if it is possible to use similar way as 
> CASSANDRA-2894 to
> have the slice_predict support the offset concept? With the offset, it would
> be much easier to implement the paging from the client side.
>
> Boris
>
> On Mon, Sep 19, 2011 at 9:45 PM, Jonathan Ellis  wrote:
>
>> Unfortunately no, because you don't know what the actual
>> last-column-counted was.
>>
>> On Mon, Sep 19, 2011 at 4:25 AM, aaron morton 
>> wrote:
>> > get_count() supports the same predicate as get_slice. So you can
>> implement
>> > the paging yourself.
>> > Cheers
>> > -
>> > Aaron Morton
>> > Freelance Cassandra Developer
>> > @aaronmorton
>> > http://www.thelastpickle.com
>> > On 19/09/2011, at 8:45 PM, Tharindu Mathew wrote:
>> >
>> >
>> > On Mon, Sep 19, 2011 at 12:40 PM, Benoit Perroud 
>> wrote:
>> >>
>> >> The workaround for 0.7 is calling get_slice and count on client side.
>> >> It's heavier, sure, but you will then be able to set start column
>> >> accordingly.
>> >
>> > I was afraid of that :(
>> > Will follow that method. Thanks.
>> >>
>> >>
>> >> 2011/9/19 Tharindu Mathew :
>> >> > Thanks Aaron and Jake for the replies.
>> >> > Any chance of a possible workaround to use for Cassandra 0.7?
>> >> >
>> >> > On Mon, Sep 19, 2011 at 3:48 AM, aaron morton <
>> aa...@thelastpickle.com>
>> >> > wrote:
>> >> >>
>> >> >> Cool
>> >> >> Thanks, A
>> >> >> -
>> >> >> Aaron Morton
>> >> >> Freelance Cassandra Developer
>> >> >> @aaronmorton
>> >> >> http://www.thelastpickle.com
>> >> >> On 19/09/2011, at 9:55 AM, Jake Luciani wrote:
>> >> >>
>> >> >> This is fixed in 1.0
>> >> >> https://issues.apache.org/jira/browse/CASSANDRA-2894
>> >> >>
>> >> >> On Sun, Sep 18, 2011 at 2:16 PM, Tharindu Mathew <
>> mcclou...@gmail.com>
>> >> >> wrote:
>> >> >>>
>> >> >>> Hi everyone,
>> >> >>> I noticed this line in the API docs,
>> >> >>>
>> >> >>> The method is not O(1). It takes all the columns from disk to
>> >> >>> calculate
>> >> >>> the answer. The only benefit of the method is that you do not need
>> to
>> >> >>> pull
>> >> >>> all the columns over Thrift interface to count them.
>> >> >>>
>> >> >>> Does this mean if a row has a large number of columns calling this
>> >> >>> method
>> >> >>> might make it go OOM?
>> >> >>> Thanks in advance.
>> >> >>> --
>> >> >>> Regards,
>> >> >>>
>> >> >>> Tharindu
>> >> >>> blog: http://mackiemathew.com/
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> http://twitter.com/tjake
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Regards,
>> >> >
>> >> > Tharindu
>> >> > blog: http://mackiemathew.com/
>> >> >
>> >
>> >
>> >
>> > --
>> > Regards,
>> >
>> > Tharindu
>> > blog: http://mackiemathew.com/
>> >
>> >
>>
>>
>>
>> --
>> Jonathan Ellis
>> Project Chair, Apache Cassandra
>> co-founder of DataStax, the source for professional Cassandra support
>> http://www.datastax.com
>>
>
>
>