pomelo-admin-web 监测服务器数据问题
发布于 11 年前 作者 longinnobeans 9569 次浏览 最后一次编辑是 8 年前

pomelo-admin-web 监测不到服务器运行数据,求大神解答~ 控制台报错:Failed to load resource , http://localhost:3005/socket.io/1/?t=1359170043036 ,浏览器用的chrome

11 回复

// app configure app.configure(‘production|development’, function() { // enable the system monitor modules app.enable(‘systemMonitor’);

// route configures
app.route('chat', routeUtil.chat);

// filter configures
app.filter(pomelo.timeout());

});

是否增加了systemMonitor配置??

已经添加

app.configure(‘production|development’, function() { app.enable(‘systemMonitor’); var sceneInfo = require(’./app/modules/sceneInfo’); var onlineUser = require(’./app/modules/onlineUser’); if(typeof app.registerAdmin === ‘function’){ app.registerAdmin(sceneInfo, {app: app}); app.registerAdmin(onlineUser, {app: app}); } //Set areasIdMap, a map from area id to serverId. if (app.serverType !== ‘master’) { var areas = app.get(‘servers’).area; var areaIdMap = {}; for(var id in areas){ areaIdMap[areas[id].area] = areas[id].id; } app.set(‘areaIdMap’, areaIdMap); } // proxy configures app.set(‘proxyConfig’, { cacheMsg: true, interval: 30, lazyConnection: true, enableRpcLog: true });

          // remote configures
          app.set('remoteConfig', {
                  cacheMsg: true, 
                  interval: 30
                  });
          
          // route configures
          app.route('area', routeUtil.area);
          app.route('connector', routeUtil.connector);
          
          app.loadConfig('mysql', app.getBase() + '/../shared/config/mysql.json');
          app.filter(pomelo.timeout());
          });

pomelo-admin-web 需要在游戏同级目录下启动

目前和game-server 在同一个目录下,还是说要放到game-server目录下?

经过查证,发下没有连接上服务器,控制台有crash的log,[client],[browser-1359358598093],[1359358932213],[disconnect] ,原因未知 ,@halfblood @yourihua

系统默认是将监控禁掉了,如果需要开启可以在game-server/app.js配置app.enable(‘systemMonitor’)

我这边chatofpomelo例子,很容易就可以看到了啊。

可能是我这边程序的问题,我调试了下,接受的数据为空,发送数据那块下断点也没断到,正在找看哪块出了问题,onlineuser数据没有,prorfile,systeminfo,scripts都还正确

查了两天,终于能显示了,还改了pomelo底层的代码 在addLoginedUser的时候,component.connection 的值未定义,搜了好久也没发现这个是在哪赋值的,手动加了 component.connection = component.app.components.connection; 然后就OK了(代码位置:pomelo/lib/components/connector.js 120行)@yourihua @halfblood

未找到是什么原因导致component.connection为空,配置问题?其它代码也没改过

到git上咨询下吧

回到顶部