欢迎您来到腾讯云!积分商城

腾讯云腾讯云论坛

 找回密码
 立即注册
忘了密码?

扫一扫,访问微社区

快捷导航
搜索
查看: 172|回复: 0

[咨询求助] 云服务器上运行这一个服务端,我的客户端连接不到服务端

[复制链接]

1

主题

0

好友

70

积分

小白[LV1]

Rank: 1

云币
200
威望
70
发表于 2018-1-21 23:00:30 |显示全部楼层 |未分类
云服务器上运行这一个服务端,我的客户端连接不到服务端。
服务端所需环境,已安装:
JAVA,
1个帐号数据库,PostgeSQL 9.1 ,
一个游戏数据库 WampServer.

启动服务端需要:
1.配置.bat关联文件
2.启动服务端的六个.bat程序。其中2个很重要,1个是帐号服务,一个是游戏服务。

客户端先登录帐号服务器,然后在选择游戏服务器,再登入一次。(好像有二次验证,我也不清楚,这是国外一个已经停运几年的游戏,我准备做一个基友服,几个朋友一起玩)
我在传统服务器上,或者本地上(本地所有配置文件IP必须填写127.0.0.1)配置,一切正常,可以运行。但是在云服务器上运行不了,

我估计主要是帐号服务,游戏服务器的2个相关配置文件的IP设置问题。传统服务器位置文件需要填IP的地方,直接填公网IP就好。云服务器无法填写公网IP(填公网无法启动帐号服务器),只能填写内网IP。填写内网IP后,
客户端只能登录帐号服务器,进入游戏服务器选择页面之后,登录游戏服务器会超时。
客户端只能登录帐号服务器,进入游戏服务器选择页面之后,登录游戏服务器会超时。
客户端只能登录帐号服务器,进入游戏服务器选择页面之后,登录游戏服务器会超时。


------传统服务器帐号服务配置文件如下-----

<?xml version="1.0" encoding="UTF-8"?>

-<config mapServicesAmount="1" serversNeed="1" build="Debug" name="AAA">

<net bindPortsRange="15" datagramPort="8000" basePort="9000"/>

<logging kind="none"/>


-<accountServer build="builds/standard.xml" ip="127.0.0.1" versionOnLogin="-1" clientsLimit="10" maxUsersOnShard="10">

<approve ip="127.0.0.1" port="9346"/>

<auth ip="公网IP" port="9340" timeout="30000"/>

<api port="9356" host="127.0.0.1" protocol="http"/>

<db host="127.0.0.1" password="postgres" user="postgres"/>


-<authenticator>

<api port="9398" host="127.0.0.1"/>

</authenticator>

</accountServer>

</config>
----------
主要是     auth ip="公网IP"     这里,云服务器只能填写我的内网172.27.0.4,如果填我的外网118.24.49.99 ,就会提示我 failed to create server on /118.24.49.55:9340 , ip not found on this machine ,帐号服务器日志如下
-----具体如下-----
1-21 08:42:00,402, 8265] main - INFO  accountserver.c  : Starting account api at 127.0.0.1:9356
[01-21 08:42:00,402, 8265] main - INFO  tools.commons.logs.LogToLog4jHandler  : Redirecting java.util.logging to Log4J...
[01-21 08:42:00,434, 8297] main - INFO  tools.commons.logs.LogToLog4jHandler  : Redirection of java.util.logging to Log4J started
[01-21 08:42:00,449, 8312] main - INFO  org.mortbay.log  : Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog
[01-21 08:42:00,559, 8422] main - INFO  org.mortbay.log  : jetty-6.1.26
[01-21 08:42:00,590, 8453] main - INFO  org.mortbay.log  : Started SelectChannelConnector@127.0.0.1:9356
[01-21 08:42:00,590, 8453] main - INFO  accountserver.c  : Account api started
[01-21 08:42:00,590, 8453] main - INFO  accountserver.c  : initializing RSA keys...
[01-21 08:42:00,746, 8609] main - INFO  accountserver.c  : rsa keys initialized
[01-21 08:42:00,762, 8625] main - INFO  accountserver.c  : creating server for client authentification 118.24.49.55:9340
[01-21 08:42:00,793, 8656] main - ERROR verify  : exception running account server
accountserver.c$b_: can't create account server
        at accountserver.c.a(c.java:133)
        at accountserver.bc.a(bc.java:9)
        at launch.a.a(a.java:4)
        at launch.c.a(c.java:55)
        at launch.c.a(c.java:4)
        at launch.c.a(c.java:35)
        at accountserver.AccountServerMain.main(AccountServerMain.java:2)
Caused by: java.io.IOException: failed to create server on /118.24.49.55:9340 , ip not found on this machine
        at net.qb$f_.c(qb$f_.java:33)
        at net.qb$f_.execute(qb$f_.java:4)
        at tools.concurrent.g$a_.run(g$a_.java:42)
        at tools.concurrent.g.a(g.java:7)
        at net.qb$i_.e(qb$i_.java:72)
        at tools.concurrent.bb.run(bb.java:20)
        at java.lang.Thread.run(Thread.java:722)



如果我  auth ip="公网IP"   换成内网IP, 客户端可以登录帐号服务器,但是连接游戏服务器的时候连接不上。BBB是游戏服务器名字,  日志如下

