Sign in to follow this  
Marlon

Adding a server neighbour (headless, by DB)

Recommended Posts

Hi

 

I looked at the multi server wiki page, as well as this post 

 

It makes sense, but since I am running on a headless server, I have ssh access, and access to the db's via my internal sqlite admin.

Does anyone know (or have done it before) how to add a neighbouring server (on a separate machine, different IP) by file and sqlite db access only?

 

I tried:

1. Adding a second server row in SERVERS table, with the settings of the "other" server.

2. Adding a neighbour in the neighbours table referencing those ID's...

3. Passwords matched

 

Servers wont start with that done ("Cannot bind to requested address")

 

I am very unsure :)

 

Thanks

Marlon

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

One of your IP addresses is wrong.  Hard to say with out seeing the config.

Share this post


Link to post
Share on other sites

I cant really export the db's for this.

It would be nice if someone could tell me what the process is to hook them up from a db server point of view.

 

So INCOMING_RMI enabled, on both (in the ini files).

Do I have to add new server rows into the SERVERS table on both servers for the "OTHER" server. ie (on both servers, there will be TWO server records... ) - if this is the case, it doesnt make sense, an exact duplicate of ServerA's primary, would be ServerB's secondary, and vice versa.

 

The ServerNeighbours table, I assume just refers to the ID's of the SERVER tables.

 

The IPs themselves are "external" and "internal", both of which are the same per server, seeing as it's separate servers.

 

This is how I understand it, have it, and with no luck.

 

Share this post


Link to post
Share on other sites
1 hour ago, Marlon said:

 

 

The IPs themselves are "external" and "internal", both of which are the same per server, seeing as it's separate servers.

 

 

 

This sentence doesn't make sense if they are two separate servers.

 

External would be your global IP address.  So what a user would send traffic to.

Internal IP would be your local network IP for the machine.  If these are separate servers they should be different.  And should not be the same as external.

Share this post


Link to post
Share on other sites

I had 2 servers set up on 2 machine a year or 2 ago, BUT as i don't play any more they have been removed with all the db files :(

 

I Found a Back-Up of a DB of one of my servers.....

 

i can say for certain, Don't use Global (Router/Internet IP) i any of the field it just wont work as the server cant bind the IP address:port..  I was Wrong Sort of...

 

Don't use Global (Router/Internet IP)  for  either External/Internal IP for Local Server Tab,  Use IP address of NIC for External and 127.0.0.1 for Internal

 

For Server Neighbors: Use Global (Router/Internet IP) for External IP and 127.0.0.1 for Internal IP.

 

 

its all case of getting the Machines IP and Loop back IP in the right combination for it to work,

 

I am sorry i can not remember the combination...

 

 

 

 

 

 

Edited by bigsteve
  • Like 1

Share this post


Link to post
Share on other sites

Thank you Steve!

 

I will give them a glance over.

 

Is this then correct:

 

For each server in a cluster:

- Add an entry for ALL server in the cluster

 

Ie:

If we have two servers, lets say serverA and serverB:

 

in wurmlogin.db : Table Servers, for serverA:

ServerA - server id 0, login server, serverA ip's and ports.

ServerB - server id 1, not login server, serverB ip's and ports.

 

in wurmlogin.db : Table Servers, for serverB:

ServerB - server id 0, not login server, serverB ip's and ports.

ServerA - server id 1, login server, serverA ip's and ports.

 

It seems like, for each server in a cluster, the SERVERS table is pretty much a duplicate of all the others.

 

 

Some have suggested that one can use the same steam install on Ubuntu/Linux to start multiple instances worls

 

Share this post


Link to post
Share on other sites

Thank you steve,

that help is already a big plus, and I have gotten most things working now except the actual transfer from one server to the next (connection refused in the logs)

Your IP setup worked for me to get things started and connectable otherwise.

:)

Share this post


Link to post
Share on other sites

Ok thanks everyone, there is now just one more issue left.

The two servers A and B on the test bed, can run, seperately, but on the same host.

When they start up, the opposing server says "B is now available" and "A is now available". I assume RMI is working fine, if they are aware of each other like this.

 

The issue remaining now is as follows.

Everything works fine, until I try to cross a border. The usual warnings apply (settlement deed will stay behind, etc).

