Skip to main content

Node

A node is a single running store process. A cluster is made of nodes, each holding one partition-replica slot, and each listening on a client port and a cluster port.

What a node is

A node is one process that participates in a store's cluster. It holds a share of the data, serves key-value and coordination operations for the partitions it owns, replicates those partitions to peers, and takes part in failure detection. Nodes present themselves to clients as one logical store: you do not route requests to a specific node yourself — you connect to any node and the cluster resolves the owner.

You run one or more nodes per machine. The number of node processes a machine runs for a store is partitions per node × replication factor, so a single machine can host several nodes and stand in for a multi-machine cluster during development.

Node identity

Each node has a cluster-wide identifier computed as <host>-n<index> — the machine's host or address, then -n, then the process index on that machine starting at 0. For example, the first two nodes on 192.168.1.1 are 192.168.1.1-n0 and 192.168.1.1-n1. All nodes on the same machine share a machine identifier, which the cluster uses to place replicas on different machines from their primary.

The process index also determines the node's initial role. A node whose index is a multiple of the replication factor is a preferred primary — the candidate to own a partition when the first partition map is generated; the indexes in between are replicas for that slot. This is a placement preference at map-generation time, not a runtime guarantee.

The two ports

A node listens on two ports, one for clients and one for other nodes.

PortPurpose
Client port (from 7861)Where your application connects to read and write. Incremented per node on a machine: 7861, 7862, and so on.
Cluster port (from 7811)Node-to-node traffic: membership gossip and replication. Incremented per node: 7811, 7812, and so on.

Keeping the two ports separate means application traffic and intra-cluster traffic never contend on the same channel. The base ports are set when the store is created and incremented per node process on each machine.

Node versus the terms readers confuse it with

A node is a process, which sets it apart from the machine it runs on and the data it holds.

  • A node is not a server. A server is the machine; a node is one process that server runs. One server typically runs several nodes.
  • A node is not a partition. A partition is a slice of the keyspace; a node is a process that holds partitions — as primary for some and replica for others.
  • A node is not the cluster. The cluster is all the nodes together; a node is one member of it.
note

Because a node maps to one partition-replica slot, growing a store means bringing up more nodes — done in supervisor mode by adding a whole server, which forks its share of node processes.

Next steps