Minecraft, Spigot, Bungeecord and Docker!
Tiddler has lately got really "into" Minecraft, spending rather too much time watching YouTube videos (Thanks, Stampy!) and creating her own worlds..
From my point of view, I quite like the idea of being able to add custom mods, and the (mostly) friendly and open ecosystem that has developed around it. It reminds me very much of my time spent in, and writing patches for, WorldsAway, oh god, nearly 20 years ago... That was a fun time... it's a pity they didn't operate a bug bounty - I found quite a few!
Anyway, back to Minecraft. She wanted to play with me, so we started off by my downloading and running the official "vanilla" server on one of the linux boxes. It works, but is limited. So I go find out that there is lots of alternate server software available. We end up with a two or three on different ports. But the little box I was running it on really couldn't cope - a low end pentium that usually just ran an asterisk server!
So lets upgrade. An impulse eBay purchase a few months back had bought me a Dell Poweredge 1950. A rack server, which was currently sitting idle after an initial play. With Dual 4-core Xenons and plenty of RAM, it was obsolete, but still probably the most powerful machine in the house! It was just itching to be used.
Now, with the prospect of letting the public into the minecraft server at some point, and with an urge to "do things properly", I wanted some form of isolation for the server processes. Running a full blown VPS or virtual machine felt a little overkill, so I started looking around at what was recommended. Now, years back, I used to use jails on FreeBSD, and it seems that the current flavour of the month builds on that concept, and is called Docker.
Now Docker does seem like the bees knees. Reasonable isolation of a process with very little overhead, and in an ostensibly portable fashion Let's use that then.
Several days of playing and one steep climb up the learning curve later and I'm pretty familiar with the basics.
Now... Minecraft. ... How to do multiple servers or worlds easily. This brought me to Bungeecord. It is basically a proxy, that will control and switch users between servers. That's better - no need to set up an entry on each client for each server - just do the one, and we can change servers on-the-fly once logged in, and I control all the config from the server itself. This seems to be closely tied to the Spigot server sofware, so we might as well use that for the servers.
OK. The configuration.....
Firstly, we'll use data containers for all the, well, data. This means I can delete and re-run things without having to re-configure the servers all the time!
We're going to be supporting multiple worlds, so in this example, we will call them simply world0, world1, world2, etc. You may wish to use more descriptive names.
Create a data container..
sudo docker run -t -i --name world0-data -v /minecraft busybox true
Create a server..
sudo docker run -t -i --volumes-from world0-data -e EULA=true --name world0-server nimmis/spigot
That should all fire up and eventually leave you at a > prompt - type stop to exit.
Now the more discerning among you will have noticed that we didn't specify any ports to reveal on that run command, so nothing will be able to connect to the server! I know; that's deliberate. We don't want just anybody connecting, after all.
Next, we need to adjust the config on the server, because bungeecord requires the individual servers to be in offline mode - it handles the authentication itself. The config will be in /minecraft/server.properties, which is within the data container, so it's easy to create temporary access
sudo docker run --rm -t -i --volumes-from world0-data centos /bin/bash cd /minecraft vi server.properties exit
You can also use the same technique to install any mods, ready-made maps, or other customisations. If you need to install any extra programs into the container to allow you to fetch these, e.g. wget, ftp, scp, etc., then that's fine - you are working in a temporary container, and you will not affect the programme container, keeping it lean. Only items you place into /minecraft - the data container - will be preserved!
Repeat for as many worlds/servers as you wish to create!
Now to use bungeecord to link them all together,
Create a data container for that too..
sudo docker run -ti --name bungee-data -v /bungeecord busybox true
And then create the server container..
sudo docker run -ti -p 25565:25565 --volumes-from bungee-data -e EULA=true \ --name bungee --link world0-server:world0 \ --link world1-server:world1 --link world2-server:world2 \ rehf27/bungeecord
Make sure you add a --link for each server you created and wish to give access to.
After it fires up, and finishes creating everything, key "stop" to exit. The rehf27/bungeecord image drops to a bash prompt on exit, so you can edit the config directly here.
vi /bungeecord/config.yml
If you need to do anything more exiting, or adjust things later, you can use the same technique as before to access the configuration from a temporary container -
sudo docker run --rm -t -i --volumes-from bungee-data centos /bin/bash
So, edit Bungeecord's config file, and change as appropriate. The main things to alter are the listener ports - change to 25565 (as per the run command above) and the list of servers:
servers: lobby: motd: '&1Lobby Server' address: world0:25565 restricted: false newworld: motd: '&1A New World' address: world1:25565 restricted: false anotherworld: motd: '&1Another World' address: world2:25565 restricted: false
- the "world0", "world1", etc in the address field comes from the alias, the part after the colon in the --link options on the run command. Each of these is placed in the /etc/hosts file on this container, so that you can locate them, and specifying the link grants the access, so you don't need to open ports!
Save, and exit.
Now. start all your servers if they are not already
sudo docker start world0-server sudo docker start world1-server sudo docker start world2-server ... sudo docker start bungee
Then point your minecraft client at your server IP, and have fun!
If you add or remove worlds later, you will need to crate a new bungeecord container with the new links. Delete the current one..
sudo docker rm bungee
and create the new one, eg..
sudo docker run -ti -p 25565:25565 --volumes-from bungee-data -e EULA=true \ --name bungee --link world0-server:world0 \ --link world2-server:world2 \ --link world3-server:world3 --link world4-server:world4 \ rehf27/bungeecord
Because we used a data container, all existing configuration, mods, plugins, etc., will be preserved! You can open a temporary container to edit the config file for the changes to the list of hosts just as we did before.
One caveat - stopping and starting a server will give it a different private IP address, which means the bungeecord server won't be able to connect to it - you will have to restart the bungee server to have it update things. (There may be an option somewhere to preserve the private IP assigned to a container, but I've not yet looked for it. If there is, use it!)
For those of you that outgrow a single physical server, having your individual services Dockerised (is that a word yet?) means you can easily transfer them to another server with virtually no changes! This useful link shows how to configure "one" docker across multiple physical hosts!
There also seems to have been work to add new --links to running containers; with a little bit of extra code to interrogate the environment, this should make it possible to dynamically create the Bungeecord config file (or the hosts list at least) and avoid some of the additional configuration steps necessary to add new servers.
There are lots of ways to improve all this, but the aim of this write-up was to show how I got things working in the first place! :-)
20 Comments:
This comment has been removed by a blog administrator.
By mind.it, At 7 July 2017 at 11:11
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. Minecraft Server List
By Saqib Khatri, At 22 July 2017 at 15:06
There are several different types of website hosting that could be beneficial for you but it is important that you know what sort of website you want to create before you start making any major decisions. If you are looking for best minecraft server hosts, then visit meloncube.
By Unknown, At 13 September 2017 at 13:27
Really very nice information you have posted. I genuinely loved it. If you want to know about the Best Minecraft Servers then visit Bisect Hosting !!
By Phillip Hughes, At 18 April 2018 at 09:25
Thanks for your information and you have narrated a useful information in this article.
JAVA Training in Chennai
Best JAVA Training institute in Chennai
Python Training in Chennai
Selenium Training in Chennai
Android Training in Chennai
Big data training in chennai
JAVA Training in Chennai
Java Training in Tambaram
By sheela rajesh, At 11 May 2019 at 06:39
Thanks for sharing. We would like to let you know we deliver reliable hosting service Visit us at Minecraft Server Host
By Aaron Juan, At 17 June 2019 at 14:17
Download Minecraft for School From this
By Unknown, At 8 August 2019 at 11:48
Very relevant content. Great post. I'll definitely follow your guide.
data backup solutions for small business
By Victoria, At 3 December 2019 at 10:36
I read this article. I think You have put a lot of effort to create this article. I appreciate your work.
Visit us for Printing IDs & Accessories.
By Rajan Mhatre, At 17 July 2020 at 13:30
this page give to me lot of information..keep share more information!!!
android training in chennai
android online training in chennai
android training in bangalore
android training in hyderabad
android Training in coimbatore
android training
android online training
By Revathi, At 10 August 2020 at 05:41
Superb, I think this is one of the best pieces of information found on this blog. Ogen Infosystem is one of the best Website Designing and SEO Services in Delhi, India.
SEO Service in Delhi
By OGEN Infosystem (P) Limited, At 14 December 2020 at 07:44
With special privileges and services, UEFA BET offers opportunities for small capitalists. Together ufa with the best websites that collect the most games With a minimum deposit starting from just 100 baht, you are ready to enjoy the fun with a complete range of betting that is available within the website
ufabet , our one another option We are a direct website, not through an agent, where customers can have great confidence without deception The best of online betting sites is that our Ufa will give you the best price
หาคุณกำลังหาเกมส์ออนไลน์ที่สามารถสร้างรายได้ให้กับคุณ เรามีเกมส์แนะนำ เกมยิงปลา รูปแบบใหม่เล่นง่ายบนมือถือ คาสิโนออนไลน์ บนคอม เล่นได้ทุกอุปกรณ์รองรับทุกเครื่องมือ มีให้เลือกเล่นหลายเกมส์ เล่นได้ทั่วโลกเพราะนี้คือเกมส์ออนไลน์แบบใหม่ เกมยิงปลา
อีกทั้งเรายังให้บริการ เกมสล็อต ยิงปลา แทงบอลออนไลน์ รองรับทุกการใช้งานในอุปกรณ์ต่าง ๆ HTML5 คอมพิวเตอร์ แท็บเล็ต สมาทโฟน คาสิโนออนไลน์ และมือถือทุกรุ่น เล่นได้ตลอด 24ชม. ไม่ต้อง Downloads เกมส์ให้ยุ่งยาก ด้วยระบบที่เสถียรที่สุดในประเทศไทย
By Maradona Jons, At 10 May 2021 at 18:42
Probably the most genuine football betting UFABET that's beyond description Find fun, excitement and excitement with slot video games, hundred totally free recognition, quick withdrawal. If you desire to have fun slots for money No need to deposit a great deal, no minimum, no need to share, squander moment for the reason that UFABET is in fact reduced, given seriously, many great offers are waiting for you. Prepared to ensure pleasurable, regardless of whether it's Joker SlotXo fruit slot, we are able to phone it an internet slot website for you personally especially. Ready to have fun Like the support staff which is going to facilitate slot formulas as well as techniques of actively playing So you will be certain that each minute of fun and pleasure We will be there for one to give your customers the best appearance as well as fulfillment.
บาคาร่า
สล็อต
ufa
แทงบอล
By Marty Sockolov, At 31 May 2021 at 19:24
Thank you so much!!!! Indian visa for US citizens, This can easily be obtained online. Now you can apply for a tourist visa online. It is available from 15 November.
By Deniel Alex, At 9 December 2021 at 10:09
Your post is very informative and useful. India emergency visa processing time is faster as compared to traditional visa. You can get a visa in just a few days.
By James, At 28 January 2022 at 06:24
Hello sir, This is a fantastic article you've written, keep it up, For business visa applications, the Myanmar visa online service has been restarted as of 1st April 2022.You can get more info about Myanmar visa fee via our Myanmar evisa page.
By CARLY MARISA KISSINGER, At 7 April 2022 at 14:14
Your blog provided us following intense recommendation to do some thing taking into consideration than. each & all suggestions of your bring in are extraordinary. thank you lots for sharing. keep running a blog.. ! Invitation Message For Kitty Party
By cyber pc, At 19 May 2022 at 09:52
Great portfolio its too good much effective.
Netdrive Crack
Hd Video Converter Crack
Sony Vegas Crack
Camtasia Studio Lifetime Working Crack
Adobe Illustrater Crack
Ashampoo Burning Studio Crack
By softkeybox, At 10 July 2022 at 07:46
This comment has been removed by the author.
By Alexender, At 7 June 2024 at 06:16
What an amazing post! Your ability to make complex ideas understandable is remarkable. The visuals are superb, adding depth to the content. Your writing style is engaging and keeps readers hooked until the end. Excited to see what other intriguing topics you'll cover in future posts. Curious about Saudi Arabia travel regulations? The question, "Do Australians require a visa for Saudi Arabia?" is common. Yes, they do. Australian citizens planning a trip to Saudi Arabia must secure a visa in advance. Understanding the visa requirements and application process is essential for a hassle-free journey. Let's delve into the details.
By Alexender, At 7 June 2024 at 06:17
Post a Comment
Subscribe to Post Comments [Atom]
<< Home