jenkins构建项目报错:
Caused by: com.weibo.api.motan.exception.MotanFrameworkException: error_message: ClusterSupport No service urls for the refer:motan://192.168.0.48:0/default_rpc/com.btzh.service.ConsumeService/1.0/referer, registries:[zookeeper://192.168.0.47:2181/com.weibo.api.motan.registry.RegistryService?group=default_rpc], status: 404, error_code: 10101,r=null
at com.weibo.api.motan.cluster.support.ClusterSupport.init(ClusterSupport.java:102)
at com.weibo.api.motan.config.handler.SimpleConfigHandler.buildClusterSupport(SimpleConfigHandler.java:55)
at com.weibo.api.motan.config.RefererConfig.createClusterSupport(RefererConfig.java:184)
at com.weibo.api.motan.config.RefererConfig.initRef(RefererConfig.java:128)
at com.weibo.api.motan.config.RefererConfig.getRef(RefererConfig.java:85)
at com.weibo.api.motan.config.springsupport.RefererConfigBean.getObject(RefererConfigBean.java:44)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
... 69 more
没有从zookeeper上获取到服务地址, 查找项目disconf上关于zookeeper的配置:
zookeeper.cluster=192.168.0.47:2181,192.168.0.48:2181
到47机器上查看:
root@mach7:/usr/local/zookeeper-3.4.8/bin# ps -ef|grep zookeeper
root 4460 1 0 Jul25 ? 00:08:24 /usr/local/jdk1.8.0_91/bin/java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /usr/local/zookeeper-3.4.8/bin/../build/classes:/usr/local/zookeeper-3.4.8/bin/../build/lib/*.jar:/usr/local/zookeeper-3.4.8/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper-3.4.8/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper-3.4.8/bin/../lib/netty-3.7.0.Final.jar:/usr/local/zookeeper-3.4.8/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper-3.4.8/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper-3.4.8/bin/../zookeeper-3.4.8.jar:/usr/local/zookeeper-3.4.8/bin/../src/java/lib/*.jar:/usr/local/zookeeper-3.4.8/bin/../conf: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /usr/local/zookeeper-3.4.8/bin/../conf/zoo.cfg
root 6915 6743 0 18:53 pts/0 00:00:00 grep --color=auto zookeeper
正常.
到48机器上查看:
root@mach8:/usr/local/zookeeper-3.4.8/bin# ps -ef|grep zookeeper
root 8547 8521 0 18:54 pts/0 00:00:00 grep --color=auto zookeeper
root@mach8:/usr/local/zookeeper-3.4.8/bin# zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper-3.4.8/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
创建本地连接:
root@mach8:/usr/local/zookeeper-3.4.8/bin# zkCli.sh
Connecting to localhost:2181
2018-08-01 18:56:05,530 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.8--1, built on 02/06/2016 03:18 GMT
2018-08-01 18:56:05,533 [myid:] - INFO [main:Environment@100] - Client environment:host.name=mach8
2018-08-01 18:56:05,533 [myid:] - INFO [main:Environment@100] - Client environment:java.version=1.8.0_91
2018-08-01 18:56:05,535 [myid:] - INFO [main:Environment@100] - Client environment:java.vendor=Oracle Corporation
2018-08-01 18:56:05,535 [myid:] - INFO [main:Environment@100] - Client environment:java.home=/usr/local/jdk1.8.0_91/jre
2018-08-01 18:56:05,536 [myid:] - INFO [main:Environment@100] - Client environment:java.class.path=/usr/local/zookeeper-3.4.8/bin/../build/classes:/usr/local/zookeeper-3.4.8/bin/../build/lib/*.jar:/usr/local/zookeeper-3.4.8/bin/../lib/slf4j-log4j12-1.6.1.jar:/usr/local/zookeeper-3.4.8/bin/../lib/slf4j-api-1.6.1.jar:/usr/local/zookeeper-3.4.8/bin/../lib/netty-3.7.0.Final.jar:/usr/local/zookeeper-3.4.8/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper-3.4.8/bin/../lib/jline-0.9.94.jar:/usr/local/zookeeper-3.4.8/bin/../zookeeper-3.4.8.jar:/usr/local/zookeeper-3.4.8/bin/../src/java/lib/*.jar:/usr/local/zookeeper-3.4.8/bin/../conf:
2018-08-01 18:56:05,536 [myid:] - INFO [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2018-08-01 18:56:05,536 [myid:] - INFO [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2018-08-01 18:56:05,536 [myid:] - INFO [main:Environment@100] - Client environment:java.compiler=<NA>
2018-08-01 18:56:05,536 [myid:] - INFO [main:Environment@100] - Client environment:os.name=Linux
2018-08-01 18:56:05,536 [myid:] - INFO [main:Environment@100] - Client environment:os.arch=amd64
2018-08-01 18:56:05,536 [myid:] - INFO [main:Environment@100] - Client environment:os.version=4.2.0-27-generic
2018-08-01 18:56:05,536 [myid:] - INFO [main:Environment@100] - Client environment:user.name=root
2018-08-01 18:56:05,536 [myid:] - INFO [main:Environment@100] - Client environment:user.home=/root
2018-08-01 18:56:05,537 [myid:] - INFO [main:Environment@100] - Client environment:user.dir=/usr/local/zookeeper-3.4.8/bin
2018-08-01 18:56:05,538 [myid:] - INFO [main:ZooKeeper@438] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@506c589e
Welcome to ZooKeeper!
JLine support is enabled
2018-08-01 18:56:05,572 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2018-08-01 18:56:05,654 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@876] - Socket connection established to localhost/127.0.0.1:2181, initiating session
[zk: localhost:2181(CONNECTING) 0] 2018-08-01 18:56:05,710 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1158] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2018-08-01 18:56:05,950 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
2018-08-01 18:56:05,950 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@876] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
2018-08-01 18:56:05,951 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1158] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2018-08-01 18:56:07,605 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2018-08-01 18:56:07,606 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@876] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2018-08-01 18:56:07,608 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1158] - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2018-08-01 18:56:07,733 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
报错了.
查看zoo.cfg:
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=192.168.0.46:2888:3888
server.2=192.168.0.47:2888:3888
server.3=192.168.0.48:2888:3888
发现配置文件中配了3台机器, 实际只有47, 48两台, 删掉46机器, 将47, 48机器的myid文件内容分别改为1和2, zoo.cfg改为如下可以了:
#autopurge.purgeInterval=1
server.1=192.168.0.47:2888:3888
server.2=192.168.0.48:2888:3888