Cassandra is used in a message process system. The table will be created at a fixed time each day. We want the table can be created before the message arrived. So I want to guarantee table is created in all the nodes.
Peter 发件人: 鄢来琼 发送时间: 2015年3月16日 15:14 收件人: user@cassandra.apache.org 主题: Re: Is Table created in all the nodes if the default consistency level used Hi Daemeon, Yes, I use “NetworkTopologyStrategy” strategy for “Table_test”, but “System keyspace” is Cassandra internal keyspace, its strategy is localStrategy. So my question is how to guarantee “Table_test” is created in all the nodes before any R/W opertions? Thanks. Peter 发件人: daemeon reiydelle [mailto:daeme...@gmail.com] 发送时间: 2015年3月16日 14:35 收件人: user@cassandra.apache.org 主题: Re: Is Table created in all the nodes if the default consistency level used If you want to guarantee that the data is written to all nodes before the code returns, then yes you have to use "consistency all". Otherwise there is a small risk of outdated data being served if a node goes offline longer than hints timeouts. Somewhat looser options that can assure multiple copies are written, as you probably know, are quorum or a hard coded value. This applies to a typical installation with a substantial number of nodes of course, not a small 2-3 node cluster. I am curious why localStrategy when you have such concerns about data consistency that you want to assure all nodes get data written. Can you elaborate on your use case? ....... “Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!” - Hunter Thompson Daemeon C.M. Reiydelle USA (+1) 415.501.0198 London (+44) (0) 20 8144 9872 On Sun, Mar 15, 2015 at 8:11 PM, 鄢来琼 <laiqiong....@gtafe.com<mailto:laiqiong....@gtafe.com>> wrote: Could you tell me whether the meta data of the new table are build in all the nodes after execute the following statement. cassandra_session.execute_async( “““CREATE TABLE Table_test( ID uuid, Time timestamp, Value double, Date timestamp, PRIMARY KEY ((ID,Date), Time) ) WITH COMPACT STORAGE; ””” ) As I know, the system keyspace is used to store the meta data, but the strategy is localStrategy, which only store meta data of local node. So I want to know whether table is created in all the nodes, should I add consistency_level setting to the above statement to make sure “create table” will be executed in all the nodes? Thanks. Peter