Cassandra权威指南(第二版)
最新书摘:
-
okfine2024-02-22“The basic Paxos algorithm consists of two stages: prepare/promise, and propose/accept. To modify data, a coordinator node can propose a new value to the replica nodes, taking on the role of leader. Other nodes may act as leaders simultaneously for other modifications. Each replica node checks the proposal, and if the proposal is the latest it has seen, it promises to not accept proposals associated with any prior proposals. Each replica node also returns the last proposal it received that is still in progress. If the proposal is approved by a majority of replicas, the leader commits the proposal, but with the caveat that it must first commit any in-progress proposals that preceded its own proposal.”
-
红色有角F叔2014-12-16on the contrary, Cassandra requires a shift in how you think about it. Instead of designing a pristine data model and then designing queries around the model as in RDBMS, you are free to think of your queries first, and then provide the data that answers them.
-
Dong2012-06-23作为一般性的原则,你可以估算写吞吐量为节点数除以副本因子。所以,如果在副本因子为1的时候,一个10节点的集群的典型吞吐能力大约是10 000次写每秒,那么当把副本因子提高到2,吞吐能力大约会是5000次写每秒
-
Dong2012-06-23首先要记住的是,在调高副本因子之后,必须重启节点。修复(Repair)操作会在节点重启之后进行,Cassandra将会重新分布数据,以达到副本因子指定的副本数量
-
Dong2012-06-23当第二个节点启动的时候,它会立刻发现第一个节点,之后会休眠90秒钟,让节点们通过gossip传播信息,确定每个节点应该存储多少数据,之后,从第一个节点获取自举令牌,这样就知道自己将要接收到的数据了
-
Dong2012-06-23如果对列族中一个已经存在的键值写入新值,原来已经存在的列就将被覆盖
-
红色有角F叔2014-12-30Do not use the Serial GC with Cassandra.However, do not simply set your JVM to use as much memory as you have available up to 4GB. There are many factors involved here, such as the amount of swap space and memory fragmentation. Simply increasing the size of the heap using -Xmx will not help if you don’t have any swap available.
-
红色有角F叔2014-12-30The rows_cached setting specifies the number of rows that will be cached. ... You’ll want to use this setting carefully, however, as this can easily get out of hand. If your column family gets far more reads than writes, then setting this number very high will needlessly consume considerable server resources. If your column family has a lower ratio of reads to writes, but has rows with lots of data in them (hundreds of columns), then you’ll need to do some math before setting this number very high. And unless you have certain rows that get hit a lot and others that get hit very little, you’re not going to see much of a boost here.
-
红色有角F叔2014-12-30The purpose of disk_access_mode is to enable memory mapped files so that the oper- ating system can cache reads, thus reducing the load on Cassandra’s internal caches. This sounds great, but in practice, disk_access_mode is one of the less-useful settings, and at this point doesn’t work exactly as was originally envisioned. This may be im- proved in the future, but it is just as likely that the setting will be removed. Certainly feel free to play around with it, but you might not see much difference.
-
红色有角F叔2014-12-30The keys_cached setting indicates the number of key locations—not key values—that will be saved in memory. This can be specified as a fractional value (a number between 0 and 1) or as an integer. If you use a fraction, you’re indicating a percentage of keys to cache, and an integer value indicates an absolute number of keys whose locations will be cached.This setting will consume considerable memory, but can be a good trade-off if your locations are not hot already.
-
红色有角F叔2014-12-30the concurrent_writes setting behaves somewhat differently. This should match the number of clients that will write concurrently to the server. If cassandra is backing a web application server, you can tune this setting from its default 32 to match the number of threads the application server has available to connect to Cassandra.