newbie question :got error 'org.apache.thrift.transport.TTransportException'

2012-05-31 Thread Chen, Simon
Hi,
  I am new to Cassandra.
 I have started a Cassandra instance (Cassandra.bat), played with it for a 
while, created a keyspace Zodiac.
When I kill Cassandra instance and restarted, the keyspace is gone but when I 
tried to recreate it,
I got 'org.apache.thrift.transport.TTransportException' error. What have I done 
wrong here?

Following are screen shots:

C:\cassandra-1.1.0bin\cassandra-cli -host localhost -f 
C:\NoSqlProjects\dropZ.txt
Starting Cassandra Client
Connected to: ssc2Cluster on localhost/9160
Line 1 = Keyspace 'Zodiac' not found.

C:\cassandra-1.1.0bin\cassandra-cli -host localhost -f 
C:\NoSqlProjects\usageDB.txt
Starting Cassandra Client
Connected to: ssc2Cluster on localhost/9160
Line 1 = org.apache.thrift.transport.TTransportException

Following is part of server error message:

INFO 11:09:56,761 Node localhost/127.0.0.1 state jump to normal
INFO 11:09:56,761 Bootstrap/Replace/Move completed! Now serving reads.
INFO 11:09:56,761 Will not load MX4J, mx4j-tools.jar is not in the classpath
INFO 11:09:56,781 Binding thrift service to localhost/127.0.0.1:9160
INFO 11:09:56,781 Using TFastFramedTransport with a max frame size of 15728640 
bytes.
INFO 11:09:56,791 Using synchronous/threadpool thrift server on 
localhost/127.0.0.1 : 9160
INFO 11:09:56,791 Listening for thrift clients...
INFO 11:20:06,044 Enqueuing flush of 
Memtable-schema_keyspaces@1062244145(184/230 serialized/live bytes, 4 ops)
INFO 11:20:06,054 Writing Memtable-schema_keyspaces@1062244145(184/230 
serialized/live bytes, 4 ops)
INFO 11:20:06,074 Completed flushing 
c:\cassandra_data\data\system\schema_keyspaces\system-schema_keyspaces-hc-62-Data.
b (240 bytes)
RROR 11:20:06,134 Exception in thread Thread[MigrationStage:1,5,main]
ava.lang.AssertionError
   at org.apache.cassandra.db.DefsTable.updateKeyspace(DefsTable.java:441)
   at org.apache.cassandra.db.DefsTable.mergeKeyspaces(DefsTable.java:339)
   at org.apache.cassandra.db.DefsTable.mergeSchema(DefsTable.java:269)
   at 
org.apache.cassandra.service.MigrationManager$1.call(MigrationManager.java:214)
   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)
RROR 11:20:06,134 Error occurred during processing of message.
ava.lang.RuntimeException: java.util.concurrent.ExecutionException: 
java.lang.AssertionError

usageDB.txt:

create keyspace Zodiac
with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy'
and strategy_options = {replication_factor:1};

use Zodiac;

create column family ServiceUsage
with comparator = UTF8Type
and default_validation_class = UTF8Type
and key_validation_class = LongType
AND column_metadata = [
  {column_name: 'TASK_ID', validation_class:  IntegerType}
  {column_name: 'USAGE_COUNT', validation_class:  IntegerType}
  {column_name: 'USAGE_TYPE', validation_class: UTF8Type}
   ];




From: Chong Zhang [mailto:chongz.zh...@gmail.com]
Sent: Thursday, May 31, 2012 8:47 AM
To: user@cassandra.apache.org
Subject: Re: tokens and RF for multiple phases of deployment

Thanks Aaron.

I might use LOCAL_QUORUM to avoid the waiting on the ack from DC2.

Another question, after I setup a new node with token +1 in a new DC,  and 
updated a CF with RF {DC1:2, DC2:1}. When i update a column on one node in DC1, 
it's also updated in the new node in DC2. But all the other rows are not in the 
new node. Do I need to copy the data files from a node in DC1 to the new node?

The ring (2 in DC1, 1 in DC2) looks OK, but the load on the new node in DC2 is 
almost 0%.

Address DC  RackStatus State   LoadOwns
Token
   
85070591730234615865843651857942052864
10.10.10.1DC1 RAC1Up Normal  313.99 MB   50.00%  0
10.10.10.3DC2 RAC1Up Normal  7.07 MB   0.00%   1
10.10.10.2DC1 RAC1Up Normal  288.91 MB   50.00%  
85070591730234615865843651857942052864

Thanks,
Chong

On Thu, May 31, 2012 at 5:48 AM, aaron morton 
aa...@thelastpickle.commailto:aa...@thelastpickle.com wrote:

Could you provide some guide on how to assign the tokens in this growing 
deployment phases?

background 
http://www.datastax.com/docs/1.0/install/cluster_init#calculating-tokens-for-a-multi-data-center-cluster

Start with tokens for a 4 node cluster. Add the next 4 between between each of 
the ranges. Add 8 in the new DC to have the same tokens as the first DC +1

Also if we use the same RF (3) in both DC, and use EACH_QUORUM for write and 
LOCAL_QUORUM for read, can the read also reach to the 2nd cluster?
No. It will fail if there are not enough nodes available in 

