WorldQL / mammoth

Scale a single world horizontally across multiple Minecraft servers.
https://www.worldql.com/posts/2021-08-worldql-scalable-minecraft/
MIT License
854 stars 47 forks source link

🪦 This project is no longer maintained. Check out MultiPaper.

Mammoth: Horizontally scalable Minecraft server

A Spigot plugin demonstrating WorldQL's database and message broker.

What is Mammoth?

Mammoth uses WorldQL to scale a single Minecraft world across multiple server processes. Running multiple Minecraft server processes allows for better core utilization and allows for more players to enjoy a single world. A collection of Minecraft servers using this plugin to sync with a WorldQL server is called a Mammoth cluster.

Mammoth has two modes:

How to use Mammoth

  1. Set up WorldQL. Download the latest release for Linux from https://github.com/WorldQL/worldql_server/actions and extract it into a folder.
    1. Set up a database using the commands below (change the password):
      CREATE DATABASE worldql;
      CREATE USER dbuser_worldql WITH PASSWORD 'example';
      GRANT ALL PRIVILEGES ON DATABASE worldql TO dbuser_worldql;
    2. Create a .env file with the following contents:
      WQL_SUBSCRIPTION_REGION_CUBE_SIZE=16
      WQL_POSTGRES_CONNECTION_STRING="host=localhost dbname=worldql user=dbuser_worldql password=worldql"
  2. Set up redis-server and run it on localhost.
  3. Use https://github.com/WorldQL/mc_provisioner to create your Minecraft cluster. Download the latest version of the Mammoth plugin from https://github.com/WorldQL/mammoth/actions and place it in a plugins folder next to the provisioner executable.
  4. Create the servers with ./provisioner init and run them with ./provisioner start.
  5. The default config will be copied to all servers in the cluster. You can copy it into your top-level plugins folder and edit it to your desired configuration. Once you've made changes to your plugins folder, you can push it to all servers with ./provisioner stop && ./provisioner sync && ./provisioner start.
  6. Create a Velocity proxy server and add all your cluster servers to it with the names mammoth_0, mammoth_1, etc. You can change the server name prefix in config.yml.
  7. Start the Velocity proxy and connect to it. It will be running in sliced mode by default with divisions every 100 blocks for demonstration purposes (you should set this to a value over 1000 for actual servers). Place blocks and cross a server border and watch everything sync.

Features

History of Mammoth