Ask Your Question
0

matchmaking 문의

asked 2020-03-27 16:03:19 +0900

한태민 gravatar image

updated 2020-03-27 16:10:54 +0900

Jinuk gravatar image

서버 구성은 로그인, 로비, 매칭, 게임 서버로 나뉘어있습니다. manifest.matchmaker.json 에서 rpc_tags의 값은 matchmarker 로 입력해두었고, 로그인서버에서 로비서버로 이동 후

auto match_cbs = [session](const string &player_id,
                                      const MatchmakingClient::Match &match,
                                      MatchmakingClient::MatchResult result) {
    if (result == MatchmakingClient::kMRSuccess) {

    }
};

소스를 실행하면 result 값이 kMRError 로 반환됩니다.

아래 로그는 로비서버에 매칭요청을 했을때 출력되는 로그입니다.

I0327 15:56:06.728680  9118 lobby_event_handlers.cc:85] Client redirected: id=TESTMAN
W0327 15:56:10.980312  9120 matchmaking.cc:648] Failed to match: No matchmaking server: type=0, player_id=TESTMAN, target_server=00000000-0000-0000-0000-000000000000
E0327 15:56:10.980619  9120 lobby_event_handlers.cc:240] Failed in matchmaking. Erorr: id=TESTMAN

kMRError 값은 RPC 서비스를 사용할 수 없을 때 발생한다는 주석이 있는데, 어느곳을 더 설정해야할지 문의드립니다.


manifest.matchmarker.json

{
  "version": 1,
  "components": [
    {
      "name": "ProjectStServer",
      "arguments": {
        "example_arg1": "val1",
        "example_arg2": 100
      },
      "dependency": {
        "AppInfo": {
          "app_id": "ProjectSt",
          "client_current_version": "0.0.3",
          "client_compatible_versions": [ "0.0.1", "0.0.2" ],
          "client_update_info": "",
          "client_update_uri": ""
        },
        "EventDispatcher": {
          "event_threads_size": 4,
          "enable_event_profiler": true,
          "enable_outstanding_event_profiler": true,
          "slow_event_log_threshold_in_ms": 300,
          "event_timeout_in_ms": 30000,
          "enable_inheriting_event_tag": true,
          "enable_random_event_tag": true,
          "enable_event_thread_checker": true
        },
          "Logging": {
            "activity_log_output": "json://activity/activity_log.json",
            "activity_log_rotation_interval": 60,
            "glog_flush_interval": 1
          },
          "Timer": {},
          "RpcService": {
            "rpc_enabled": true,
            "rpc_threads_size": 4,
            "rpc_port": 9015,
            "rpc_nic_name": "",  // if not specified, uses first NIC appeared in predictable network interface names.
            "rpc_tags": ["matchmaker"],
            "rpc_message_logging_level": 0,
            "rpc_disable_tcp_nagle": true,
            "enable_rpc_reply_checker": true,
            "rpc_backend": "Redis",
            "rpc_redis_hosts": [
              {
                "host": "127.0.0.1:6379",
                "database": 0,
                "auth": ""
              }
            ],
            "rpc_redis_connection_count": 16,
            "rpc_redis_master_update_interval_in_seconds": 5,
            "rpc_redis_session_timeout_in_seconds": 10,
            "rpc_redis_recovery_window_size_in_sec": 6
          },
          "Curl": {
            "curl_threads_size": 1
          },
          "ZookeeperClient": {
            "zookeeper_nodes": "localhost:2181"
          },
          "MatchmakingServer": {
            "enable_dynamic_match": true,
            "enable_match_progress_callback": false
          }
      },
      "library": "libproject_st.so"
    }
  ]
}

서버 실행시 MatchmakingServer::Start() 함수는 호출 해놓은 상태입니다. OS는 VM Linux CentOS를 사용하고있습니다.

edit retag flag offensive close merge delete

Comments

manifest.lobby.json 파일의 RpcService 설정도 올려주시기 바랍니다.

jwlee gravatar imagejwlee ( 2020-03-27 16:08:42 +0900 )edit

