11/6/2023 0 Comments Minecraft flux networks cpu usagemc-monitor needs to be able to push in to telegraf via loopback, so that also needs to be on loopback. We have telegraf configured to use host networking because we want it to be able to report on the host's network interface usage. var/run/docker.sock:/var/run/docker.sock This should be saved to /usr/local/share/$HOSTNAME/compose/docker-compose.yml version: '3.1' Our compose file is pretty simple - it defines the 3 containers and the paths they should use for volumes. The telegraf directory is where we'll put Telegraf's configuration file. The directory data will contain all minecraft data - this is how your server will persist between container restarts/reboots etc. Mkdir -p /usr/local/share/$HOSTNAME/files/data Mkdir -p /usr/local/share/$HOSTNAME/files/telegraf Mkdir -p /usr/local/share/$HOSTNAME/files We need to setup a heirachy for our files to be stored in, so mkdir -p /usr/local/share/$HOSTNAME/compose monitor: A container running mc-monitor to pull stats from minecraft and push them into telegraf ( itzg/mc-monitor).telegraf: Telegraf collects and forwards system level stats ( _/telegraf).minecraft: The minecraft server ( itzg/minecraft-server).Having restricted access, we can now look at getting our containers running. If you want to allow worldwide access, then you can run iptables -I minecraft -j ACCEPT in order to do so. Note: I've chosen to restrict access to minecraft to specific IPs. Ip6tables -I FORWARD -p tcp -dport 8094 -j REJECT Ip6tables -I INPUT -p tcp -dport 8094 -j REJECT Iptables -I FORWARD -p tcp -dport 8094 -j telegraf Iptables -I INPUT -p tcp -dport 8094 -j telegraf Iptables -A telegraf -s 127.0.0.1 -j ACCEPT Ip6tables -I FORWARD -p tcp -dport 25565 -j REJECT Ip6tables -I INPUT -p tcp -dport 25565 -j REJECT Iptables -I FORWARD -p tcp -dport 25565 -j minecraft Iptables -I INPUT -p tcp -dport 25565 -j minecraft Iptables -A minecraft -s 127.0.0.1 -j ACCEPT We're going to manage containers using docker-compose so we also need to install that curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-composeĪs we're going to be exposing services, we should restrict access apt-get install iptables-persistent $(lsb_release -cs) stable" | tee /etc/apt//docker.list > /dev/nullĪpt-get install docker-ce docker-ce-cli containerd.io The very first thing we need to do, is Install Docker.Īpt-get install ca-certificates curl gnupg lsb-releaseĬurl -fsSL | gpg -dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg If you do not, then a free Influx Cloud account will also work. It's assumed that you already have an InfluxDB instance running. We're going to be pushing stats into InfluxDB - Telegraf does support other outputs, but that's out of scope for this post. This document assumes you're running Ubuntu, but if you're not then it's only really the Docker installs steps which are Ubuntu specific. Technically, this should all work with running a Bedrock server too, but I've not tried that. This documentation details how to tie that all together in order to use Docker to stand up a Minecraft Java edition server and monitor it using Telegraf to push monitoring data into InfluxDB or InfluxCloud. I wanted to find an even simpler route, though, and wanted something that gave me the ability to monitor the server (if only so I could fix stuff before getting complained at).Īlthough I came into this ready to build my own images, it turns out a bloke called Geoff has done a sterling job not only of dockerising Minecraft-server, but also creating a monitoring tool. Running a Minecraft server has always been fairly painless, with the biggest headache usually being getting the right version of Java up and running.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |