Allods Developers Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Errors when starting up a shard on LAN

I tried to move my localhost server (version 1.1) to LAN and encountered the following error (I changed the ip in all the .xml config file places suggested on the discord for accountServer, masterServer and shard) and I'm getting the following exception when starting the shard:

[04-25 17:09:45,217, 60318] maps_distributor - ERROR verify : can't find Server 192.168.0.50 in distribution
java.lang.Throwable
at asserts.Verify.fail(Verify.java:60)
at shardstarter.map.MapStartDistributor.handleMapService(MapStartDistributor.java:103)
at shardstarter.map.MapStartDistributor.onAdd(MapStartDistributor.java:60)
at msgSystem.impl.directory.CallbackerPerService$1.execute(CallbackerPerService.java:74)
at msgSystem.impl.directory.CallbackerPerService$1.execute(CallbackerPerService.java:72)
at tools.containers.RingList.forEach(RingList.java:336)
at msgSystem.impl.directory.DirectoryImpl.forEach(DirectoryImpl.java:74)
at msgSystem.impl.directory.CallbackerPerService.init(CallbackerPerService.java:72)
at msgSystem.impl.directory.CallbackerPerService.create(CallbackerPerService.java:34)
at shardstarter.map.MapStartDistributor.<init>(MapStartDistributor.java:50)
at shardstarter.map.MapStartDistributorModule.tick(MapStartDistributorModule.java:64)
at system.base.tickables.Tickables.tick(Tickables.java:77)
at basement.server.impl.ServerImpl.tick(ServerImpl.java:136)
at basement.launcher.launcherImpl.LauncherImpl.tick(LauncherImpl.java:140)
at basement.launcher.launcherImpl.LauncherImpl.run(LauncherImpl.java:188)
at java.lang.Thread.run(Thread.java:619)

If I change the ip from 192.168.0.50 back to 127.0.0.1, it starts but I cannot connect the client from a different machine.
Anyone encountered something similar or has any idea what's wrong?
 
I've managed to solve the problem.

Do not use domain names inside shard.xml files, only use IP addresses, even if in most cases it is properly translated to your IP addresses, in this one (map_distributor) it isn't and the shard cannot find that component.
Post automatically merged:

I've encountered another problem though...

I have a shard configuration with an entry like this:

XML:
<shard role="LocalShard" memory="1200" ip="192.168.0.50">
    <frontEnd externalHost="192.168.0.50" ip="127.0.0.1" port="9322" timeout="60000"/>
    <db host="127.0.0.1" user="root" password="root" config="db/database-config-trunk.properties"/>
    <auction host="127.0.0.1" user="root" password="root" db="db/auctiondb-config-trunk.properties"/>
    <mail host="127.0.0.1" user="root" password="root" db="db/maildb-config.properties"/>
    <guild host="127.0.0.1" user="root" password="root" db="db/guilddb-config.properties"/>
    <http host="127.0.0.1" port="8081"/>
    <indicator/>
    <doorway/>
</shard>

It lets me see the shard selection list on the client after logging in, but when I select my shard, the client attempts to connect to port 9323 (not 9322 as in the frontEnd config) and the connection is refused.

When I examine listening ports on the server machine with netstat I get:

Code:
tcp        0      0 127.0.0.1:9324          0.0.0.0:*               LISTEN      296266/java
tcp        0      0 127.0.0.1:9325          0.0.0.0:*               LISTEN      296266/java
tcp        0      0 127.0.0.1:9322          0.0.0.0:*               LISTEN      296266/java
tcp        0      0 127.0.0.1:9323          0.0.0.0:*               LISTEN      296266/java
tcp        0      0 127.0.0.1:9321          0.0.0.0:*               LISTEN      256562/java

Note the 127.0.0.1.

This is the reason client is blocked from connecting. I'd like those processes to listen on 0.0.0.0 or my LAN ip, but if I try to put anything other than 127.0.0.1 in frontEnd ip field, I get an error:

tools.commons.net.NetException: local shard must run with 127.0.0.1 ip

I know I could get around this with something like nginx proxy or using IP tables, but I'd like to see a proper solution (not a hack). Is there a way to configure 1.1 shard to run on ip other than 127.0.0.1 ?
 
Last edited:
Back
Top