Core Concepts

Serverhost

The Serverhost is the component that runs the Minecraft server.

Understanding the ServerHost

It's not that hard to understand the Serverhost. It is a simple component that is responsible for starting and managing minecraft servers. The nice thing about it is that it is very flexible and can be configured to work with any kind of server. It is also very easy to scale and can be installed on multiple machines.

This component is an implementation of our Serverhost API. You don't have to use this component to start and manage servers, but you have to use some kind of implementation of the Serverhost api.

Multi-Root Installation

The Serverhost is designed to be installed on multiple machines. This is called a multi-root installation. This means that you can have multiple Serverhosts running on different machines, all connected to our controller.

To set up a multi-root installation you need to install our CLI on the machine you want to install the Serverhost on.

After you have installed the cli, you can run the following command to install the Serverhost:

# Install the Serverhost
simplecloud install serverhost

Docker Support

We are currently working on dockerizing Minecraft servers with the Serverhost. This will be possible through actions.

Online Server Check

The online server checker is a new concept where we check if a server is online or not. This is done by sending a ping request to the Minecraft server and checking if it responds. It's very useful because this makes it possible for the component to know if a server is online and should be registered, or if it is offline and should be removed.

Additionally, the online server checker ensures that we don't need a plugin running on the Minecraft server, so you can basically use any kind of server; it just needs to respond to the ping request.

Needed Group Properties

The Serverhost needs some dynamic properties to work. For a group to start, the user has to provide every property that do not have a default value.

IDDescriptionUser providedDefault value
server-urlsets the server URLYesN/A
configuratorsets the configuratorYesN/A
forwarding-secretused in the velocity configuratorNosecure secret set by the controller
max-startup-secondssets the maximum time a server can take to start upYes120
template-idthe template used by the serverYesthe groups name (generated if not present)

Server Versions

Server versions in the classic v2 sense don't exist anymore. Servers are now just started using the server URL and a server configurator. Both server URL and server configurator are required, if the needed dynamic group properties are not set in the group configuration, a server of this group will not start.

Server URL

The server URL is nothing more than a simple download link to the wanted minecraft server jar. In fact, it can be any link you want. The Serverhost will try to download and execute it using user specified options. You can set the server URL through the server-url dynamic group property.

Server Options

For each server group, a YML-file is created in the options directory. This file provides configuration for the java start command of this group. There are also options to change the directory where started servers are stored in, and you can make the component instance ignore the server group.

# start arguments
jvm:
  executable: C:\Program Files\Java\jdk-17.0.5\bin\java
  options:
    [-Xms%MIN_MEMORY%M, -Xmx%MAX_MEMORY%M, -Dcom.mojang.eula.agree=true, -jar]
  arguments: [nogui]
# whether the group is ignored by the Serverhost
ignore: false
# path to a custom running/temp directory for this group
parentDir: null

You can configure this file freely. The jvm configuration section is then parsed to a shell command and executed.

[executable] [options] [server runtime file] [arguments]

This also means that you can change the executable, arguments and options freely for each server group. You can also use any group property. Property placeholders follow this syntax: %PROPERTY_NAME%

Crash Handling

There are two types of crashes that can happen:

  1. The Serverhost crashes
  2. A minecraft server crashes

ServerHost Crash

If the Serverhost crashes, you have to restart it manually. What's really cool is that the managed Minecraft servers will continue to run, even if the Serverhost is not running. After a restart, this component will automatically detect all running servers and reattach to them.

This also means that you can restart the Serverhost without any downtime for the managed Minecraft servers, so you can update the component without any problems.

Minecraft Server Crash

If a minecraft server crashes, the Serverhost will automatically inform the controller about the crash and the controller will start a new server, if needed.

Tech-Stack

These are the technologies used by the Serverhost:

On this page