Skip to main content

Metalogger

A Metalogger keeps a copy of the Master Server's metadata on a separate machine.

What it is​

A Metalogger is a service that connects to the Master Server and downloads a full metadata image. The Metalogger then follows the changelog, in which the Master Server records every metadata operation. The Metalogger writes both the image and the changelog to its own data directory. Both editions include a Metalogger. The daemon is mfsmetalogger. Its settings are in mfsmetalogger.cfg.

A Metalogger only listens. The Metalogger opens one connection to the Master Server, receives what comes over that connection, and writes what arrives to disk. Nothing connects to a Metalogger in return. A Metalogger accepts no client mounts, no Chunkserver reports, and no metadata requests. Every other component works without waiting for the Metalogger.

Why it matters​

Chunks on their own are not a file system. The namespace, the file attributes, and the mapping from files to chunks exist only in metadata. An installation that loses its metadata therefore still holds its data but can no longer reach that data. A Metalogger puts that metadata on hardware other than the Master Server's. The Metalogger keeps the copy close to the current state of the cluster rather than at the state of the last scheduled backup.

Both editions have a use for a Metalogger, for different reasons. Community Edition has no Follower Master Server, so a Metalogger is the only way to hold a current copy of the metadata off the Master Server's machine. In MooseFS PRO, the Followers PRO (PRO Edition only) already hold that copy, in memory and on disk. A Metalogger keeps one more copy on disk, on a machine that needs much less than a Follower: little RAM, any processor, and a reliable disk. A Metalogger is therefore the low-cost way to keep one more copy of the metadata, for example in place of a second Follower. The Metalogger runs alongside a cluster of several Master Servers and follows whichever Master Server is the Leader.

The Metalogger writes what it holds to disk, into the data directory named by DATA_PATH. The directory holds the metadata image, the changelog that the Metalogger has followed since, and a configured number of older copies of both. That directory is the whole cost in storage. The size of the directory is of the order of the Master Server's own metadata. Hardware requirements for Metaloggers give the numbers. A Metalogger does not work in memory. Unlike a Master Server, a Metalogger never holds the structure in RAM. The Metalogger only writes what arrives.

Running a Metalogger also costs little network traffic. A Metalogger receives what the Master Server already produces: the changelog stream, and a full metadata image downloaded on a schedule. That traffic is metadata. In a working cluster, metadata traffic is orders of magnitude smaller than the file data that moves between clients and Chunkservers. A Metalogger adds nothing to that path. File operations never wait for the Metalogger.

A Metalogger is not a standby Master Server. A Metalogger cannot serve the file system. The Metalogger holds files on disk and waits. An operator turns that copy back into a running Master Server. That separates a Metalogger from a Follower Master Server. A Follower Master Server holds metadata in memory, stays synchronized with the Leader Master Server, and can take the Leader's place. A Leader Master Server with Metaloggers connected but no synchronized Follower Master Server reports that backup Master Servers are missing.

How MooseFS implements it​

The Metalogger registers on the same Master Server connection that Follower Master Servers PRO (PRO Edition only) use, but as a different kind of client. The Metalogger receives the metadata image and the changelog. The Metalogger never asks for the session list, the extra transfer that only a Follower Master Server requests. The Metalogger repeats the full download on a schedule. The Metalogger keeps a configured number of older metadata images and changelogs, so the files on its disk cover more than the moment of the last download.