Re: newbie question :got error 'org.apache.thrift.transport.TTransportException'

2012-05-31 Thread aaron morton
Sounds like 
https://issues.apache.org/jira/browse/CASSANDRA-4219?attachmentOrder=desc

Drop back to 1.0.10 and have a play. 

Good luck. 


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

On 1/06/2012, at 6:38 AM, Chen, Simon wrote:

 Hi,
   I am new to Cassandra.
  I have started a Cassandra instance (Cassandra.bat), played with it for a 
 while, created a keyspace Zodiac.
 When I kill Cassandra instance and restarted, the keyspace is gone but when I 
 tried to recreate it,
 I got 'org.apache.thrift.transport.TTransportException’ error. What have I 
 done wrong here?
  
 Following are screen shots:
  
 C:\cassandra-1.1.0bin\cassandra-cli -host localhost -f 
 C:\NoSqlProjects\dropZ.txt
 Starting Cassandra Client
 Connected to: ssc2Cluster on localhost/9160
 Line 1 = Keyspace 'Zodiac' not found.
  
 C:\cassandra-1.1.0bin\cassandra-cli -host localhost -f 
 C:\NoSqlProjects\usageDB.txt
 Starting Cassandra Client
 Connected to: ssc2Cluster on localhost/9160
 Line 1 = org.apache.thrift.transport.TTransportException
  
 Following is part of server error message:
  
 INFO 11:09:56,761 Node localhost/127.0.0.1 state jump to normal
 INFO 11:09:56,761 Bootstrap/Replace/Move completed! Now serving reads.
 INFO 11:09:56,761 Will not load MX4J, mx4j-tools.jar is not in the classpath
 INFO 11:09:56,781 Binding thrift service to localhost/127.0.0.1:9160
 INFO 11:09:56,781 Using TFastFramedTransport with a max frame size of 
 15728640 bytes.
 INFO 11:09:56,791 Using synchronous/threadpool thrift server on 
 localhost/127.0.0.1 : 9160
 INFO 11:09:56,791 Listening for thrift clients...
 INFO 11:20:06,044 Enqueuing flush of 
 Memtable-schema_keyspaces@1062244145(184/230 serialized/live bytes, 4 ops)
 INFO 11:20:06,054 Writing Memtable-schema_keyspaces@1062244145(184/230 
 serialized/live bytes, 4 ops)
 INFO 11:20:06,074 Completed flushing 
 c:\cassandra_data\data\system\schema_keyspaces\system-schema_keyspaces-hc-62-Data.
 b (240 bytes)
 RROR 11:20:06,134 Exception in thread Thread[MigrationStage:1,5,main]
 ava.lang.AssertionError
at org.apache.cassandra.db.DefsTable.updateKeyspace(DefsTable.java:441)
at org.apache.cassandra.db.DefsTable.mergeKeyspaces(DefsTable.java:339)
at org.apache.cassandra.db.DefsTable.mergeSchema(DefsTable.java:269)
at 
 org.apache.cassandra.service.MigrationManager$1.call(MigrationManager.java:214)
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)
 RROR 11:20:06,134 Error occurred during processing of message.
 ava.lang.RuntimeException: java.util.concurrent.ExecutionException: 
 java.lang.AssertionError
  
 usageDB.txt:
  
 create keyspace Zodiac
 with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy'
 and strategy_options = {replication_factor:1};
  
 use Zodiac;
  
 create column family ServiceUsage
 with comparator = UTF8Type
 and default_validation_class = UTF8Type
 and key_validation_class = LongType
 AND column_metadata = [
   {column_name: 'TASK_ID', validation_class:  IntegerType}
   {column_name: 'USAGE_COUNT', validation_class:  IntegerType}
   {column_name: 'USAGE_TYPE', validation_class: UTF8Type}
];
  
  
  
  
 From: Chong Zhang [mailto:chongz.zh...@gmail.com] 
 Sent: Thursday, May 31, 2012 8:47 AM
 To: user@cassandra.apache.org
 Subject: Re: tokens and RF for multiple phases of deployment
  
 Thanks Aaron.
  
 I might use LOCAL_QUORUM to avoid the waiting on the ack from DC2.
  
 Another question, after I setup a new node with token +1 in a new DC,  and 
 updated a CF with RF {DC1:2, DC2:1}. When i update a column on one node in 
 DC1, it's also updated in the new node in DC2. But all the other rows are not 
 in the new node. Do I need to copy the data files from a node in DC1 to the 
 new node?
  
 The ring (2 in DC1, 1 in DC2) looks OK, but the load on the new node in DC2 
 is almost 0%.
  
 Address DC  RackStatus State   LoadOwns   
  Token   
   
  85070591730234615865843651857942052864  
 10.10.10.1DC1 RAC1Up Normal  313.99 MB   50.00%  
 0   
 10.10.10.3DC2 RAC1Up Normal  7.07 MB   0.00%  
  1   
 10.10.10.2DC1 RAC1Up Normal  288.91 MB   50.00%  
 85070591730234615865843651857942052864  
  
 Thanks,
 Chong
  
 On Thu, May 31, 2012 at 5:48 AM, aaron morton aa...@thelastpickle.com wrote:
  
 Could you provide some guide on how to assign