MARS Server

Overview

The MARS (Mesh network Announcement Relay Storage) server is a unique server possessed by Diarkis and is an essential component for any Diarkis cluster.

The MARS server is characterized by its ability to avoid becoming a single point of failure without the need for scaling or redundancy, ensuring that even a short downtime does not affect the overall Diarkis cluster. In case of issues, simply restarting will maintain the health of the Diarkis cluster.

Setting Up the MARS Server

package main

import (
	"github.com/Diarkis/diarkis"
	"github.com/Diarkis/diarkis/mars"
)

func main() {
	mars.Setup()
	diarkis.Start()
}

Configuring the MARS Server

Configuration is written in JSON.

{
  "address": "127.0.0.1",
  "port": "6779",
  "fullSyncRoles": ["HTTP"],
  "enableMetricsLogging": false
}
KeyDefault

address

"127.0.0.1"

The address for binding the UDP server

port

"6779"

The port for MARS server binding. The UDP server will automatically find an available port starting from the specified port.

fullSyncRoles

["HTTP"]

An array of server roles that synchronize all mesh data

enableMetricsLogging

false

If set to true, the MARS server will output metrics data in JSON to standard output every second.

When Running Different Versions of Diarkis

The MARS server separates and manages data based on the versions of the Diarkis servers. This prevents users from being mixed when using applications with different versions.

Last updated