User Name
Password
AppleNova Forums » GamingNova »

MC: Running a Server


Register Members List Calendar Search FAQ Posting Guidelines
MC: Running a Server
Thread Tools
Kraetos
Lovable Bastard
 
Join Date: Dec 2005
Location: Boston-ish
 
2011-08-15, 10:56

I'm not leaving you guys!

Rather, a bunch of people at my new job are interested in Minecraft and a few already play. I wanted to set up a server for all of us to play on, and I don't really need my old gaming PC since my new MacBook Pro runs all my games just fine. I thought about going the easy route and just running the Windows version, but that makes it hard to install stuff like Simpleserver and Bukkit and whatnot.

How does our server work? Are we running mineOS, Windows, or some other form of Linux? My first instinct was to use mineOS but I had trouble burning a bootable mineOS DVD. So now I'm running Win7 on my PC and I intend to use SimpleServer and the jar version of Minecraft.

Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2011-08-15, 12:40

Linux + custom shell scripts = winning combination.

I'll post more details later.
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2011-08-15, 19:09

Yeah, I like our server set up even though I'm not the true admin of it. I don't like the idea of the bloat in some of the other non-linux options. Why have Windows running when it takes the resources from the game.

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.”
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2011-08-15, 22:58

Okay, here are the high level points in a nutshell.

We're basically running a vanilla CentOS 5** (the branding-free version of Red Hat Enterprise Linux "RHEL" 5) server. RHEL/CentOS is a solid, secure OS right out of the box. It doesn't have any junk processes running by default that you would have to hunt down while figuring out performance issues. I've installed a few small helper command-line tools (things like "sudo"), but basically it's a vanilla install.

I installed a recent build of Java 7 for powering the Minecraft server itself. Minecraft server is just a single jar (Java archive) that is platform independent, effectively relying only on the local JRE (Java runtime environment). I picked Java 7 over the more widely distributed Java 6 because 7 has some core performance boosts over 6. Also, I was intimidated by 7 because 7 8 9.

When you first start the Minecraft server jar, you'll see that it runs in the foreground with a custom interactive command prompt. If you close the terminal window in which it's running, the server dies. To a beginner, this is probably the trickiest problem to solve. Some people have written custom wrappers or launchers. My solution to this problem was to run the server within a screen session. screen is a years-old open-source "terminal multiplexer"; that means it allows a single terminal to act as multiple terminals. One of its handy features (crucial to my setup) is the ability to "detach" a session to let it run invisibly in the background. Basically, I start screen to create a new session, start the Minecraft server, and detach it. I can quit the terminal, and it will keep running. If I want to get back to it, I open a new terminal window and start screen with the "-s" argument to tell it to resume the backgrounded session.

One of the worst performance bottlenecks for Minecraft is the disk. It reads and writes constantly, and the thrashing increases greatly as more people are active in different chunks of the world. To mitigate this issue, I created a tmpfs partition (basically a RAM disk) and moved the world files to there. Reading/writing from memory is way faster than hard disk platters. Running on a RAM disk is highly risky, though, because the partition is volatile. If the computer loses power or you forget to copy to regular disk before restarting, you'll lose everything that was there. So, I wrote a small script to pause the game and back up the world files to disk every 12 hours.

There are a few details I've glossed over, but that hits the important notes. Does that give you a better idea where to go with this? Any specifics you'd like to drill into?


** CentOS 6 was recently released, but I haven't taken time yet to look into upgrading. I don't really see reason to upgrade major versions any time soon since we're just scratching the surface of CentOS/RHEL's feature set.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2011-08-15, 23:02

Also, fuck Windows. There are zero good reasons to run Minecraft server on Windows.
  quote
Kraetos
Lovable Bastard
 
Join Date: Dec 2005
Location: Boston-ish
 
2011-08-22, 20:10

This is awesome, thanks Brad. I'm downloading CentOS 5 right now.

How much drive space does the server need? I'm thinking about getting a small SSD to solve the disk problem. Right now everyone on the server is more or less in the same few chunks, but we're going to open up the server this week which will make it worse.

Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end.
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2011-08-22, 20:12

Well, our server only has 4GB of RAM and the world lives in that. Storage isn't the issue at all. A small fast SSD would do you well.
  quote
Kraetos
Lovable Bastard
 
Join Date: Dec 2005
Location: Boston-ish
 
