1

Topic: The new master server system

Ok, the thing that I always feared happend a couple of days ago. I got knocked off the internet so the master server went down and no one could find any servers. I knew that this could happen, I had a solution for it. It were going to be in 0.4.0 but with resent events I created 0.3.4 to try it out.

The previous system worked like this. There was one master server called master.teewars.com. When a server started it registered with the master and sent a heartbeat every 30 seconds. Every client just asked the master for a server listing. Thats it. This is prone to errors on several places. For one, the master server can be knocked off, that has happend. The DNS could stop working for some reason so no lookup to master.teewars.com could be done. The DNS thing is unlikly because a DNS always consists of two servers.

The new system however is much much more robust. It consists of several master servers, upto 16, easily upgradable if we want. This is how the server registers itself to a master.

1. The server starts
2. Loads previous known ip addresses of the masters
3. Resolves master1.teewars.com to master16.teewars.com.
3a. It could resolve, saves the result to masters.cfg
3b. Couldn't resolve, uses the last known ip addresses.
4. Asks all master servers how many servers they have registered.
5. Picks the server with the lowest count and registers with it.
6. Sends heartbeats to that server every 30 seconds.

If for some reason the master stops responding, it will begin the process at step 3 again and choose a new one. This means, if a master server goes down, it will take roughly about 1 minute for all the servers on that master to migrate to a new master.

Right now, we have setup 3 masters. Two in Sweden and one in France. Later on we might add more for extra redundency.

The client just asks all the masters for their server listings instead of just asking one server like the old system.

So there it is. The new improved master server system.

2

Re: The new master server system

first, nice smile

3

Re: The new master server system

Thx @matricks for the hot fix. I'm curious about the next release big_smile

Thx @asuri for stupid bullshit. Please no kiddie-idiot-posts mad

Antoine de Saint Exupéry: It seems that perfection is reached not when there is nothing left to add, but when there is nothing left to take away.
Besides -  I am the gfx guy!

4

Re: The new master server system

I dont understand anything but its good,I hope ....
THX for it

5

Re: The new master server system

Sweet. smile Sounds like top-level DNS servers, hehe. Can't get much more reliable than that.

What are you doing for the servers which are inevitably going to be running 0.3.3 for ages? Round-robin DNS across the three?

6

Re: The new master server system

The servers pre-0.3.4 will always be on master2. When we release 0.4.0, many 0.3.x will disappear, or so I think.

7 (edited by Innocent Hawk 2008-02-12 01:06:30)

Re: The new master server system

There is a good amount of spelling/grammar errors in this blog. wink

8

Re: The new master server system

Lemme guess; you first wrote "there are (...)" and then realized you'd made a grammar error? smile

9

Re: The new master server system

Yup, but I caught my error and fixed it because I always proofread my posts after making them.

You did not. smile

10

Re: The new master server system

Great :>

aka oop²

11

Re: The new master server system

LETS SEE 0.4 big_smile:D