Skip to main content
Version: 4.3.0

Replication

SaunaFS supports two replication modes.

  • Simple Goal Setup: Specify the number of copies for each file or directory chunk across chunk servers.
  • EC Mode: Advanced erasure coding with configurable data and parity copies. Clients write quasi-parallel to chunk servers, with up to 32 data and parity chunks.
note

Replication settings are chunk-based, not node-based. For example, with five chunk servers in an EC3+1 setup, chunks are evenly distributed, ensuring active use of all servers and balanced distribution of data and parity chunks.

note

To ensure repair procedures for broken servers, always have an extra chunk server beyond your configured goals.

Configuring Goals

Goals are set in 'sfsgoals.cfg' managed by the master server. The file syntax is:

id name : label ...

Comments start with '#'. Up to 40 goals can be configured, with IDs from 1 to 40. Each file in the system refers to a goal ID and replicates accordingly. 'sfsgoals.cfg' allows overriding default behaviors.

Goal Definitions

  • Id: Redefines the goal ID. Changing an ID affects files already assigned to it.
  • Name: A user-friendly name for interface tools like 'saunafs setgoal'. Names can be up to 32 alphanumeric characters.
  • List of Labels: Defines chunk server labels, with up to 32 alphanumeric characters. Each label represents a chunk server where a file copy is maintained. The label '_' represents any chunk server.

Changing sfsgoals.cfg alters the replication behavior for files using that goal ID.

Example:

3 3 : _ _ _ # Three copies anywhere
8 not_important_file : _ # One copy
11 important_file : _ _
13 cached_on_ssd : ssd _
14 very_important_file : _ _ _ _

For more information:

man sfsgoals.cfg

Viewing and Setting Goals

  • View current goals via command line: saunafs-admin list-goals <master ip> <master port> or web interface under 'Config' tab.
  • Set goals with: saunafs setgoal goal_name object. Use (-r) for directories. Append '+' or '-' to the goal_name to increase or decrease “security” (i.e. goal_name id is higher or lower than id of the current goal), respectively.
  • View goals with: saunafs getgoal object or saunafs getgoal -r directory for directories.

Setting up EC

EC goals are like standard goals but include EC ($ecM,K) definitions in 'sfsgoals.cfg'. EC supports up to 32 data or parity parts.

Examples in 'sfsgoals.cfg':

18 first_ec : $ec(3,1) # 3 data, 1 parity on all servers.

EC is the fastest replication mode, spreading writes across servers according to set goals.