4 answers

Sort by » oldest newest most voted
0

answered 2020-03-27 17:17:06 +0900

한태민 gravatar image

다시 확인해보니 lobby.json에 MatchmakingClient 콤포넌트가 추가 되어있지 않았습니다.

추가후 테스트해보니

I0327 17:15:53.446048 22815 transport.cc:483] 클라이언트 플러그인 버전: 329
I0327 17:15:53.446332 22815 session_service.cc:2877] 새 세션을 생성했습니다: sid=fa5a076c-c068-41a1-8611-5788d1f436e1, protocol=TCP, encoding=application/octet-stream, address=192.168.18.1:51233
I0327 17:15:53.520069 22827 lobby_event_handlers.cc:85] Client redirected: id=TESTMAN
W0327 17:15:54.430604 22766 rpc_service.cc:710] RPC server disconnected: state=Established, peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015)
W0327 17:15:54.430691 22766 rpc_service.cc:612] Scheduled to reconnect to RPC server: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015), after=10ms
I0327 17:15:54.430706 22766 object_leaser.cc:374] Remaining remote events: leak_count=0
W0327 17:15:54.430713 22766 matchmaking.cc:533] Matchmaking server disconnected: peer_id=000c29e9-9c63-3723-0000-000000000000
E0327 17:15:54.431108 22827 lobby_event_handlers.cc:240] Failed in matchmaking. Erorr: id=TESTMAN
W0327 17:15:54.441568 22765 rpc_service.cc:669] RPC server connection failed: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015)
W0327 17:15:54.441684 22765 rpc_service.cc:612] Scheduled to reconnect to RPC server: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015), after=15ms
W0327 17:15:54.460386 22768 rpc_service.cc:669] RPC server connection failed: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015)
W0327 17:15:54.460451 22768 rpc_service.cc:612] Scheduled to reconnect to RPC server: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015), after=19ms
W0327 17:15:54.483826 22768 rpc_service.cc:669] RPC server connection failed: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015)
W0327 17:15:54.483873 22768 rpc_service.cc:612] Scheduled to reconnect to RPC server: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015), after=72ms
W0327 17:15:54.556617 22766 rpc_service.cc:669] RPC server connection failed: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015)
W0327 17:15:54.556669 22766 rpc_service.cc:612] Scheduled to reconnect to RPC server: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015), after=28ms
W0327 17:15:54.594362 22765 rpc_service.cc:669] RPC server connection failed: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015)
W0327 17:15:54.594432 22765 rpc_service.cc:612] Scheduled to reconnect to RPC server: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015), after=70ms
W0327 17:15:54.667348 22768 rpc_service.cc:669] RPC server connection failed: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015)
W0327 17:15:54.672525 22768 rpc_service.cc:612] Scheduled to reconnect to RPC server: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015), after=245ms
W0327 17:15:54.918447 22766 rpc_service.cc:669] RPC server connection failed: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015)
W0327 17:15:54.918912 22766 rpc_service.cc:612] Scheduled to reconnect to RPC server: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015), after=193ms
W0327 17:15:55.112252 22768 rpc_service.cc:669] RPC server connection failed: peer=000c29e9-9c63-3723-0000-000000000000(A)(192.168.18.130:9015)
W0327 17:15:55.112429 ...
(more)
edit flag offensive delete link more

Comments

rpc 포트 9015 를 사용하는 서버에 접속하지 못하는 상태인데요, 증상으로 봐서는 서버가 크래시 하고 있는 것이 아닌가 생각됩니다.

jwlee gravatar imagejwlee ( 2020-03-27 17:34:29 +0900 )edit

직접적으로 클라이언트에서 9015 포트로 붙을경우

W0327 17:55:19.191329 31727 rpc_service.cc:667] RPC server connected: peer=unidentified(P)(192.168.18.1:52128)

로그가 나오는데 다른 서버들과는 다른 로그입니다. 관련이 있는걸까요?

한태민 gravatar image한태민 ( 2020-03-27 17:56:14 +0900 )edit

