Multiple load balancing apps on one machine

2»

Answers

  • in regard to 'Unknown operation ...' error, please recheck that all folders contain correct configs. although configs, you've sent me, look good. please check that config for second couple Master/GS are correct

    best,
    ilya
  • Eh, opened port in Firewall, and now still have an issue:
    I have Loadbalancing app in photon control, that should fire 2 master applications and 2 game applications. All of them have their separate ports. If I start those pairs separately - all works well.
    However, when I try to run it together, I have

    2018-07-19 13:05:12,617 [19] INFO Photon.LoadBalancing.GameServer.MasterServerConnectionBase - Connecting to master at 127.0.0.1:4599, serverId=51f09107-0012-4ed1-a3e4-538aaf5fae38
    2018-07-19 13:05:12,617 [20] INFO Photon.LoadBalancing.GameServer.MasterServerConnectionBase - Master connection established: address:127.0.0.1
    2018-07-19 13:05:12,648 [20] INFO Photon.Common.LoadBalancer.ServerStateManager - Server state is set to online
    2018-07-19 13:05:12,664 [20] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer - Registering game server with address 144.217.11.84, TCP 4591, UDP 5066, WebSocket 9021, Secure WebSocket 19091, HTTP 80, ServerID 51f09107-0012-4ed1-a3e4-538aaf5fae38, Hostname localhost, IPv6Address
    2018-07-19 13:05:12,680 [20] ERROR Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer - RegisterGameServer returned with err -2: Unknown operation code
    2018-07-19 13:05:12,695 [20] ERROR Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer - RegisterGameServerResponse contract invalid: Missing value 2 (RegisterGameServerResponse.InternalAddress)

    2018-07-19 13:05:12,711 [19] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer - connection to master closed (id=20, reason=ManagedDisconnect, detail=), serverId=51f09107-0012-4ed1-a3e4-538aaf5fae38


    What means that game server cant reach master server(it is second pair). If I run it without first pair - all is ok..

  • @pavelbaslak please extend logging in MasterAppliction.CreatePeer so that we see on which port gameserver connects. what is the value for port where master expects game server.

    this unknown operation code means that mater thinks that client established a connection to it.

    also, add extra info to see on what port GameServer connects. so, then we will see where the error is

    best,
    ilya
  • Added, hm, interesting, while I have now two master applications, Master and Master_New, in logs I see that only in Master.log(not Master_New) there are init requests to register Game_New and Game. So, I guess it means that actually only old Master works as Master server(not both of them), and Game_New somewhy is trying to connect to old Master, even though it has different connection port (old one has default 4520 and new one 4599)


    2018-07-19 13:56:17,958 [19] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication - init request is 4520 remote port 63851
    2018-07-19 13:56:17,974 [19] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication - Received init request from game server
    2018-07-19 13:56:17,958 [18] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication - init request is 4599 remote port 63852
    2018-07-19 13:56:18,005 [18] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication - Received init request from game client on leader node
    2018-07-19 13:56:18,005 [19] INFO Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer - game server connection from 127.0.0.1:63851 established (id=2)
    2018-07-19 13:56:18,239 [15] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer - OnOperationRequest: pid=2, op=1
    2018-07-19 13:56:18,286 [20] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - Disconnect: pid=2: reason=ClientDisconnect, detail=
    2018-07-19 13:56:18,302 [15] WARN Photon.LoadBalancing.Common.NodesReader - Internal address for node 0 unknown; using loop back
    2018-07-19 13:56:18,333 [15] INFO Photon.LoadBalancing.Common.NodesReader - Node added: 0 = 127.0.0.1
    2018-07-19 13:56:18,349 [15] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer - Received register request: Address=144.217.11.84, UdpPort=5056, TcpPort=4531, WebSocketPort=9091, SecureWebSocketPort=19091, HttpPort=80, State=Normal, Hostname=localhost, IPv6Address=
    2018-07-19 13:56:18,364 [15] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer - Registered GameServerAddress=144.217.11.84 GameServerAddressIPv6= TcpAddress=144.217.11.84:4531 TcpAddressIPv6= UdpAddress=144.217.11.84:5056 UdpAddressIPv6= WebSocketAddress=ws://144.217.11.84:9091 WebSocketAddressIPv6= HttpAddress=http://144.217.11.84:80/photon/g HttpAddressIPv6= SecureWebSocketAddress=wss://localhost:19091 SecureHttpAddress=https://localhost:443/photon/g
    2018-07-19 13:56:33,319 [14] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication - init request is 4599 remote port 63857
    2018-07-19 13:56:33,334 [14] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication - Received init request from game client on leader node
    2018-07-19 13:56:33,444 [11] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - Disconnect: pid=3: reason=ClientDisconnect, detail=
    2018-07-19 13:56:34,162 [19] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication - init request is 5055 remote port 7587
    2018-07-19 13:56:34,178 [19] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication - Received init request from game client on leader node
    2018-07-19 13:56:37,225 [14] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - HandleAuthenticateRequest:appId=8c2cad3e-2e3f-4941-9044-b390ff2c4956;version=newfps-126_1.80;region=eu;type=0;userId=Guest
    2018-07-19 13:56:37,256 [14] DEBUG Photon.LoadBalancing.MasterServer.GameApplication - OnClientConnect: peerId=0, appId={Default}
    2018-07-19 13:56:37,272 [13] DEBUG Photon.LoadBalancing.MasterServer.PlayerCache - Player state changed: pid=Guest, master=True, gid=
    2018-07-19 13:56:38,475 [11] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - Joined lobby: , 0, u:'Guest'
    2018-07-19 13:56:40,819 [20] DEBUG Photon.LoadBalancing.MasterServer.GameApplication - Created game: gameId=fd44474f-ceb2-462c-8c5d-8aa6133463ba, appId={Default}
    2018-07-19 13:56:40,851 [20] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - PlayerCount updated:newValue=1, oldPlayerCount=0, plyaerCount=1
    2018-07-19 13:56:40,866 [20] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameState - Added peer: gameId=fd44474f-ceb2-462c-8c5d-8aa6133463ba, userId=Guest, joiningPeers=1
    2018-07-19 13:56:40,882 [11] DEBUG Photon.LoadBalancing.MasterServer.PlayerCache - Player state changed: pid=Guest, master=True, gid=fd44474f-ceb2-462c-8c5d-8aa6133463ba
    2018-07-19 13:56:42,132 [19] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - Disconnect: pid=0: reason=ClientDisconnect, detail=
    2018-07-19 13:56:42,148 [19] DEBUG Photon.LoadBalancing.MasterServer.GameApplication - OnClientDisconnect: peerId=0, appId={Default}
    2018-07-19 13:56:42,148 [9] DEBUG Photon.LoadBalancing.MasterServer.Lobby.AppLobby - peer removed from lobby:l:'Photon.LoadBalancing.MasterServer.Lobby.AppLobby',p:'T:MasterClientPeer,ConnId:0,ip:114.142.170.51:0',u:'Guest'
    2018-07-19 13:56:48,398 [19] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - Checked join timeouts: before=1, after=1
    2018-07-19 13:56:48,461 [18] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication - init request is 4599 remote port 63858
    2018-07-19 13:56:48,476 [18] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication - Received init request from game client on leader node
    2018-07-19 13:56:48,508 [4] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer - HandleUpdateGameState
    2018-07-19 13:56:48,539 [4] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - PlayerCount updated:newValue=2, oldPlayerCount=1, plyaerCount=2
    2018-07-19 13:56:48,554 [4] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameState - User joined on game server: gameId=fd44474f-ceb2-462c-8c5d-8aa6133463ba, userId=Guest
    2018-07-19 13:56:48,570 [4] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - PlayerCount updated:newValue=1, oldPlayerCount=2, plyaerCount=1
    2018-07-19 13:56:48,586 [4] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - PlayerCount updated:newValue=1, oldPlayerCount=1, plyaerCount=1
    2018-07-19 13:56:48,601 [13] DEBUG Photon.LoadBalancing.MasterServer.PlayerCache - Player state changed: pid=Guest, master=False, gid=fd44474f-ceb2-462c-8c5d-8aa6133463ba
    2018-07-19 13:56:48,586 [20] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - Disconnect: pid=4: reason=ClientDisconnect, detail=
    2018-07-19 13:56:48,601 [4] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - UpdateGameState: id=fd44474f-ceb2-462c-8c5d-8aa6133463ba, peers=1, max=16, open=True,
  • chvetsov
    chvetsov mod
    Answer ✓
    i think i know what is going on

    In your config for port 4599 add OverrideApplication = Master_New. otherwise new game server connects to this port and sends app name "Master'. without Override application it will be connected to master. this what we see

    best,
    ilya
  • pavelbaslak
    Answer ✓
    @chvetsov boom! That did a trick! Finally, many thanks!

    Everyone who looks for the solution:
    You want Load Balancing app to start more then default Master/Game applications. Here what you need to do:
    1) Go to deploy/LoadBalancing and put there another application that you want to start. In my case, I have copy/pasted Game and Master folder, so they have become Game_New, Master_New
    2) Go to deploy/bin_Win64 and edit PhotonServer.config file.
    3) You should add new values:
    Under LoadBalancing/Applications add new nodes for every app you have added. Ensure you also have set BaseDirectory property to proper value, where your new apps located.
    Then create Udp, Tcp and WebSocket listeners for your new apps, ensure your OverrideApplication property points to proper application
    4) Go to deploy/LoadBalancing/"Name of application that you have added" in my case /Game_New and then /Master_New and open Photon.LoadBalancing.dll.config file for every app added. There you need to change values for Udp, Tcp, WebSocket listeners to the ones you have created at point 3.
    5) Enjoy, you should not have waste X hours on the solution :)) @chvetsov once again Thanks, ExitGames support is excellent!