Jump to content
  • 0

Configure 1 login for 2 different servers


CyberDevil

Question


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

Hi guys,

I would need help and advice to be able to configure 2 different servers with different IPs that are in 2 different countries, but have only one login for the accounts, in order to have a live server and a test server after normal login (ID and psw). I have already tried successfully the configuration of the file "clientinfo.xml" with these 2 servers/IPs, but the problem with this configuration is that you need to create the login data for each one of the 2 servers... the ideal configuration would be like this:

1 login -> after login the users can select: -> "SERVER 1 LIVE" -> or "SERVER 2 TEST"

The problem as mentioned above is that the 2 servers are in 2 different countries and therefore have different public IPs.
Can someone help me to understand how to configure the "SERVER 2 TEST" so that it takes the login data from the "SERVER 1 LIVE"? Or any other configuration for my case...

Link to comment
Share on other sites

17 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

You can actually use Cydh's tutorial for Multi Servers 

Though in his context, the servers are located inside 1 VM only. To get around that, setup 1 full server inside 1 VM, let's call it VM#1.

In this VM#1, Make sure that your database, login-server and map-server are accessible externally by using the Public IP of your VM#1 in your conf files. Other than that, make sure that the user you created for your databases isn't bounded to 'localhost' rather should be '%' which means from anywhere. In your VM#2, use the Public IP of VM#2 in your conf files. You don't need to create a new login-server, just configure the char-server and inter-server to point to your VM#1. then point your map-server in VM#2 to your char-server in your VM#2. hence, graphically:

image.png.cba164c1cb33b7a7cc8a0bff55c7d02b.png

Example: You have two VMs:

VM#1: 1.1.1.1

VM#2: 2.2.2.2

Quote

VM#1. login_athena.conf

bind: 1.1.1.1

VM#1. char_athena.conf

bind: 1.1.1.1

login_ip: 1.1.1.1

VM#1. map_athena.conf

bind: 1.1.1.1

char_ip: 1.1.1.1

VM#1. inter_athena.conf

(all ip addresses): 1.1.1.1

Quote

VM#2. char_athena.conf

bind: 2.2.2.2

login_ip: 1.1.1.1

VM#2. map_athena.conf

bind: 2.2.2.2

char_ip: 2.2.2.2

VM#2. inter_athena.conf

(all ip addresses): 1.1.1.1

Edited by Ninja
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  396
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

When you connect in VM1 map server and other player connect in VM2 map server they can see each other?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

5 hours ago, Zack- said:

When you connect in VM1 map server and other player connect in VM2 map server they can see each other?

Unfortunately, No. They will be 2 completely different servers under 1 login server

Edited by Ninja
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  396
  • Reputation:   53
  • Joined:  07/24/12
  • Last Seen:  

5 hours ago, Ninja said:

Unfortunately, No. They will be 2 completely different servers under 1 login server

but we have solution regarding this different map server VM can see each other?, because im planning to make 2 different location instead use proxy server we use a vps for different map server,

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

8 hours ago, Zack- said:

but we have solution regarding this different map server VM can see each other?, because im planning to make 2 different location instead use proxy server we use a vps for different map server, 

I have longed to pursue that problem, tbh. unfortunately, I haven't seen anybody who was able to resolve such unless I was out for too long that I missed it. Also, it'll be problematic if the the latency between the two servers exceed 50ms as delays will be very much conceivable beyond that number.

Edited by Ninja
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

On 8/17/2018 at 7:03 PM, Ninja said:

You can actually use Cydh's tutorial for Multi Servers 

Though in his context, the servers are located inside 1 VM only. To get around that, setup 1 full server inside 1 VM, let's call it VM#1.

In this VM#1, Make sure that your database, login-server and map-server are accessible externally by using the Public IP of your VM#1 in your conf files. Other than that, make sure that the user you created for your databases isn't bounded to 'localhost' rather should be '%' which means from anywhere. In your VM#2, use the Public IP of VM#2 in your conf files. You don't need to create a new login-server, just configure the char-server and inter-server to point to your VM#1. then point your map-server in VM#2 to your char-server in your VM#2. hence, graphically:

image.png.cba164c1cb33b7a7cc8a0bff55c7d02b.png

Example: You have two VMs:

VM#1: 1.1.1.1

VM#2: 2.2.2.2

Hi @Ninja,

I have put into practice what you have written and it seems that it works... I'm still not 100% sure because I have to wait for the weekly maintenance to do other tests and to understand why when I change the settings of "localhost" from the file configuration of MySQL (my.conf) from 127.0.0.1 to the public IP, I get into the connection error of the site (Apache2) and some other connection problem between rAthena and MySQL... certainly after this setting I would have to restart the whole server and config some other files but for now I can't do it because I have users who play there and then I have to wait for the weekly maintenance to do it, but I'll update as soon as I finish, even if I'm sure everything will work.

