Skip to main content

Master Server, Leader, and Follower

MooseFS keeps metadata apart from file content. The Master Server holds the metadata. The Chunkservers hold the content.

What it is​

The Master Server is the component that manages a MooseFS instance. The Master Server holds the metadata (the directory tree, the file attributes, and the list of chunks that each file is made of). It answers the file system requests of clients. It watches the state of the Chunkservers. The Master Server orders chunks to be replicated or deleted when the configured redundancy requires the change. Other literature calls this role a metadata server (MDS).

Community Edition runs one Master Server per instance. MooseFS PRO runs any number of Master Servers and splits their work between two roles. The Leader PRO (PRO Edition only) is the one Master Server that manages the instance at a given moment. A Follower is a Master Server that holds its own copy of the metadata, serves no clients, and is ready to take the Leader role.

Why it matters​

Every operation on a MooseFS file system starts at the Master Server. A client asks the Master Server to resolve a path, to create a file, or to name the Chunkservers that hold a given chunk. The client exchanges data directly with a Chunkserver only after that. Nothing in the cluster rearranges data on its own either. The Master Server orders chunk replication and chunk deletion. Even to register a session, a client needs a Master Server in the Leader role or, in MooseFS PRO, in the read-only DEPUTY state.

The two editions also differ here. In Community Edition, you replace a failed Master Server manually. In MooseFS PRO, a Follower already has the metadata, so the Leader role passes to one of the Followers automatically. The edition comparison states which capabilities each edition includes.

How MooseFS implements it​

One program, mfsmaster, runs in either role. The program serves three kinds of peers through three separate interfaces: clients, Chunkservers, and everything that connects for the metadata. That last interface serves the Metaloggers, the Followers PRO (PRO Edition only), and mfssupervisor. The Followers register through that interface as a Metalogger does. The mfssupervisor tool reads the state of the Master Servers and can force a metadata save or give the Leader role to a chosen Master Server. The role then limits what that process does. A Follower creates no changelog entry of its own and schedules no chunk jobs. A Follower answers the registration of a client with the address of the current Leader instead of opening a session.