In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Consistency
This command displays the current conformance level, or sets a new conformance level.
Consistency can understand Consistency Level for read and write operations
The consistency level of the write operation specifies the number of replica that the write operation must ensure that the write operation has completed successfully before notifying the client that the request was successful.
QUORUM level
The QUORUM level ensures that data is written to a specified number of quorum nodes. The value of a quorum is calculated by rounding the following formula:
(sum_of_replication_factors / 2) + 1
Sum_of_replication_factors refers to the sum of all replication_factor settings in each data center.
Level: ANY write operation: description: any node write operation has been successful. If all the replica nodes are down, the write operation can still return success after recording a hinted handoff event. If all replica nodes are dead, the written data will not be read until the failed replica node is restored. Usage: minimize delay and wait and ensure that write requests do not fail. Provides the lowest consistency and highest availability relative to other levels. Level: ALL read: description: query data from all replica nodes and return the latest data from timestamp among all the data returned by replica. If a replica node does not respond, the read operation fails. Usage: provides the highest consistency and lowest availability compared to other levels. Write: description: the write operation must write the data of the specified row to the commit log and memtable of all replica nodes. Usage: provides the highest consistency and lowest availability relative to other levels. Level: EACH_QUORUM read: description: query data from the replica node of the number of quorum in each data center and return the data with the latest timestamp. Usage: write with LOCAL_QUORUM: description: the write operation must write the data of the specified row to the commit log and memtable of the replica node of the number of quorum in each data center. Usage: for multi-data center clusters to strictly ensure the same level of consistency. For example, if you want a write request to fail when a data center is down, or when a write operation on a replica node that does not meet the number of quorum succeeds. Level: LOCAL_ONE read: description: returns data from the replica node closest to the coordinator node in the local data center. Usage: the use of this level in the co-write operation Consistency level. Write: description: the write operation of replica node in any local data center was successful. Usage: in the case of multiple data centers, at least one replica node is often expected to write successfully, but you do not want any cross-data center communication. LOCAL_ONE is just enough to meet such needs. Level: LOCAL_QUORUM read: description: query data from the replica node of the number of quorum in each data center and return the data with the latest timestamp. Avoid communication across data centers. Usage: fails when using SimpleStrategy. Write: description: the replica node with the number of quorum in the local data center was successfully written. Avoid communication across data centers. Usage: cannot be used with SimpleStrategy. Used to ensure data consistency in the local data center. Level: LOCAL_SERIAL read: description: same as SERIAL, but limited to local data center. Usage: same as SERIAL. Write: description: replica nodes with the number of quorum in the local data center are written successfully conditionally (conditionally). Usage: for lightweight transactions (lightweight transaction) to implement linearizable consistency to avoid unconditional (unconditional) updates. Level: ONE read: description: returns the result returned by the most recent replica determined by snitch. By default, the backend triggers read repair to ensure that the data of other replica is consistent. Usage: provides the highest level of availability, but the returned results are not necessarily up to date. Write: description: any replica node write operation has been successful. Meet the needs of most users. Usage: generally speaking, the coordinator node closest to the replica node is given priority. Level: QUORUM read: description: reads the results of the number of quorum nodes in all data centers and returns the latest results of the merged timestamp. Usage: strong consistency is guaranteed, although reading may fail. Level: SERIAL read: description: allows you to read current (including uncommitted) data, and if a uncommitted transaction is found during reading, commit it. Usage: lightweight transactions. Level: TWO read: description: returns the latest data for the two most recent replica. Usage: similar to ONE. Level: THREE read: description: returns the latest data for the three most recent replica. Usage: similar to TWO. Reference address:
Https://docs.datastax.com/en/archived/cassandra/2.0/cassandra/dml/dml_config_consistency_c.html
Note:
Even if consistency level ON or LOCAL_QUORUM is specified, writes are sent to all replica nodes, including replica nodes in other data centers. Consistency level simply determines the number of replica nodes that need to ensure a successful write operation before notifying the client that the request is successful.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.