Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zookeeper Node vs. zNode

Tags:

I just start reading about zookeeper. And I am getting confused about the data replication and data module.

The ZooKeeper ensemble will contain multiple nodes(Machine) with one leader and others as followers.

The data module is a tree structure with each node as znode.

How does those two structure work together? Is the znode and node refer to the same thing?

I am trying to understand it as each node in ZooKeeper ensemble will have the same data module that contains znode. So the znode is actually, data on nodes. Is that right?

like image 273
user1947415 Avatar asked Jun 09 '17 20:06

user1947415


People also ask

What is znode in ZooKeeper?

In the ZooKeeper documentatin, znodes refer to the data nodes. Servers to refer to machines that make up the ZooKeeper service; quorum peers refer to the servers that make up an ensemble; client refers to any host or process which uses a ZooKeeper service. Znodes are the main enitity that a programmer access.

What is the difference between an ephemeral znode and a persistent znode in ZooKeeper?

Types of Znodes Persistence znode − Persistence znode is alive even after the client, which created that particular znode, is disconnected. By default, all znodes are persistent unless otherwise specified. Ephemeral znode − Ephemeral znodes are active until the client is alive.

Can ZooKeeper run with 2 nodes?

In case of Zookeeper 2 nodes is not enough. Even if one of your nodes went out, the remaining one couldn't tell if it was down or just partitioned. This would cause inconsistency, a split brain scenario, because both of them would continue serving their clients.

What are different types of Z nodes?

== Types of Znodes == There are three types of znodes or nodes: Persistent, Ephemeral and Sequential. == Types of Znodes - Ephemeral == Ephemeral node gets deleted if the session in which the node was created has disconnected.


1 Answers

The two concepts don't really relate to each other in any way. A znode is part of the data model. Essentially, it's a path on a tree-like structure that represents a piece of data stored in ZooKeeper. Conversely, a node is a general systems term you could just replace with server.

Unfortunately, we don't have enough terms in computer science, so terminology can become confusing. But this is simply the difference between a tree node (in the data model) and a cluster node (in the ensemble).

like image 166
kuujo Avatar answered Oct 22 '22 08:10

kuujo