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.
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 Serverhostsimplecloud install serverhost
Make sure to set content of the secrets/auth.secret file to the same value
as the auth.secret in the controller, otherwise the Serverhost won't be able
to connect to the controller.
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.
You have to make sure that the proxies send the correct player count, if
you're not using our Proxy Essentials plugin,
otherwise the player count will be wrong.
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.
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-urldynamic group property.
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 argumentsjvm: 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 Serverhostignore: false# path to a custom running/temp directory for this groupparentDir: null
You can configure this file freely. The jvm configuration section is then parsed to a shell command and executed.
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%
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.
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.