Terry-Mao / goim

goim
https://goim.io/
MIT License
7.21k stars 1.78k forks source link

hello作者,遇到个discovery的问题 烦请帮忙看下 #265

Closed wangbon closed 5 years ago

wangbon commented 5 years ago

启动之后:comet有报错如下: client.go:587] discovery: client.Get(http://192.168.0.67:7171/discovery/polls?appid=infra.disco very&appid=goim.logic&env=dev&hostname=ecs-f8a3&latest_timestamp=1550021251882167963&latest_timestamp=0) get error code(-404) 查看本地的discovery registry.go:183] Polls zone() env(dev) appid(goim.comet) error(-404) 啥原因啊

wangbon commented 5 years ago

感觉是zone为空? 但这个指令不是已经指定了zone这个参数了吗 nohup target/comet -conf=target/comet.toml -zone=sh001 -deploy.env=dev -region=sh -weight=10 -addrs=127.0.0.1 -debug=true 2>&1 > target/comet.log

tonybase commented 5 years ago

这个是因为comet依赖logic,看看logic是否有启动注册到服务发现

tonybase commented 5 years ago

是不是comet没有指定zone的呢

wangbon commented 5 years ago

在本机开启discovery。 [root@ecs-f8a3 discovery]# ./discovery -conf discovery-example.toml -alsologtostderr I0213 15:59:45.271066 2144 syncup.go:152] discovery changed nodes:[192.168.0.67:7171] zones:map[] I0213 15:59:45.271272 2144 registry.go:208] Polls from(test1) new connection(1) 然后在本机手动启动logic : target/logic -conf=target/logic.toml -weight=10 2>&1 > target/logic.log & 出现如下错误 E0213 16:01:22.893778 2305 client.go:582] discovery: client.Get(http://192.168.0.67:7171/discovery/polls?appid=infra.disc overy&env=dev&hostname=ecs-f8a3&latest_timestamp=1550044785270442093) error(Get http://192.168.0.67:7171/discovery/polls?app id=infra.discovery&env=dev&hostname=ecs-f8a3&latest_timestamp=1550044785270442093: context canceled) E0213 16:01:22.894383 2305 client.go:587] discovery: client.Get(http://192.168.0.67:7171/discovery/polls?appid=infra.disc overy&appid=goim.comet&env=dev&hostname=ecs-f8a3&latest_timestamp=1550044785270442093&latest_timestamp=0) get error code(-40 4) 谢谢作者谆谆教导

wangbon commented 5 years ago

在启动logic之后十秒出现的打印是 E0213 16:21:08.846410 2567 logic.go:80] discovery start timeout 可我已经单独git了discovery的代码 然后在git的目录下启动的discovery (不是通过部署goim时候go get ./...自动依赖下载的discovery) 真是麻烦作者啦 ,谢谢

wangbon commented 5 years ago

emmm我改成在依赖的下载的discovery里启动discovery还是不行 emmm

1bazinga25 commented 5 years ago

在本机开启discovery。 [root@ecs-f8a3 discovery]# ./discovery -conf discovery-example.toml -alsologtostderr I0213 15:59:45.271066 2144 syncup.go:152] discovery changed nodes:[192.168.0.67:7171] zones:map[] I0213 15:59:45.271272 2144 registry.go:208] Polls from(test1) new connection(1) 然后在本机手动启动logic : target/logic -conf=target/logic.toml -weight=10 2>&1 > target/logic.log & 出现如下错误 E0213 16:01:22.893778 2305 client.go:582] discovery: client.Get(http://192.168.0.67:7171/discovery/polls?appid=infra.disc overy&env=dev&hostname=ecs-f8a3&latest_timestamp=1550044785270442093) error(Get http://192.168.0.67:7171/discovery/polls?app id=infra.discovery&env=dev&hostname=ecs-f8a3&latest_timestamp=1550044785270442093: context canceled) E0213 16:01:22.894383 2305 client.go:587] discovery: client.Get(http://192.168.0.67:7171/discovery/polls?appid=infra.disc overy&appid=goim.comet&env=dev&hostname=ecs-f8a3&latest_timestamp=1550044785270442093&latest_timestamp=0) get error code(-40 4) 谢谢作者谆谆教导

遇到了跟你一样的问题,目前还没解决。你这边有什么解决方案了吗

wangbon commented 5 years ago

在本机开启discovery。 [root@ecs-f8a3 discovery]# ./discovery -conf discovery-example.toml -alsologtostderr I0213 15:59:45.271066 2144 syncup.go:152] discovery changed nodes:[192.168.0.67:7171] zones:map[] I0213 15:59:45.271272 2144 registry.go:208] Polls from(test1) new connection(1) 然后在本机手动启动logic : target/logic -conf=target/logic.toml -weight=10 2>&1 > target/logic.log & 出现如下错误 E0213 16:01:22.893778 2305 client.go:582] discovery: client.Get(http://192.168.0.67:7171/discovery/polls?appid=infra.disc overy&env=dev&hostname=ecs-f8a3&latest_timestamp=1550044785270442093) error(Get http://192.168.0.67:7171/discovery/polls?app id=infra.discovery&env=dev&hostname=ecs-f8a3&latest_timestamp=1550044785270442093: context canceled) E0213 16:01:22.894383 2305 client.go:587] discovery: client.Get(http://192.168.0.67:7171/discovery/polls?appid=infra.disc overy&appid=goim.comet&env=dev&hostname=ecs-f8a3&latest_timestamp=1550044785270442093&latest_timestamp=0) get error code(-40 4) 谢谢作者谆谆教导

遇到了跟你一样的问题,目前还没解决。你这边有什么解决方案了吗

没有0.0 尴尬了

wangbon commented 5 years ago

问题原因找到了,启动的时候报cancel是正常的,因为可能有新的appid加入watch,会取消当前的poll,并把新的appid加进去。 ----来自大佬解释。