RPC 커넥션을 맺는 방향에 따라서 세부 내용이 다르게 출력됩니다. 올려주신 로그는 상대 서버가 접속했을 때, 출력되는 내용입니다.

jwlee gravatar imagejwlee ( 2020-03-27 17:58:48 +0900 )edit
0

answered 2020-03-27 16:52:00 +0900

한태민 gravatar image
I0327 16:31:22.895292 16704 main.cc:612] Engine version: 1.0.0-5116centos7
I0327 16:31:22.895539 16704 main.cc:619] Command line arguments: [/usr/bin/funapi_runner]
I0327 16:31:22.895545 16704 main.cc:620] Server flavor: lobby
I0327 16:31:22.904258 16704 main.cc:644] License info: {"production":true,"expires":"2021-Mar-04 23:59:59"}
I0327 16:31:22.907303 16704 manifest_handler.cc:359] Reading "/home/admin/project_st/project_st-source/build/manifests/lobby/MANIFEST.json"
I0327 16:31:23.064625 16704 manifest_handler.cc:757] /home/admin/project_st/project_st-source/build/src/libproject_st.so loaded.
I0327 16:31:23.067090 16704 manifest_handler.cc:840] Initializing AppInfo
I0327 16:31:23.067155 16704 manifest_handler.cc:840] Initializing RawTimer
I0327 16:31:23.068715 16704 manifest_handler.cc:840] Initializing Framework
I0327 16:31:23.068740 16704 manifest_handler.cc:840] Initializing IoService
I0327 16:31:23.083988 16704 manifest_handler.cc:840] Initializing Logging
I0327 16:31:23.085438 16704 manifest_handler.cc:840] Initializing HardwareInfo
I0327 16:31:23.086057 16704 hardware_info.cc:195] loop-back 이 아닌 AF_INET 형태의 네트워크 카드를 찾았습니다: ens33, 192.168.18.130/255.255.255.0, 00:0c:29:e9:9c:63
I0327 16:31:23.086092 16704 hardware_info.cc:195] loop-back 이 아닌 AF_INET 형태의 네트워크 카드를 찾았습니다: virbr0, 192.168.122.1/255.255.255.0, 52:54:00:02:c7:b0
I0327 16:31:23.086104 16704 hardware_info.cc:195] loop-back 이 아닌 AF_INET 형태의 네트워크 카드를 찾았습니다: docker0, 172.17.0.1/255.255.0.0, 02:42:cd:dd:9f:01
I0327 16:31:23.086119 16704 hardware_info.cc:195] loop-back 이 아닌 AF_INET6 형태의 네트워크 카드를 찾았습니다: ens33, fe80::ddac:f402:687e:5663/ffff:ffff:ffff:ffff::, 00:0c:29:e9:9c:63
I0327 16:31:23.086131 16704 hardware_info.cc:195] loop-back 이 아닌 AF_INET6 형태의 네트워크 카드를 찾았습니다: docker0, fe80::42:cdff:fedd:9f01/ffff:ffff:ffff:ffff::, 02:42:cd:dd:9f:01
I0327 16:31:23.086143 16704 hardware_info.cc:195] loop-back 이 아닌 AF_INET6 형태의 네트워크 카드를 찾았습니다: veth334ce03, fe80::6046:25ff:feae:a1ea/ffff:ffff:ffff:ffff::, 62:46:25:ae:a1:ea
I0327 16:31:23.086174 16704 hardware_info.cc:449] AWS API 를 통해 공인 IP 주소를 얻어내고 있습니다.
I0327 16:31:23.086181 16704 hardware_info.cc:325] RESETful API 롤 호출합니다: http://169.254.169.254/latest/meta-data/public-ipv4/
W0327 16:31:23.088071 16704 hardware_info.cc:339] AWS 의 API 를 호출하는데 실패했습니다. 스킵합니다.Couldn't connect to server
I0327 16:31:23.089355 16704 hardware_info.cc:452] 네트워크 카드로부터 공인 IP 주소를 얻어내고 있습니다.
W0327 16:31:23.089365 16704 hardware_info.cc:458] 네트워크 인터페이스 카드가 존재하지 않습니다. 무시합니다: eth0
I0327 16:31:23.089378 16704 hardware_info.cc:464] 주어진 NAT 정보로부터 공인 IP 를 얻어내고 있습니다.
I0327 16:31:23.089395 16704 hardware_info.cc:514] 공인 IP 주소를 얻어냈습니다: 192.168.18.130 (nat:192.168.18.130:tcp+pbuf=7013)
W0327 16:31:23.089406 16704 hardware_info.cc:518 ...
(more)
edit flag offensive delete link more
0

