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

agent启动问题? #17

Closed
yhvh009 opened this issue Jan 11, 2018 · 24 comments
Closed

agent启动问题? #17

yhvh009 opened this issue Jan 11, 2018 · 24 comments

Comments

@yhvh009
Copy link

yhvh009 commented Jan 11, 2018

mac,docker方式
在控制台新建agent之后,用USER_DOCKER=true ./start-agent.sh 127.0.0.1 XXXX 启动agent,控制台输出成功,但docker的控制台中一直输出
2018-01-11 09:41:39.988 [TRACE] JobService - job timeout task start
2018-01-11 09:41:39.993 [TRACE] JobService - job timeout task end
2018-01-11 09:41:40.319 [TRACE] AgentService:sessionTimeoutTask - start
2018-01-11 09:41:40.332 [TRACE] AgentService:sessionTimeoutTask - end
不知道是不是agent没有启动

@yunheli
Copy link
Contributor

yunheli commented Jan 11, 2018

@yhvh009 这些属于正常的输出,因为有定时任务检测,你在agent页面查看agent是否启动成功

@yhvh009
Copy link
Author

yhvh009 commented Jan 11, 2018

agent里面显示是off,已关机

@yunheli
Copy link
Contributor

yunheli commented Jan 11, 2018

USE_DOCKER 启动的时候 不要用127.0.0.1 Docker里面 127.0.0.1访问的不是外网

FLOW_API_DOMAIN=ip ./start-services.sh
USER_DOCKER=true ./start-agent.sh ip XXXX

@yunheli
Copy link
Contributor

yunheli commented Jan 11, 2018

@yhvh009

@yhvh009
Copy link
Author

yhvh009 commented Jan 11, 2018

可能是路径之类的配置有问题,nohup.out里面输出:

�[34m2018-01-11 17:38:24.459 [TRACE] App - ========= Flow Agent Started =========
�[m�[34m2018-01-11 17:38:24.461 [TRACE] App - === Server: http://127.0.0.1:8080/flow-api
�[m�[34m2018-01-11 17:38:24.461 [TRACE] App - === Token: 1d93cdfd-c2ff-4432-82c2-0fe6905f5520
�[m�[34m2018-01-11 17:38:24.462 [TRACE] App - === Start to load configuration
�[mlog4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
�[34m2018-01-11 17:38:24.924 [TRACE] App - ====== Settings: AgentSettings{agentPath=default#agent_test, webSocketUrl='ws://127.0.0.1:8080/flow-api/agent/cmd/logging', cmdStatusUrl='http://127.0.0.1:8080/flow-control-center/cmd/report', cmdLogUrl='http://127.0.0.1:8080/flow-control-center/cmd/log/upload', zookeeperUrl='127.0.0.1:2181'} com.flow.platform.domain.AgentSettings@275fe372
�[m�[34m2018-01-11 17:38:24.924 [TRACE] App - ====== Zookeeper host: 127.0.0.1:2181
�[m�[34m2018-01-11 17:38:24.925 [TRACE] App - ====== Working zone: default
�[m�[34m2018-01-11 17:38:24.925 [TRACE] App - ====== Agent agent: agent_test
�[m�[34m2018-01-11 17:38:24.925 [TRACE] App - ========= Config initialized =========
�[mSLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "Thread-1" com.flow.platform.util.zk.ZkException: Cannot check existing for path: /flow-agents/default/agent_test
at com.flow.platform.util.zk.ZKClient.exist(ZKClient.java:104)
at com.flow.platform.util.zk.ZKClient.createEphemeral(ZKClient.java:147)
at com.flow.platform.agent.AgentManager.registerZkNodeAndWatch(AgentManager.java:202)
at com.flow.platform.agent.AgentManager.run(AgentManager.java:95)
at java.base/java.lang.Thread.run(Thread.java:844)

@yhvh009
Copy link
Author

yhvh009 commented Jan 11, 2018

我是在本地运行的,所以应该不是localhost的问题 @yunheli

@yhvh009
Copy link
Author

yhvh009 commented Jan 11, 2018

那个路径不知道是哪里配置的,/flow-agents/default/agent_test

@yunheli
Copy link
Contributor

yunheli commented Jan 11, 2018

agent 要访问api的地址 在docker里面访问 127.0.0.1:8080/flow-api能访问么

@yunheli
Copy link
Contributor

yunheli commented Jan 11, 2018

@yhvh009 agent与api打交道是通过api来获取token,但是在docker里面访问127.0.0.1访问的不是外网的,所以需要知道你宿主机器的ip来访问

@yhvh009
Copy link
Author

yhvh009 commented Jan 11, 2018

这块不是太懂,宿主机器是指什么?我就是本地mac安装的docker,flowci也是跑在我本地mac上的

@yhvh009
Copy link
Author

yhvh009 commented Jan 11, 2018

@yunheli

@yhvh009
Copy link
Author

yhvh009 commented Jan 11, 2018

我访问控制台就是直接浏览器访问localhost:3000的,这个是能访问的

@yunheli
Copy link
Contributor

yunheli commented Jan 11, 2018

宿主机就是你的mac电脑 ,ifconfig 获取到你的mac在局域网的ip之后按照之前的启动就行了

@yunheli
Copy link
Contributor

yunheli commented Jan 11, 2018

localhost:3000是证明你的api启动成功了,但是你的agent要个api打交道就不能用USE_DOCKER的形式

@yunheli
Copy link
Contributor

yunheli commented Jan 11, 2018

USE_DOCKER 的形式是访问不到api的

@yunheli
Copy link
Contributor

yunheli commented Jan 11, 2018

你的机器上如果有java环境就把USE_DOCKER去掉吧

@yhvh009
Copy link
Author

yhvh009 commented Jan 11, 2018

哦哦,好的,我先试一下

@yunheli
Copy link
Contributor

yunheli commented Jan 11, 2018

@yhvh009
Copy link
Author

yhvh009 commented Jan 11, 2018

@yunheli 还是不太行,可能我哪里的理解有问题吧,能加个QQ或者微信之类的么?

@KKSun
Copy link

KKSun commented Mar 2, 2018

mac上用docker的问题已经解决,推测原因应该是后端端口8080被占用(通过lsof -i:8080发现8080端口被mac版微信占用)

解决方案
前端端口和后端端口按照以下图片的指示改为不常用的端口号(eg. 12345 & 13456)
image
接着在xx/docker目录下用FLOW_API_DOMAIN=127.0.0.1 FLOW_WEB_DOMAIN=127.0.0.1 ./start-services.sh即可实现本机登录(默认登录名、密码见log)

@LGang
Copy link

LGang commented Mar 24, 2018

我也出现了这个问题,具体见截图,就是控制台显示Agent启动成功了,但是在浏览器中看还是关机状态。

cd docker
./start-services.sh
USE_DOCKER=true ./start-agent.sh localhost ***********

browser
console
docker
@yunheli @KKSun 望解答

@yunheli
Copy link
Contributor

yunheli commented Mar 26, 2018

@yhvh009 使用USE_DOCKER=true时不要使用 localhost

@yunheli
Copy link
Contributor

yunheli commented Mar 26, 2018

@LGang

@yunheli
Copy link
Contributor

yunheli commented Mar 26, 2018

+QQ: 1059103388

@gy2006 gy2006 closed this as completed May 2, 2018
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

5 participants