MARS Server

Overview

The MARS (Mesh network Announcement Relay Storage) server is a unique server that is essential for the Diarkis cluster, with each cluster requiring one MARS server.

The MARS server is characterized by its lack of need for scaling or redundancy while avoiding being a single point of failure. Even if a short downtime occurs, it is designed not to affect the entire Diarkis cluster. The health of the Diarkis cluster can be maintained by simply restarting the server if any issues arise.

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 of the UDP server to bind to

port

"6779"

The port for the MARS server to bind to. The UDP server automatically searches for available ports starting from the specified port.

fullSyncRoles

["HTTP"]

An array of server roles that synchronize all mesh data

enableMetricsLogging

false

Setting this value to true causes the MARS server to output metrics data in JSON to standard output every second.

When Launching a Different Version of Diarkis

The MARS server manages data by segregating it based on the version of the Diarkis server. This prevents users from being mixed across applications with different versions.

Last updated