[01-21 08:29:44,873, 8781] main - INFO  accountserver.c  : Starting account api at 127.0.0.1:9356
[01-21 08:29:44,873, 8781] main - INFO  tools.commons.logs.LogToLog4jHandler  : Redirecting java.util.logging to Log4J...
[01-21 08:29:44,904, 8812] main - INFO  tools.commons.logs.LogToLog4jHandler  : Redirection of java.util.logging to Log4J started
[01-21 08:29:44,920, 8828] main - INFO  org.mortbay.log  : Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog
[01-21 08:29:45,029, 8937] main - INFO  org.mortbay.log  : jetty-6.1.26
[01-21 08:29:45,061, 8969] main - INFO  org.mortbay.log  : Started SelectChannelConnector@127.0.0.1:9356
[01-21 08:29:45,061, 8969] main - INFO  accountserver.c  : Account api started
[01-21 08:29:45,061, 8969] main - INFO  accountserver.c  : initializing RSA keys...
[01-21 08:29:45,764, 9672] main - INFO  accountserver.c  : rsa keys initialized
[01-21 08:29:45,779, 9687] main - INFO  accountserver.c  : creating server for client authentification 172.27.0.4:9340
[01-21 08:29:45,795, 9703] main - INFO  accountserver.c  : client authentification server created
[01-21 08:29:45,795, 9703] main - INFO  accountserver.c  : creating server for session approvement 127.0.0.1:9346
[01-21 08:29:45,811, 9719] main - INFO  accountserver.c  : session approvement server created
[01-21 08:29:45,811, 9719] main - INFO  accountserver.c  : account server started, client <-> account server version = 73, shard <-> account server version = 48
[01-21 08:29:45,811, 9719] main - INFO  accountserver.context.e  : Using NONE statistics exporter.
[01-21 08:29:51,357, 15265] net selector_1 - INFO  accountserver.authenticator.api.AuthenticatorService  : Client connected, id = 1 host:127.0.0.1
[01-21 08:31:16,995, 100903] net selector_1 - INFO  accountserver.u  : frontEnd /127.0.0.1:51837 -> /127.0.0.1:9346 connected
[01-21 08:31:16,997, 100905] net selector_1 - INFO  accountserver.u  : frontEnd /127.0.0.1:51838 -> /127.0.0.1:9346 connected
[01-21 08:31:16,997, 100905] net selector_1 - INFO  accountserver.u  : frontEnd /127.0.0.1:51839 -> /127.0.0.1:9346 connected
[01-21 08:31:16,998, 100906] net selector_1 - INFO  accountserver.u  : frontEnd /127.0.0.1:51840 -> /127.0.0.1:9346 connected
[01-21 08:31:17,192, 101100] net selector_1 - INFO  accountserver.u  : frontEnd /127.0.0.1:51841 -> /127.0.0.1:9346 connected
[01-21 08:31:59,504, 143412] net_worker_5 - INFO  accountserver.vb  : adding front-end Game 5 : (BBB (172.27.0.4), 127.0.0.1:9322)
[01-21 08:31:59,505, 143413] net_worker_6 - INFO  accountserver.vb  : adding front-end Game 2 : (BBB (172.27.0.4), 127.0.0.1:9323)
[01-21 08:31:59,505, 143413] net_worker_5 - INFO  accountserver.u  : Shard BBB (172.27.0.4:9322) connected
[01-21 08:31:59,506, 143414] net_worker_4 - INFO  accountserver.vb  : adding front-end Xmpp 6 : (BBB (172.27.0.4), 127.0.0.1:5222)
[01-21 08:31:59,506, 143414] net_worker_6 - INFO  accountserver.u  : Shard BBB (172.27.0.4:9323) connected
[01-21 08:31:59,507, 143415] net_worker_4 - INFO  accountserver.u  : Shard BBB (172.27.0.4:5222) connected
[01-21 08:31:59,556, 143464] net_worker_1 - INFO  accountserver.vb  : adding front-end Game 3 : (BBB (172.27.0.4), 127.0.0.1:9324)
[01-21 08:31:59,557, 143465] net_worker_1 - INFO  accountserver.u  : Shard BBB (172.27.0.4:9324) connected
[01-21 08:32:02,605, 146513] net_worker_2 - INFO  accountserver.vb  : adding front-end Game 4 : (BBB (172.27.0.4), 127.0.0.1:9325)
[01-21 08:32:02,606, 146514] net_worker_2 - INFO  accountserver.u  : Shard BBB (172.27.0.4:9325) connected
[01-21 08:36:09,541, 393449] crypt_worker_8 - INFO  accountserver.m  : 客户端登录的帐号XXX (183.93.235.30) logined succesfully
[01-21 08:36:10,845, 394753] main - INFO  accountserver.xb  : vanchik sent to 172.27.0.4:9323(BBB)
[01-21 08:36:20,847, 404755] net timeouts_0 - INFO  accountserver.w  : name "客户端登录的帐号XXX"; socket /183.93.235.30:6448 -> /172.27.0.4:9340; closed true closed (deliver HostPortMsg timeout expired; null)


您需要登录后才可以回帖 登录 | 立即注册
您需要登录后才可以发帖 QQ登录

联系我们|腾讯云平台|积分商城|腾讯云官方论坛    

GMT+8, 2018-2-20 19:35 , Processed in 1.173496 second(s), 29 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部