answered 2020-03-27 16:32:21 +0900

한태민 gravatar image

updated 2020-03-27 16:42:15 +0900

Jinuk gravatar image

로비서버 시작 로그입니다.

I0327 16:31:22.895292 16704 main.cc:612] Engine version: 1.0.0-5116centos7
I0327 16:31:22.895539 16704 main.cc:619] Command line arguments: [/usr/bin/funapi_runner]
I0327 16:31:22.895545 16704 main.cc:620] Server flavor: lobby
I0327 16:31:22.904258 16704 main.cc:644] License info: {"production":true,"expires":"2021-Mar-04 23:59:59"}
I0327 16:31:22.907303 16704 manifest_handler.cc:359] Reading "/home/admin/project_st/project_st-source/build/manifests/lobby/MANIFEST.json"
I0327 16:31:23.064625 16704 manifest_handler.cc:757] /home/admin/project_st/project_st-source/build/src/libproject_st.so loaded.
I0327 16:31:23.067090 16704 manifest_handler.cc:840] Initializing AppInfo
I0327 16:31:23.067155 16704 manifest_handler.cc:840] Initializing RawTimer
I0327 16:31:23.068715 16704 manifest_handler.cc:840] Initializing Framework
I0327 16:31:23.068740 16704 manifest_handler.cc:840] Initializing IoService
I0327 16:31:23.083988 16704 manifest_handler.cc:840] Initializing Logging
I0327 16:31:23.085438 16704 manifest_handler.cc:840] Initializing HardwareInfo
I0327 16:31:23.086057 16704 hardware_info.cc:195] loop-back 이 아닌 AF_INET 형태의 네트워크 카드를 찾았습니다: ens33, 192.168.18.130/255.255.255.0, 00:0c:29:e9:9c:63
I0327 16:31:23.086092 16704 hardware_info.cc:195] loop-back 이 아닌 AF_INET 형태의 네트워크 카드를 찾았습니다: virbr0, 192.168.122.1/255.255.255.0, 52:54:00:02:c7:b0
I0327 16:31:23.086104 16704 hardware_info.cc:195] loop-back 이 아닌 AF_INET 형태의 네트워크 카드를 찾았습니다: docker0, 172.17.0.1/255.255.0.0, 02:42:cd:dd:9f:01
I0327 16:31:23.086119 16704 hardware_info.cc:195] loop-back 이 아닌 AF_INET6 형태의 네트워크 카드를 찾았습니다: ens33, fe80::ddac:f402:687e:5663/ffff:ffff:ffff:ffff::, 00:0c:29:e9:9c:63
I0327 16:31:23.086131 16704 hardware_info.cc:195] loop-back 이 아닌 AF_INET6 형태의 네트워크 카드를 찾았습니다: docker0, fe80::42:cdff:fedd:9f01/ffff:ffff:ffff:ffff::, 02:42:cd:dd:9f:01
I0327 16:31:23.086143 16704 hardware_info.cc:195] loop-back 이 아닌 AF_INET6 형태의 네트워크 카드를 찾았습니다: veth334ce03, fe80::6046:25ff:feae:a1ea/ffff:ffff:ffff:ffff::, 62:46:25:ae:a1:ea
I0327 16:31:23.086174 16704 hardware_info.cc:449] AWS API 를 통해 공인 IP 주소를 얻어내고 있습니다.
I0327 16:31:23.086181 16704 hardware_info.cc:325] RESETful API 롤 호출합니다: http://169.254.169.254/latest/meta-data/public-ipv4/
W0327 16:31:23.088071 16704 hardware_info.cc:339] AWS 의 API 를 호출하는데 실패했습니다. 스킵합니다.Couldn't connect to server
I0327 16:31:23.089355 16704 hardware_info.cc:452] 네트워크 카드로부터 공인 IP 주소를 얻어내고 있습니다.
W0327 16:31:23.089365 16704 hardware_info.cc:458] 네트워크 인터페이스 카드가 존재하지 않습니다. 무시합니다: eth0
I0327 16:31:23.089378 16704 hardware_info.cc:464] 주어진 NAT 정보로부터 공인 IP 를 얻어내고 있습니다.
I0327 16:31:23.089395 16704 hardware_info.cc:514] 공인 IP 주소를 얻어냈습니다: 192.168.18.130 (nat:192.168.18.130:tcp+pbuf=7013)
W0327 16:31:23.089406 16704 ...
(more)
edit flag offensive delete link more

Comments

manifst.lobby.json 글에 댓글 남겼습니다.

jwlee gravatar imagejwlee ( 2020-03-27 17:00:33 +0900 )edit
0

answered 2020-03-27 16:09:52 +0900

한태민 gravatar image

updated 2020-03-27 16:11:35 +0900

Jinuk gravatar image

RpcServce in MANIFEST.json

"RpcService": {
            "rpc_enabled": true,
            "rpc_threads_size": 4,
            "rpc_port": 7015,
            "rpc_nic_name": "",  // if not specified, uses first NIC appeared in predictable network interface names.
            "rpc_tags": ["lobby"],
            "rpc_message_logging_level": 0,
            "rpc_disable_tcp_nagle": true,
            "enable_rpc_reply_checker": true,
            "rpc_backend": "Redis",
            "rpc_redis_hosts": [
              {
                "host": "127.0.0.1:6379",
                "database": 0,
                "auth": ""
              }
            ],
            "rpc_redis_connection_count": 16,
            "rpc_redis_master_update_interval_in_seconds": 5,
            "rpc_redis_session_timeout_in_seconds": 10,
            "rpc_redis_recovery_window_size_in_sec": 6
          }

manifest.lobby.json 파일입니다.

edit flag offensive delete link more

Comments

각 서버들의 rpc_redis_hosts 설정이 가리키는 redis 호스트는 동일해야 하는데, 현재는 한대의 서버에 lobby, matchmaker, redis 서버가 모두 실행되고 있나요?

jwlee gravatar imagejwlee ( 2020-03-27 16:15:30 +0900 )edit

예 리다이렉트시 정상적으로 데이터가 쌓이고 있고 설정값은 아래와 같습니다. "rpc_redis_hosts": [ { "host": "127.0.0.1:6379", "database": 0, "auth": "" } ],

한태민 gravatar image한태민 ( 2020-03-27 16:19:28 +0900 )edit

현재 상태에서 로비 서버만 재시작 하신 후에 로그 파일 중 RPC server 관련 로그들을 올려 주시기 바랍니다.

jwlee gravatar imagejwlee ( 2020-03-27 16:27:32 +0900 )edit
1

manifest.lobby.json 파일에 MatchmakingClient 콤포넌트가 추가되어 있는지 확인 해 주시겠어요?

jwlee gravatar imagejwlee ( 2020-03-27 16:55:34 +0900 )edit

"MatchmakingClient": {
}

튜토리얼에 하위항목은 작성하지 않아도 괜찮다하여 세부적인 부분은 빠져있습니다. manifest.lobby.json에는 MatchmakingClient manifest.matchmaker.json 에는 MatchmakingServer 콤포넌트가 설정되어있습니다.

한태민 gravatar image한태민 ( 2020-03-27 17:10:53 +0900 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-03-27 16:03:19 +0900

Seen: 20 times

Last updated: 2 days ago