At the point of crossing, input becomes unresponsive on both servers for whoever is online (for example, right clicking a tile will just refresh..... forever).

In the server output/logs, there is a "connection refused by <serverip>" on server A and "connection refused to<serverip>" on serverB. It seems that ONE of them, are not allowing the other one to transfer a player from A to B.

 

I have selected the assumingly important columns from the SERVERS table, and it's as follows:

 

 

I did not screenshot the SERVERNEIGHBOURS tables, but they are simply an inverted mirror of each other.

1 , 24286, NORTH

and on the other server

24286,1,SOUTH

 

You get the drift.

 

Oh, firewall is setup to allow only the needed external ports, and since both servers run on the same host, I don't think firewalling could be the issue. Internally all are accepted.

I am at wits end on this. Any shred of advice would be valued :)

Once this is working, I can roll it out to my live servers, and always refer back to this thread.

 

Cheerios.

Marlon

 

 

 

 

Share this post


Link to post
Share on other sites

Ill take a look at my DB when i get home tonight.. and screen shot how the IP's are set-up.

 

Oh just to let you know i had 3 maps connected.

 

And some others were having issues with a serverID of 1, in regards to mailing stuff ingame.

Edited by bigsteve
  • Like 1

Share this post


Link to post
Share on other sites
17 minutes ago, bigsteve said:

And some others were having issues with a serverID of 1, in regards to mailing stuff ingame.

interesting... will look into this too.

 

And thanks, you're a star. If it's too much of a mission, take your time please, I can wait a while :)

 

Share this post


Link to post
Share on other sites

So for the sake of logs, this is what happens when I try to transfer from A to B, where A is the login/main server.

 

On ServerB (where player is trying to transfer to)

[12:18:54 AM] WARNING com.wurmonline.server.players.PlayerInfoFactory: An error occurred when contacting the login server. Please try later.
com.wurmonline.shared.exceptions.WurmServerException: An error occurred when contacting the login server. Please try later.
        at com.wurmonline.server.LoginServerWebConnection.getPlayerStates(LoginServerWebConnection.java:580)



On ServerA (where player is trying to transfer from)

[12:17:10 AM] WARNING com.wurmonline.server.LoginServerWebConnection: Failed to transfer MarlonTest to the login server Connection refused to host: 129.232.155.20; nested exception is:
        java.net.ConnectException: Connection timed out (Connection timed out)
[12:17:10 AM] INFO com.wurmonline.server.intra.PlayerTransfer: Failed copy to target server for MarlonTest took 127333 ms.

 

Share this post


Link to post
Share on other sites

post the full logs of both servers if you can.

 

so this is my Log in server DB image:

30e3e699ee.png

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks Steve.

I think I fell off the bus completely. It seems you guys have one database with these settings, and the other maps are kept standard. 

Many thanks for the responses and help.

Ill make it work from here, and post a final reply when its up and how it looks for everyones sake :)

 

 

Share this post


Link to post
Share on other sites

Everything running.

Setup is as Steve showed above. The TLDR is

 

1. A single steam/wu install in /home/steam/ (as ~/wu) for user steam (after force_install_dir wu in steamcmd).

2. Two world directories (Creative, as the main server, and Foobar as the second server).

3. Started seperately in two ssh scripts,  with something like ./WurmServerLauncher-patched start=Creative and start=Foobar in screen sessions on the server.

4. In each of the two databases (Creative and Foobar) BOTH servers exist as entries in the SERVERS table in the wurmlogin db (they are opposing duplicates of each other)

5. In each of the two db's, there is ONE SERVERNEIGHBOURS entry referring to the _other_ server and border etc

6. iptables set up to allow only public ports, and the rest is locked into internal interfaces.

 

The main issue why I could not get things working towards the end of this post (the timeouts when crossing borders) was caused by my _very clever_ hosting company and their automated vps deployment scripts, messed up the ip of the machine in /etc/hosts (it was literally pointing to the wrong ip). I fixed this, and everything started working 100%

 

Next step is to dockerise and have kubernetes cluster for this, so I can sit back and stop worrying so much about the deployment and updates.

 

Thanks to everyone who helped.

M

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this