Request: Auxiliary Servers Script?
 

Request: Auxiliary Servers Script?

Started by WoodsieLord, 25 February, 2009, 06:09:15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WoodsieLord

Hello! I know I'm 'almost' new but I read the formus quite often, so here is my first script request! I hope someone finds my request interesting...

Long story Short: Auxiliary servers pinging hierarchically then updating DDNS.

For many of us, hub owners, that suffer from bad ISPs. Certainly, many of us have server problems from time to time...  Sometimes our internet connectivity goes down, electricity grid problems? Server gots messed up... one way or another, we usually have a friend or two that helps out as a backup server, we redirect our DDNS to his IP Address until everything sortes out.
I've been searching for weeks, for any kind of de-centralized server bakcup solutions... maybe I'm blind but as long as I see, there are none. So I've been thinking and reading about a possible solution. I came up with an idea, but I really don't have the knowledge to program something like this.

I thought about a script family that would run some Pings individually (de-centralized) and depending on the errorlevel, update (or not) a specific Dynamic DNS address.

Please let me try to explain this. First of all (premises):
(I will make use of no-ip as an example DDNS, I don't mind if this may be accomplished with any other free DDNS services)

- There is a primary Ptokax server running 24/7 at hubserver.no-ip.org
- Friends #1 & #2 have a home server (each) running 24/7 (or most of the time) that could host Ptokax.
- Both Friends, have Dynamic DNS addresses (friend1.no-ip.org; friend2.no-ip.org)

The scripted/automated part:

- Primary Ptokax server would run a script that will try to update hubserver.no-ip.org every 10 minutes.
- Secondary Ptokax server (friend #1's home) would run a script that will ping hubserver.no-ip.org every 10 minutes. If no response from the server, then update hubserver.no-ip.org. Repeat every 10 minutes.
- Tertiary Ptokax server (friend #2's home) would run a script that will ping both hubserver.no-ip.org AND friend1.no-ip.org. If NEITHER respond to ping, then update hubserver.no-ip.org. Repeat every 10 minutes.

I know there is a lot of wasted pings and resources but, give it the time intervals you like. If downtime is the main concern, this method may provide server redundancy.

If no one finds this procedure useful or interesting to attempt, I will have to try this on my own way. I don't know LUA, so I will have to work around with simple BAT files for windows and CRON them with the windows' embedded timed tasks feature. I'm suggesting this to be done in LUA because it is completely different to know that a Host is accesible than if the host AND Ptokax are running and are accessible :)

I always thought that you may find this whole idea completely Crazy. If the hub is THAT important (big?) then pay for a good dedicated server and stop complining! Yeah, I thought of that too... but in my case, my hub has 20 users (twenty) since 2006 (first time online). We all know each other, I mean.. we usually met face to face at least twice a year! We use our hub somewhat as a chat server (file transfers are rare, lately. And if they do, we share Anime stuff.. not licensed)
So! that's why I'm not moving to a dedicated server... they're just too expensive for only 20 of us!

I know I'm not good for explaining my ideas, plus I don't speak english very well and plus I wrote a lot. So if you made it This far, I really appreciate it. I'm looking forward to any comments.
Thanks, once again.

CrazyGuy

The idea is not new, but as said, has never been developed yet either.
There's been talks about having an online-status check as part of a Hub-Hub protocol.
As the H-H-protocol never finished, neither did the status checking.

However, this can be accomplished by script, and I think even a bit easier then your suggested situation.
For example is the actual PING not needed. 1 Hub can try to connect to another, and once it receives the first protocol command back, disconnect. It knows then the hub is online. If the connection times out, the hub was offline.

As LUA-sockets are blocking (they will wait indefinate for answer/timeout to occur) all other hub activities, including chat and searches, are paused. As long as the hubs are online this won't cause a problem, but if it tries to connect to an offline hub, the hold may cause connection resets on connected users. Something to keep in mind.

I'd also suggest the checking timer to be no less than 30 minutes. DNS updating may take up to 45 minutes, so checking every 10 minutes can give a double or even triple "hub offline" result just because the IP hasn't been updated yet.

The only real challenge may actually be the updating of the DNS-addresses. This would depend strongly on the DNS host. Let's see what Mutor has to say about this. When it comes to using Luasockets he's the best bet.

bastya_elvtars

This needs a better dynamic DNS, like liquidlocation.
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk