Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TarsActDemo有时候服务不通,有时候通 #15

Closed
Titanssword opened this issue Jan 16, 2019 · 3 comments
Closed

TarsActDemo有时候服务不通,有时候通 #15

Titanssword opened this issue Jan 16, 2019 · 3 comments

Comments

@Titanssword
Copy link

这个问题困扰了一段时间了,主要基于Docker镜像去跑的Demo,

docker run --name mysql -e MYSQL_ROOT_PASSWORD=123456 -d -p 3306:3306 mysql:5.6 --innodb_use_native_aio=0
docker run -d -it --name tars --link mysql --env MOUNT_DATA=false --env DBIP=mysql --env DBPort=3306 --env DBUser=root --env DBPassword=123456 -P tarscloud/tars:php
docker run --name some-redis -d redis

IP

/swordtars - 172.17.0.3
/mysql - 172.17.0.2
/some-tars -
/some-redis - 172.17.0.4

服务与绑定地址如下


QD.ActCommentServer.CommentObj | tcp -h 172.17.0.3 -t 60000 -p 20201 -e 0
-- | --

QD.UserService.UserObj | tcp -h 172.17.0.3 -t 60000 -p 20107 -e 0
-- | --

QD.ActHttpServer.obj | tcp -h 172.17.0.3 -t 60000 -p 20003 -e 0
-- | --

三种镜像如上,错误表现如下,

image

经过大概半小时刷新页面,问题消失
image

查看log情况
/data/tars/app_log/QD
该目录下,三种服务都无错误报出,
之后去/data/tars/app_log/tars这个目录下查看各类服务的log情况,具体结果如下:

 cat tarsAdminRegistry/tars.tarsAdminRegistry.log | grep ERROR
2019-01-16 14:50:51|386|ERROR|[TARS][CommunicatorEpoll::handleInputImp] connect error tcp -h 172.17.0.3 -p 10002,tars.tarsnotify.NotifyObj,_connExcCnt=1,Connection refused

 cat tarsnotify/tars.tarsnotify.log | grep ERROR
2019-01-16 14:50:51|549|ERROR|NotifyImp::IsdbTableExist sTbName:t_server_notifys|doesn't exist
2019-01-16 14:50:51|548|ERROR|NotifyImp::IsdbTableExist sTbName:t_server_notifys|doesn't exist
2019-01-16 14:50:51|548|ERROR|NotifyImp::creatTb exception:[TC_Mysql::execute]: mysql_query: [ CREATE TABLE `t_server_notifys` (   `id` int(11) NOT NULL AUTO_INCREMENT,  `application` varchar(128) DEFAULT '',  `server_name` varchar(128) DEFAULT NULL, `container_name` varchar(128) DEFAULT '' , `node_name` varchar(128) NOT NULL DEFAULT '',  `set_name` varchar(16) DEFAULT NULL,  `set_area` varchar(16) DEFAULT NULL,  `set_group` varchar(16) DEFAULT NULL,  `server_id` varchar(100) DEFAULT NULL,  `thread_id` varchar(20) DEFAULT NULL,  `command` varchar(50) DEFAULT NULL,  `result` text,  `notifytime` datetime DEFAULT NULL,  PRIMARY KEY (`id`),  KEY `index_name` (`server_name`),  KEY `servernoticetime_i_1` (`notifytime`),  KEY `indx_1_server_id` (`server_id`),  KEY `query_index` (`application`,`server_name`,`node_name`,`set_name`,`set_area`,`set_group`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ] :Table 't_server_notifys' already exists
2019-01-16 14:50:51|548|ERROR|NotifyImp::reportNotifyInfo insert2Db exception:[TC_Mysql::execute]: mysql_query: [ insert into t_server_notifys (`application`,`container_name`,`node_name`,`notifytime`,`result`,`server_id`,`server_name`,`set_area`,`set_group`,`set_name`,`thread_id`) values ('tars','','172.17.0.3',now(),'restart','tars.tarsconfig_172.17.0.3','tarsconfig','','','','140566645450880') ] :Table 'db_tars.t_server_notifys' doesn't exist
2019-01-16 14:50:51|549|ERROR|NotifyImp::reportNotifyInfo insert2Db exception:[TC_Mysql::execute]: mysql_query: [ insert into t_server_notifys (`application`,`container_name`,`node_name`,`notifytime`,`result`,`server_id`,`server_name`,`set_area`,`set_group`,`set_name`,`thread_id`) values ('tars','','172.17.0.3',now(),'restart','tars.tarspatch_172.17.0.3','tarspatch','','','','140279281969280') ] :Table 'db_tars.t_server_notifys' doesn't exist
[root@55d9c1126c25 tars]#  cat tarsAdminRegistry/tars.tarsAdminRegistry.log | grep ERROR 2019-01-16 14:50:51|386|ERROR|[TARS][CommunicatorEpoll::handleInputImp] connect error tcp -h 172.17.0.3 -p 10002,tars.tarsnotify.NotifyObj,_connExcCnt=1,Connection refused

cat tarspatch/tars.tarspatch.log | grep ERROR
2019-01-16 15:24:17|504|ERROR|PatchCache::load sFile:/usr/local/app/patchs/tars/TARSBatchPatching/QD/ActCommentServer/QD.ActCommentServer.tgz|invalid file size must(104857600>238631<1048576)
2019-01-16 15:24:17|504|ERROR|PatchImp::__downloadFromMem file:/usr/local/app/patchs/tars/TARSBatchPatching/QD/ActCommentServer/QD.ActCommentServer.tgz|pos:0|LoadFile error
2019-01-16 15:24:17|517|ERROR|PatchCache::load sFile:/usr/local/app/patchs/tars/TARSBatchPatching/QD/ActCommentServer/QD.ActCommentServer.tgz|invalid file size must(104857600>238631<1048576)
2019-01-16 15:24:17|517|ERROR|PatchImp::__downloadFromMem file:/usr/local/app/patchs/tars/TARSBatchPatching/QD/ActCommentServer/QD.ActCommentServer.tgz|pos:238631|LoadFile error
2019-01-16 15:24:41|504|ERROR|PatchCache::load sFile:/usr/local/app/patchs/tars/TARSBatchPatching/QD/UserService/QD.UserService.tgz|invalid file size must(104857600>269965<1048576)
2019-01-16 15:24:41|504|ERROR|PatchImp::__downloadFromMem file:/usr/local/app/patchs/tars/TARSBatchPatching/QD/UserService/QD.UserService.tgz|pos:0|LoadFile error
2019-01-16 15:24:41|517|ERROR|PatchCache::load sFile:/usr/local/app/patchs/tars/TARSBatchPatching/QD/UserService/QD.UserService.tgz|invalid file size must(104857600>269965<1048576)
2019-01-16 15:24:41|517|ERROR|PatchImp::__downloadFromMem file:/usr/local/app/patchs/tars/TARSBatchPatching/QD/UserService/QD.UserService.tgz|pos:269965|LoadFile error
2019-01-16 15:25:21|513|ERROR|PatchCache::load sFile:/usr/local/app/patchs/tars/TARSBatchPatching/QD/ActHttpServer/QD.ActHttpServer.tgz|invalid file size must(104857600>242132<1048576)
2019-01-16 15:25:21|513|ERROR|PatchImp::__downloadFromMem file:/usr/local/app/patchs/tars/TARSBatchPatching/QD/ActHttpServer/QD.ActHttpServer.tgz|pos:0|LoadFile error
2019-01-16 15:25:21|517|ERROR|PatchCache::load sFile:/usr/local/app/patchs/tars/TARSBatchPatching/QD/ActHttpServer/QD.ActHttpServer.tgz|invalid file size must(104857600>242132<1048576)
2019-01-16 15:25:21|517|ERROR|PatchImp::__downloadFromMem file:/usr/local/app/patchs/tars/TARSBatchPatching/QD/ActHttpServer/QD.ActHttpServer.tgz|pos:242132|LoadFile error


 cat tarsproperty/tars.tarsproperty.log | grep ERROR
2019-01-16 15:59:41|529|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:5229]: buffer size:1
2019-01-16 15:59:41|529|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:5230]: buffer size:1
2019-01-16 15:59:41|529|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:5231]: buffer size:1
2019-01-16 15:59:41|529|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:5232]: buffer size:1
2019-01-16 15:59:41|529|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:5233]: buffer size:1
2019-01-16 15:59:41|529|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:5234]: buffer size:1
2019-01-16 15:59:41|529|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:5235]: buffer size:1
2019-01-16 15:59:41|529|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:5236]: buffer size:1
2019-01-16 15:59:41|529|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:5237]: buffer size:1

 cat tarsregistry/tars.tarsregistry.log | grep ERROR
2019-01-16 14:50:51|393|ERROR|[TARS][CommunicatorEpoll::handleInputImp] connect error tcp -h 172.17.0.3 -p 10002,tars.tarsnotify.NotifyObj,_connExcCnt=1,Connection refused

cat tarsstat/tars.tarsstat.log | grep ERROR
2019-01-16 16:05:22|563|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:8636]: buffer size:1
2019-01-16 16:05:22|563|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:8637]: buffer size:1
2019-01-16 16:05:22|563|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:8638]: buffer size:1
2019-01-16 16:05:22|563|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:8639]: buffer size:1
2019-01-16 16:05:22|563|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:8640]: buffer size:1
2019-01-16 16:05:23|563|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:8641]: buffer size:1
2019-01-16 16:05:23|563|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:8642]: buffer size:1
2019-01-16 16:05:23|563|ERROR|[TARS] write to remote log server error:server servant mismatch exception: ret:-4 msg:[ServantProxy::invoke errno:-4,info:,servant:tars.tarslog.LogObj,func:loggerbyInfo,adaptertcp -h 172.17.0.3 -p 10003,reqid:8643]: buffer size:1

还有一个问题,使用web管理界面部署服务,当提示成功的时候,就代表服务已经部署好了?,还是说需要一定的时间?

Thanks in advance.

@bobzhangyong
Copy link
Contributor

看起来是 http 服务问主控要其他俩个服务ip 地址的时候没有拿到地址,检查一下其他两个服务是否运行正常 主控是否正常

@Titanssword
Copy link
Author

其他两个服务都是正常的,在web管理页面看到所有服务都是正常的,所有服务如下
image
ps -ef之后主控服务也是在运行的,主控的log信息如下

cat tarsregistry/tars.tarsregistry.log | grep ERROR
2019-01-16 14:50:51|393|ERROR|[TARS][CommunicatorEpoll::handleInputImp] connect error tcp -h 172.17.0.3 -p 10002,tars.tarsnotify.NotifyObj,_connExcCnt=1,Connection refused

主要这个问题还没有办法复现=。=
现在整个都是正常运行的,但不清楚什么时候又会出现这个问题

@bobzhangyong
Copy link
Contributor

你的日志显示 register 链接 notify 的时候 失败了,上面调用失败的原因看起来是php 不能和register 通讯,
Docker 容器的ip 可能因为容器重启而变化,你检查一下 register 是否正常启动,启动的ip 是否和你安装的时候一致。去register 服务器上尝试重启一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants