FlowCI/flow-core-x

启动agent报错 Cannot check existing for path

zack24q opened this issue · 5 comments

不知道你们需要哪些信息,先贴报错吧

Exception in thread "Thread-2" com.flow.platform.util.zk.ZkException: Cannot check existing for path: /flow-agents/default/a1
	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.lang.Thread.run(Thread.java:748)
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /flow-agents/default/a1
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
	at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1102)
	at org.apache.curator.framework.imps.ExistsBuilderImpl$3.call(ExistsBuilderImpl.java:237)
	at org.apache.curator.framework.imps.ExistsBuilderImpl$3.call(ExistsBuilderImpl.java:226)
	at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:109)
	at org.apache.curator.framework.imps.ExistsBuilderImpl.pathInForegroundStandard(ExistsBuilderImpl.java:223)
	at org.apache.curator.framework.imps.ExistsBuilderImpl.pathInForeground(ExistsBuilderImpl.java:216)
	at org.apache.curator.framework.imps.ExistsBuilderImpl.forPath(ExistsBuilderImpl.java:175)
	at org.apache.curator.framework.imps.ExistsBuilderImpl.forPath(ExistsBuilderImpl.java:32)
	at com.flow.platform.util.zk.ZKClient.exist(ZKClient.java:102)
	... 4 more

,启动方式:USE_DOCKER=true ./start-agent.sh 127.0.0.1 36421532-5c67-42ff-a1e5-2c5e37125855

@zack24q 当启动domain为127.0.0.1的时候,不要使用USE_DOCKER=true ,把127.0.0.1的换成你宿主机的ip

docker 里面的 127.0.0.1 访问不到你的宿主机,报错是连接不上zookeeper

感谢回复

启动方式改成这样了,还是报一样的错误
./start-agent.sh [宿主机的域名] 36421532-5c67-42ff-a1e5-2c5e37125855

这是nohup里的完整日志(只把域名去掉了)

log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2018-02-24 18:00:47.421 [TRACE] App - ====== Settings: AgentSettings{agentPath=default#a1, webSocketUrl='ws://[宿主机的域名]:8080/flow-api/agent/cmd/logging', cmdStatusUrl='http://[宿主机的域名]:8080/flow-control-center/cmd/report', cmdLogUrl='http://[宿主机的域名]:8080/flow-control-center/cmd/log/upload', zookeeperUrl='[宿主机的域名]:2181'} com.flow.platform.domain.AgentSettings@45c7e403
2018-02-24 18:00:47.422 [TRACE] App - ====== Zookeeper host: [宿主机的域名]:2181
2018-02-24 18:00:47.422 [TRACE] App - ====== Working zone: default
2018-02-24 18:00:47.422 [TRACE] App - ====== Agent agent: a1
2018-02-24 18:00:47.422 [TRACE] App - ========= Config initialized =========
SLF4J: 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-2" com.flow.platform.util.zk.ZkException: Cannot check existing for path: /flow-agents/default/a1
	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.lang.Thread.run(Thread.java:748)
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /flow-agents/default/a1
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
	at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1102)
	at org.apache.curator.framework.imps.ExistsBuilderImpl$3.call(ExistsBuilderImpl.java:237)
	at org.apache.curator.framework.imps.ExistsBuilderImpl$3.call(ExistsBuilderImpl.java:226)
	at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:109)
	at org.apache.curator.framework.imps.ExistsBuilderImpl.pathInForegroundStandard(ExistsBuilderImpl.java:223)
	at org.apache.curator.framework.imps.ExistsBuilderImpl.pathInForeground(ExistsBuilderImpl.java:216)
	at org.apache.curator.framework.imps.ExistsBuilderImpl.forPath(ExistsBuilderImpl.java:175)
	at org.apache.curator.framework.imps.ExistsBuilderImpl.forPath(ExistsBuilderImpl.java:32)
	at com.flow.platform.util.zk.ZKClient.exist(ZKClient.java:102)
	... 4 more

@zack24q zookeeper connect error