Minecraft Server Architecture

In the spring of 2011, I worked for a small company in Salem, Oregon. The company is gone now, but I retained something that was passed on to me by their lead DBA: the Lexmine Minecraft server.

It’s been two years since then, and the server has gone from a simple “vanilla” server to the multi-server cluster it is today. This document will explain the current server and network architecture and provide some instruction for anyone interested in recreating a similar setup.

Currently, the PiCraft server cluster consists of three physical servers running Ubuntu Server, all connected via NFS and the Multicraft software. There are scripts to update the files on the primary server, and init.d entries to run specific scripts at startup, ensuring that the servers correctly come back online automatically in case of power loss.

The primary server unit is where the Multicraft admin panel frontend, MySQL server, and the NFS server is located. All three physical servers are running the Multicraft backend, however the executables and plugin files are stored only on the primary unit. By using symbolic linking and NFS, only one copy of each plugin file needs to be stored.

The MySQL server configuration is fairly simple. I’m using Ubuntu Server (a flavor of Debian Linux), so the MySQL configuration file is located at /etc/mysql/my.cnf

Once MySQL is configured, you can set up the Multicraft backend and frontend. This does require that an Apache 2 webserver is installed and running. All defaults may be used for Apache 2. Setting up Multicraft can be done via the included installer.

Setting up NFS was slightly more tricky. NFS requires you to mount and bind the folder you’d like to share via the network. To make this happen across reboots, you have to edit the /etc/fstab file.

Once MySQL, Multicraft, and NFS are set up, adding init.d entries is the last portion of automating the startup.

Once these things are configured, the server can be rebooted, and all required services will be started automatically. Note that some things, like backups will require the configuration of cron jobs.

If you have questions about the process, or need specifics, let me know in the comments.

Posted in Code Monkey Report | Leave a comment

Firing a client

Today I fired a client. I’m normally quite accommodating. I’ll go out of my way to correct a client’s problematic assumptions, nail down vague details, and generally allow the client to proceed in blissful ignorance of the actual process of web development. But today’s client, not so much. Continue reading

Posted in Code Monkey Report | Leave a comment

Windows…no more.

Dear Microsoft Windows:
You were my first GUI, way back in 3.1, and since then I’ve enjoyed 95, 98, NT, 2000, XP, and Win7. We’ve laughed, cried, and fought with eachother for years…and we’ve had a lot of good times, especially with XP and 7. I learned the foundations of programming, troubleshooting, and technology through your digital portal.

But I’ve found someone else now. At first, it was just a work thing, a few times a week, and I kept coming back to you whenever I wanted to have some fun, but then it got more serious. I started doing all my work on Linux, and you just couldn’t keep up with my more technical needs. But I still faithfully installed you on every system I owned, because you had one thing I could never get on Linux…my games.

My games, my beautiful graphics rich, hardware intensive games. RPGs, FPSs, MMORPGs…you had them all, and Linux just couldn’t keep up. Oh, there were a few times I installed a little something on Linux, but it was never that much, and never for long…you always drew me back with your high polygon counts and Hi-Rez texture packs.

But now Linux plays my games with me too, and other than to watch Netflix (which I can do on my Android phone much more easily), there just isn’t any reason for me to keep you around. And on top of that, I hear that you and that trendy little tablet interface have been seeing each other.

I’m sorry, but it’s over.

Sincerely,
Kevin and xUbuntu Linux (and Sessha, who started using Linux on her laptop a while back)

Posted in Code Monkey Report | Leave a comment

Ubuntu Sound issues

Over the past couple of days, the audio on both of my computers stopped working. Not a huge issue, so I mostly ignored it, especially since as soon as I plugged in a USB audio device, everything worked fine.

Then, I broke my USB headset. And it became a problem, because coding without music is like a peanut butter sandwich without milk.

So, I found a delightful page on the Ubuntu Help Pages describing the simple 17-step process for troubleshooting sound issues…complete with all the command line entries necessary. Sighing at the annoyance of going through all this just to get sound, I copied and pasted the first command…completely forgetting that I was already running an APT process in the background…which caused most of the command to fail.

Especially the last bit, which was supposed to shut off pulseaudio. It said pulseaudio wasn’t running. Which prompted me to simply run pulseaudio from the command line…fixing my problem. I added an entry to start pulseaudio on startup, and I was good.

As it turns out, when I uninstalled the pulseaudio-equalizer plugin, the entry for pulseaudio got removed from startup. I had originally installed this on both of my computers, and later uninstalled it after it was causing issues for my headset.

Posted in Code Monkey Report | Leave a comment

Non-static method should not be called statically

Need to resolve a pesky “Non-static method should not be called statically” error?

Strict Standards: Non-static method PEAR::isError() should not be called statically in /var/www/index.php on line 30

First, go to the specific file and line number mentioned in the error. Chances are you will see something like “CLASSNAME::functionName($variable, $array, $other_things)”

To resolve the error, first create a new instance of the class:

$CLASSNAME = new CLASSNAME();

Then, call the function like normal:

$result = $CLASSNAME->functionName($variable, $array, $other_things)

It’s as simple as that.

Posted in Code Monkey Report | Tagged | Leave a comment