2011-08-23, 00:44

Hm. I installed CentOS and minecraft_server.jar, but there are a few problems. First, I can't seem to install Java 7 because when I download the package from here it tells me that it's already installed. If I do java -version I see that it's OpenJDK, which I do not want.

Also, if I try to connect to the server from another machine on the local network, it says connection refused. I tried adding the port and that didn't work either. Is there extra configuration required to allow incoming connections? And this is just on the local network, I haven't even tried to set up port forwarding yet. I can SSH to the server from my MBP, so I don't know why I can't connect to Minecraft.

Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end.

Last edited by Kraetos : 2011-08-23 at 01:06.
  quote
Kraetos
Lovable Bastard
 
Join Date: Dec 2005
Location: Boston-ish
 
2011-08-23, 15:51

So I guess CentOS is firewalled with the SSH port open by default. I opened up port 25565 and now it's good.

Now I just have to figure out how to let people connect from the outside world... cuz right now it only works in my apartment.

Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2011-08-23, 16:55

What kind of upstream bandwidth does your apartment's Internet connection have? Turtle is able to run the server out of his home because he has a freakin FIOS connection, but on my dinky cable connection, I would barely be able to support one or two external players. I haven't seen Turtle's network throughput data, but I know that when the server was hosted on AN.com proper, in the early days we saw:
Quote:
Originally Posted by Brad View Post


For reference, those regular "little" 200 kb/s spikes earlier in the graph are from my nightly DB backup and download script. I used to think those were huge and was concerned about the load they put on our network interface...
As for getting the latest version of Java, you probably first want to uninstall the old package:
Code:
sudo yum remove packagename
If you don't know the package name, try:
Code:
sudo yum list installed | egrep -i "jdk|java|jre"

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
Kraetos
Lovable Bastard
 
Join Date: Dec 2005
Location: Boston-ish
 
2011-08-23, 18:20

Quote:
What kind of upstream bandwidth does your apartment's Internet connection have?
30 megabit, up and down, late at night it approaches 50. I live next to the FiOS hub for the county

So turtle has FiOS, eh? Right now I've got the Verizon router with wireless turned off connected to an AirPort Extreme in bridge mode. What's the port forwarding situation look like to make that work? Right now the server is plugged into the APX, but I can change it to the Verizon router easily. Is it as simple as plugging it into the FiOS router, assigning a static IP, and forwarding the relevant port to that IP?

Logic, logic, logic. Logic is the beginning of wisdom, Valeris, not the end.
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2011-08-23, 19:51

Quote:
Originally Posted by Kraetos View Post
30 megabit, up and down, late at night it approaches 50. I live next to the FiOS hub for the county

So turtle has FiOS, eh? Right now I've got the Verizon router with wireless turned off connected to an AirPort Extreme in bridge mode. What's the port forwarding situation look like to make that work? Right now the server is plugged into the APX, but I can change it to the Verizon router easily. Is it as simple as plugging it into the FiOS router, assigning a static IP, and forwarding the relevant port to that IP?
In your case I'd put the MC server on the Verizon router and put it in the DMZ if it has one. Then you don't need to worry about port forwarding. Also it's one less device to effect latency. Otherwise, yes it's as easy as assigning it a static IP from the router and then forwarding the relevant ports.

Currently I have no FiOS router. I have straight Cat5 cable from the ONT to my router you've seen me post about. So I have the ports for the game forwarded to the server and the others pointed where needed. This makes the connection great for most of my traffic.

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.”
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2011-08-23, 20:53

Quote:
Originally Posted by Kraetos View Post
30 megabit, up and down, late at night it approaches 50. I live next to the FiOS hub for the county
Fuck all yous guys.
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2011-08-23, 20:54

  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba File Server setup for CentOS based offsite server needed. turtle Third-Party Products 4 2009-03-05 00:49
MS Exchange Server on a Mac / Mail Server Thoughts? Mr Ten Third-Party Products 2 2008-04-04 01:45
Trying to get me XP running tacvbo83 Third-Party Products 8 2007-11-02 11:54
Can I use Mac OS X Server to configure WinXP on a Dell Server? trevo Genius Bar 3 2006-04-20 09:04
Radius server in Mac OS 10.4 Tiger Server? dougd Apple Products 2 2005-03-20 11:30


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 03:48.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova