Sunday 7 July 2013

Coup de Grace

Digging in the Wrong Direction

Sometimes when you take a step into the unknown you fall into a hole. But when you start digging your way out, make sure you're not digging downwards! I'm starting to feel this way about the new server project. There's been new stuff to learn and as ever, the devil's in the detail.


I took the decision earlier this week to order a new mSata card, altering my return request from 'replacement' to 'money back'. The idea being to get alternative hardware much quicker, and once the returned item had been processed I'd be back in pocket in a week or so. Sure enough the order for the replacement card arrived the next day (another thumbs up for eBuyers free five day postage) and I called eBuyer's tech support to get a returns number, then printed off the postage label they'd emailed.

After seeing the newly delivered jiffy envelope my son was keen for us to try the server again that evening. We got the younger two off to bed, I set the server back up, whipped the lid off and fastened in the new card. To keep things simple I decided to just try a plain disk format rather than doing a partition copy. I ran fdisk, creating two partitions, and then entered the following command to format as the basic Ext2 linux format.

   pingu:=# mke2fs /dev/sda1

I'm using Ext2 because I want to limit writes to the SSD as writing to them wears them out. (No seriously it does!) Similarly I'll specify noatime in the fstab so that file last access times are not saved, further reducing disk writes.

The format command started OK, then I felt that awful deja vu as it crashed again with the same "Buffer I/O error on device" error, followed by a segmentation failure. There seemed little point in sending the original mSata card back now, clearly the problem lies elsewhere!

Search and Ye Shall Find

I did a bit of googling using search terms 'DQ77KB' and 'mSATA' and eventually I found Martijn Koster's blog about his almost identical build. The only real difference is that he's using a slightly faster processor. He'd put together quite a good overview but the thing that really interested me was that he'd updated his BIOS to 'KBQ7710H.86A.0051' using the F7 and USB stick method.

Well, in for a penny, in for a pound, I downloaded the zip version & did the same. Then I then restarted the computer and ran another format using the Debian 7 installer disk. This time it seemed to get through and went on to install the operating system. It still threw up the odd error along the way, but it allowed me to continue. After a few minutes it announced it was finished and then performed an auto re-boot. Sadly it but didn't get very far, more kernel errors flashed by and then it locked up. I was starting to wonder if something else might be wrong, maybe the memory?

I decided to sleep on it.  Z Z Z Z Z Z z z z z . . . . .

The following day I did a few more searches, mostly hitting the same stuff from the previous day, but then I saw a post where somebody recommended resetting the BIOS to defaults after after an update. Well that made sense, and I certainly hadn't, so I decided to give it a try that evening.

To my amazement it worked, so I returned back to the task of cloning my old disk and setting up lilo so the mSATA card would boot. Then remembering I'd previously altered some of the bios settings I set the RAM voltage back down to 1.35 volts. Restarting again I found that the computer would no longer boot, the errors coming back. This continued until I set the voltage back to the default  of 1.5 volts.

I'd gone out of my way to buy low voltage sodimms, but it looks like that may have been one of the root causes of my hardware problems. Now I had a 2nd nSATA card that I didn't need along with an mSATA to 1.8" adapter board (which I'd hoped to use as a backup plan). To add to my frustration the adapter came with a micros-sata connector on it (which was no use to me). Ghaahh.. how many connection standards do we bloody need!!!

1.8" Adapter board alongside standard SATA plugs

I looked up the micro-sata connection standard on wikipedia and found the data connection is the same but the power is much smaller. Instead to two separate plugs it expects one, with the data and power merged together.

Quick, Think of a Plan B!

The computer was now working fine, but cloning the old servers root partition wasn't. After messing about setting up the boot loader, all attempts to start it resulted in an invalid chipset error. I can't say that I'm that surprised, but it meant I was going to have to re-install Debian from scratch. It's not the end of the world, but it means running two servers until I got all the software installed and configured on the new box. I was really hoping to avoid this!

The first thing after a fresh operating system build was to install Java 7 and get Minecraft server running for 'His Nibbs'. Stack Overflow had a Q&A page where somebody had asked about how to install java using the apt-get utility. So I scrolled down to the answer, then copy and pasted the following code into the terminal window:

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java7-installer

It worked a treat, adding the java sources and then performing the install in only a few minutes.

Next thing was to get the latest Minecraft Server build from www.minecraft.net/download. We grabbed the minecraft_server.1.6.1.jar and installed the linux screen utility. Requiring us to simply copy the jar file onto the server and run it with the following command:

screen java -Xms512M -Xmx1G -jar minecraft_server.1.6.1.jar

Then you can leave it running by pressing Ctrl + A D, and return to it later by entering screen -r

Is it me or do some sites seem to hide there stuff in amongst a load of old twaddle and psuedo-information? I scanned down the main minecraft.net page unsure of where to click,  then gave up and googled "minecraft server download" to find that link above. I despair at times!!

3 comments:

  1. Good progress man! Gratz on the server!
    If I could be so bold I would recommend running CraftBukkit instead of the vanilla server.
    You will be able to work with plugins a lot easier and control who has access to what.
    (WhiteLIst / grouped permissions etc).
    http://dl.bukkit.org/downloads/craftbukkit/

    PermissionsEx is almost a must have, WorldGuard and MultiVerse are also very useful.
    There's also a good backup plugin that can be scheduled and has lots of useful rules you can employ to tweak it precisely plus multi-generation house keeping and creating zips of your world backups automatically.

    Also it's worth looking at Tekkit Servers as they are like MC on steroids and pretty straightforward to setup, heck you can even make your own mod packs from your favourites and launch the server through the Tekkit Launcher!
    A lot of the plugins rely on yml files written in (unsurprisingly) YAML.
    There's a handy parser here should you require one :
    http://yaml-online-parser.appspot.com/

    If you run a server also be aware sometimes the mods you install do NOT keep in line with updates to MC and you are forced to run on an older version of MC. In this instance Multi-MC is a godsend for your friends that have leaped ahead and installed the latest version but would like to still play on your server.
    http://www.minecraftforum.net/topic/1000645-multimc-43-windows-linux-mac/

    Good luck and happy mining!

    ReplyDelete
    Replies
    1. I had looked at Bukkit when I was trying to find ways of reducing server processor impact, but at that stage (not having anything like enough horse power) it was no use to me.

      It's probably worth looking again.

      The Multi-MC patch sounds like a pretty useful add-on, Saul updated his client to 1.6.1 and that caused a problem with the original server which was still on 1.5.2 (I think). I was surprised when he wasn't allowed to access it anymore.

      I got it installed and working on Saturday morning and I left him trying to get a game organised while I popped out to the shops. Sadly non of his friends where available.

      Know anyone who wants to buy a 60Gb mSATA card?

      Delete
    2. Yay! Working server!

      Yep, Minecraft does not offer any backwards/forwards compatibility. You want to connect to a 1.5.2 server, you have to run a 1.5.2 client. It makes sense if you think about it, since you're not simply running a dumb terminal or front-end, but a lot of game assets and some processing will be on the client side.

      We've talked about modded Minecraft off-blog before. Personally I've gone the Forge/FTB route rather than Bukkit/Tekkit, though I started with Tekkit and think the the two options are very much a Playstation/Xbox or PC/Mac sort of choice with no clear "best" option. I do suspect though that a full modded minecraft pack might put a bit too much strain on Neo-Pingu after a little while.

      Delete