I ask only a further suggestion and advice, I would like the name of the "Test Server" appear in the window list that appears after logging in with userID and password and not before this... what is the file that I have to go to change to have it in this list? For now I have only managed to make it appear before login with the classic modification to the file "clientinfo.xml", but I would like users to select it after logging in.

Thank you so much for the excellent suggestions and help

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

If you followed the setup I suggested correctly, the server will appear after logging in as the char server will be connected to the login server ?

  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

Hi @Ninja,

I followed your instructions as if it were a bible and even if from the side of VM#1 I do not have any kind of problem or error, in the server side VM#2 I have an error that I can not understand and solve. Can you help me please?
This is part of the log that appears in VM console # 2 after rAthena starts:

(NOTE: the data in purple color are masked for privacy and security, I have used the correct data)

Quote

[Status]: Character server IP address : subdomain.VM#2.com -> 2.2.2.2
[Info]: Done reading conf/import/char_conf.txt.
[Info]: Done reading conf/char_athena.conf.
[Status]: Read information about 3 subnetworks.
[Info]: Map Server IP Address : 'subdomain.VM#2.com' -> '2.2.2.2'.
[Info]: Done reading conf/import/inter_conf.txt.
[Info]: Done reading conf/inter_athena.conf.
[Info]: Done reading '145' messages in 'conf/msg_conf/char_msg.conf'.
[Info]: Done reading conf/import/inter_conf.txt.
[Info]: Done reading conf/inter_athena.conf.
[Info]: Connect Character DB server.... (Character Server)
[Status]: Using SQL dbs: yes
[Info]: Logging item transactions to table 'picklog'.
[Info]: Logging monster summon item usage to table 'picklog'.
[Info]: Logging chat to table 'chatlog'.
[Info]: Logging commands to table 'atcommandlog'.
[Info]: Logging MVP monster rewards to table 'mvplog'.
[Info]: Logging 'logmes' messages to table 'npclog'.
[Info]: Logging Zeny transactions to table 'zenylog'.
[Info]: Logging Cash transactions to table 'cashlog'.
[Info]: Logging Feeding items to table 'feedinglog'.
[Info]: Connecting to the Map DB Server....
[Status]: Done reading '1' storage information in 'conf/inter_server.yml'
[Status]: Done reading '0' storage information in 'conf/import/inter_server.yml'
[Status]: Done reading '50' entries in 'db/re/exp_guild.txt'.
[Status]: Done reading '0' entries in 'db/import/exp_guild.txt'.
[Status]: Connect success! (Map Server Connection)
[Info]: [S Q L ]: Connecting to the Log Database my_VM#1_db At 1.1.1.1...
[Info]: Clan loaded (1 - Swordman Clan)
[Status]: The login-server is ready (Server is listening on the port 6900).
[Info]: Clan loaded (2 - Arcwand Clan)
[Status]: [S Q L ]: Successfully 'connected' to Database 'my_VM#1_db'.
[Status]: Loading maps (using db/re/map_cache.dat as map cache)...
[Status]: Loading maps (using db/import/map_cache.dat as map cache)...
[Info]: Clan loaded (3 - Golden Mace Clan)
[Info]: Clan loaded (4 - Crossbow Clan)
[Status]: Finished Reading GeoIP Database.
[Status]: Characters per Account: '0'.
[Info]: Start checking DB integrity
[Info]: Successfully loaded '959' maps.
[Info]: Done reading '0' messages in 'conf/msg_conf/import/map_msg_eng_conf.txt'.
[Info]: Done reading '1185' messages in 'conf/msg_conf/map_msg.conf'.
[Status]: Done reading '68' command aliases in 'conf/atcommand_athena.conf'.
[Status]: Done reading '24' entries in 'db/re/instance_db.txt'.
[Status]: Done reading '0' entries in 'db/import/instance_db.txt'.
[Status]: Using packet version: 20151104.
[Status]: Packet Obfuscation: Enabled. Keys: 0x__HIDE__, 0x__HIDE__, 0x__HIDE__
[Error]: make_listen_bind: bind failed (socket #6, error 99: Cannot assign requested address)!
[Info]: DB integrity check finished with success
[Error]: make_listen_bind: bind failed (socket #4, error 99: Cannot assign requested address)!

Edited by CyberDevil
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

The IP addresses should be Public IP. The IP 1.1.1.1 and 2.2.2.2 are just examples

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

Yes, I was aware... some data that I wrote in the "quote" I have deliberately masked them for privacy and security, I have used the correct data. However I re-edited it and put the purple color for the masked data.
I have also used the public IP in place of the sub-domain for the VM#2 and configured the subnet_athena.conf file in this way:

Quote

subnet: 255.0.0.0:127.0.0.1:127.0.0.1
subnet: 255.255.255.0:192.168.0.200:192.168.0.200
subnet: 255.255.255.0:subdomain.VM#2.com:subdomain.VM#2.com
subnet: 255.255.255.0:2.2.2.2:2.2.2.2

But even if I did all the tests and configurations, I always have the same error:

lb79Dy.jpg

edit: I checked the "/root/rAthena/log" files and found these errors divided as follows:
char-msg_log.log -> (08/23/2018 14:56:31) [ Error ] : make_listen_bind: bind failed (socket #4, error 99: Cannot assign requested address)!
map-msg_log.log -> (08/23/2018 14:56:26) [ Error ] : make_listen_bind: bind failed (socket #6, error 99: Cannot assign requested address)!

So I tried to make all the possible combinations and exclusions with every type of IP in my possession (public, lan, localhost, sub.domain, etc) both on the "bind_ip" parameter and on the rest of the parameters concerning the ips, but the error persists!

Edited by CyberDevil
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

I see. Well, as far as I can see, you are able to connect to the remote SQL database and the only problem now is the IP Address binding. Perhaps you might wanna try to check if your this VM has the interface for your IP via ifconfig or ip addr. Some hosting companies are using NAT and if that will be the case, you will have to ask your hosting company to provide you with a port and portforward it to your VM.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

Ok @Ninja, I understood what this problem is and I solved it... practically I have the VM#2 (test server) at home under a normal ADSL connection but I have full access to the router, in fact this "home server" if configured individually, it also works perfectly for access from the outside without problems and errors. So I realized that the "bind_ip" option should be configured with the IP of the LAN and not the WAN. Now that I have set the static LAN IP 192.168.0.200 (configured for interface enp2s0 [old eth0]) I no longer have this error but the VM#2 continuing to load rAthena now gives me another new error that I think is easy to fix but I do not know how.

When loading rAthena VM#2 gives me this error:
 

Quote

[Info]: Attempt to connect to login-server...
[Status]: Connecting to 1.1.1.1:6900
[Error]: Can not connect to login-server.
[Error]: The server communication passwords (default s1/p1) are probably invalid.
[Error]: Also, please make sure your login db has the correct communication username/passwords and the gender of the account is S.
[Error]: The communication passwords are set in map_athena.conf and char_athena.conf
[Warning]: Connection to Login Server lost.

At the same time the VM#1 (which is in a web farm) gives me this other error:
 

Quote

[Notice]: Authentication accepted (account: s1, id: 1, ip: 2.2.2.2)
[Notice]: Connection of the char-server 'VM#2-name' REFUSED.

The communication user (s1) and its password (p1) are obviously set equal in the servers (also in the "login" table of VM#1) and are not the default ones of rAthena, but customized for security reasons and both 2 server firewalls have active rules to accept traffic and packets from both IPs and their respective ports are open and working.
Do I have to put the IP of the VM#2 in some "white list" to get it accepted?

Edited by CyberDevil
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

This is pretty straight forward, you just have to create another server account in the login database ? it's a rule that "no one account can be used more than once."

  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

EDIT: I was answering while you wrote the solution, you're great! ?

I managed to find the solution to this problem... as written on this guide that you have linked, I created a second user of communication s2/p2 and configured in the files "char_athena.conf" and "map_athena.conf" VM#2 and everything seems to work, I just have to figure out how to set the best server because both servers are using the char server of VM#1... I think it's a stupid of the settings that I will solve soon.
I keep you informed but I'm very happy that everything works.

Edited by CyberDevil
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

Happy to help man. Cheers. ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

Thank you very much for your help and I leave for posterity this other thing:
in order to use the VM#2 server for characters and maps management, separated from the main VM#1 server, the "VM#2. inter_athena.conf" file must be configured as follows:

Quote

login_server_ip: 1.1.1.1
ipban_db_ip: 1.1.1.1
char_server_ip: 127.0.0.1
map_server_ip: 127.0.0.1
log_db_ip: 1.1.1.1

In this way each server has its characters and its maps managed separately as needed for me.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

Great. If you just want to separate servers but the same characters just point it to the same database. Hopefully, multiserver setups would have a mechanism to sync with each other so people from different geolocations can enjoy low lantency games.

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...