In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
What is Replication?
In Cassandra, Replication stores data to multiple nodes to ensure reliability and error tolerance. When you create a keyspace (the equivalent of a table in a relational database), you must give a replica placement strategy (Replica Placement Strategy)
What is the replica factor (Replica Factor)?
This number determines how many copies there are. For example, if set to 1, there is only one copy per line, and so on. All replicas are of equal status and there is no distinction between master and subordinate. Note that the replica factor cannot exceed the number of nodes at most (there are not so many nodes for you to put so many copies) or the write operation will be rejected.
What is the replica placement strategy (Replica Placement Strategy)?
This policy determines how a copy of keyspace is placed in the cluster (specified when the keyspace is created)
a. Simple Policy (SimpleStrategy):
The default copy placement policy when creating a keyspace using the Cassandra CLI command line tool. Suppose that according to partitioner, the first node is set to N 1, and its clockwise node is N 2 and N 3. This strategy places the first copy of keyspace on N 1, and then the other copies in N 2 Magi N 3. Go up
b. Network Topology Strategy (NetworkTopologyStrategy):
This strategy is used when you know how nodes are grouped in data centers (Data Center) or when you want to deploy clusters across multiple data centers, you must specify how many replicas each data center needs (generally recommended to be set to 2 or 3). In this case, the replica placement strategy is determined by the data center itself. Specifically, it is up to partitioner to decide that the first node is set to N1, and on the rack1, which belongs to the data center DC1, the first copy is placed on N1, and the other copies must be placed separately in the DC1, giving priority to shelves that are not rack1. If there is no other rack, they can only be placed on the rack1.
For example, as shown in the figure, there are now two data centers, blue for DC1 and green for two shelves on DC2,DC1, Rack1 and Rack2. If the first node selected by partitioner is DC1's node N3, then copy R1 is placed on DC1's node N3, and the next copy of this copy, R2, is placed on the same DC, the next rack of DC1 (if any), and it happens to find that the next clockwise node N4 happens to be DC1, but another shelf (Rack2), so copy R2 is placed on N4. The same policy is followed for the 2 replicas that belong to DC2.
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.