Databases

Some game servers or mods (like Minecraft plugins) can benefit from having a dedicated database. This can result in increased performance, and you can also connect multiple servers to the 1 database. A good use-case for this is the McMMO plugin. This allows your players levels to follow them between all of your Minecraft servers.

Drawing

Database solutions

There are a few ways to do this, each with their own advantages and disadvantages

Difficulty to configure
Difficulty to manage
Impact of cyber breach
Impact of database corruption

Shared Database

starstarstarstarstarstarstar
starstarstarstarstarstar
starstarstarstarstarstarstarstar
starstarstarstarstarstarstarstar

Per Node

starstarstarstarstarstarstarstarstar
starstarstarstarstarstarstarstar
starstarstarstarstarstar
starstarstarstarstarstar

Panel Database

starstarstarstarstarstarstar
starstarstarstarstarstar
starstarstarstarstarstarstarstarstarstar
starstarstarstarstarstarstarstarstarstar
circle-info

Higher is worse (eg harder or less secure)

Shared database

Drawing

The database is hosted on a dedicated node, and the other nodes connect to this one. The other nodes need to be able to communicate with the host.

If you migrate a server from node A to B everything will continue to function.

If your database corrupts you may lose all data for all nodes.

If one of your game servers is breached and the bad actor got your database credentials they may be able to alter the other server DBs. This is unlikely though, as Pelican creates a dedicated user per database.

Database per node

Drawing

This is the most secure method, as each node has its own database - there is no communication outbound. Migrating a game server from node A to B will break the database connection

If your database corrupts you may lose all data on a single node

If one of your game servers is breached and the bad actor got your database credentials they may be able to alter DBs on the node. This is unlikely though, as Pelican creates a dedicated user per database. The bad actor will not be able to touch databases on other nodes.

Use the Panel database

Drawing

This is the most dangerous option.

If one of your game servers is breached and the bad actor gained database credentials, they may be able to alter your Pelican database. This would allow them to create an administrator user and take over your Pelican install.

If your database corrupts you may lose all data for all nodes and the Panel data. This would require a Pelican reinstall or restore from backup.

Create your Database

This guide will step you through how to create a shared database from a Ptero / Pelican egg.

circle-info

This requires all nodes to be able to access the machine hosting the database. If your notes are not located all at the same site, you could use a VPN client or go down the per node route.

triangle-exclamation

Create your Database

If you haven't already, import the relevant database egg per Import eggs

circle-info

I am going to assume MariaDB for this guide - your commands may be different if using something else

You may need to do some reading on your servers / mod / plugins database requirements to select the correct DB type

  1. Create your database using one of your intenal ports

    triangle-exclamation
  2. Start the database container and ensure it is marked as running. You should see something similar to

Add database to Pelican Panel

Now we need to add the database to the panel, assign a host and create the Database user

  1. Log into your panel and navigate to the Admin UI

  2. On the left, click on Database hosts

  3. Click on the + symbol

  4. Preperations tab:

    1. Save the provided credentails to your password manager

    2. Click next / OK

  5. Database setup tab:

    1. Copy paste the commands from the Panel into the MariaDB console

    2. Run the following commands to allow for login outside of local host (127.0.0.1)

    3. Click on next / OK

  6. Panel setup tab:

    Host

    DNS name or IP of the wings node running the database container

    Port

    The port selected during creation

    Display name

    Whatever you want - I would suggest the hostname / DNS name of the server

    Linked nodes

    Set this to any Wings nodes you want to talk to this DB. These nodes need to be able to reach the hostname / IP in the host field

    1. Click on create

Configure backup schedules

Backups are good, use backups.

Feel free to import one of my existing schedules from https://github.com/trentnbauer/PelicanEggs/tree/main/schedulesarrow-up-right

Per node

Follow the above guide, but you will need to do it for each node. In step 6, set the linked node as the machine running the database - do not set any other linked nodes.

Panel database

I will not show you how to configure this. The risk to bricking your install of Pelican is too high. Follow the shared guide


Troubleshooting

"Unable to resolve host" or similar message.

Try your servers IP address - some containers are unable to resolve internal network names.

Last updated