Like cassandra request data that is present in another node SSTable

From what I understand in cassandra When a client writes data to one server, it writes to the commit log (adds only a log with arbitrary images). Then it puts the data in a MEMTable, which is in memory. He then acknowledges that the recording is successful. When the memtable is full, it is flushed to disk as SSTable (sequential write)

In a multi Node cluster with two nodes named (node1, node2). When the client writes data to node1, which should be in node2 (in accordance with the tokens assigned to the nodes).

  • Where is the Node1 or Node2 Correspondence Logging Log?
  • Which MEMTable executes data for node1 or Node2?
  • Where does the corresponding SSTable remain Node1 or Node2?
  • How does a query give data present in other Node's in memory (when trying to read from Node1)?
+4
source share
1 answer

the node with which the client connects when it issues a record becomes the coordinator for this record. So in your script, node1 will be the coordinator. Then, Node1 calculated the value of the hash token for the record and sees that this token belongs to node2. Then it forwards the record to node2.

Node2 will receive a write request from node1 and, since it is a local write, will add it to commitlog and memtable on node2. This is so that if node2 had to go down before memtable was photographed, it could rebuild memory by republishing commitlog.

memtable 2, 2.

2, node1, , node1 , .

. node, . , , . .

+4

Source: https://habr.com/ru/post/1608720/


All Articles