不是本地的zookeeper出错的问题?

来源:6-11 sentinel之配置持久化

用银河口袋的露娜

2019-10-20

我改zookeeper设置的位置是
package com.alibaba.csp.sentinel.dashboard.rule.zookeeper里的

        CuratorFramework zkClient =
                CuratorFrameworkFactory.newClient("192.168.1.104:2181",
                        new ExponentialBackoffRetry(ZookeeperConfigUtil.SLEEP_TIME, ZookeeperConfigUtil.RETRY_TIMES));
2019-10-20 23:21:50.660  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:zookeeper.version=3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60, built on 04/03/2017 16:19 GMT
2019-10-20 23:21:50.661  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:host.name=RNYNM0W9RN443JW
2019-10-20 23:21:50.661  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:java.version=1.8.0_151
2019-10-20 23:21:50.661  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:java.vendor=Oracle Corporation
2019-10-20 23:21:50.662  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:java.home=C:\Program Files\Java\jdk1.8.0_151\jre
2019-10-20 23:21:50.662  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:java.class.path=C:\Program Files\Java\jdk1.8.0_151\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_151\jre\lib\rt.jar;C:\Program Files\Java\jre1.8.0_151\lib;G:\idea_workspace\Sentinel-release-1.6\sentinel-dashboard\target\classes;G:\idea_workspace\Sentinel-release-1.6\sentinel-core\target\classes;G:\idea_workspace\Sentinel-release-1.6\sentinel-adapter\sentinel-web-servlet\target\classes;G:\idea_workspace\Sentinel-release-1.6\sentinel-transport\sentinel-transport-simple-http\target\classes;G:\idea_workspace\Sentinel-release-1.6\sentinel-transport\sentinel-transport-common\target\classes;G:\idea_workspace\Sentinel-release-1.6\sentinel-extension\sentinel-parameter-flow-control\target\classes;F:\apache-maven-3.3.9\repository\com\googlecode\concurrentlinkedhashmap\concurrentlinkedhashmap-lru\1.4.2\concurrentlinkedhashmap-lru-1.4.2.jar;G:\idea_workspace\Sentinel-release-1.6\sentinel-adapter\sentinel-api-gateway-adapter-common\target\classes;F:\apache-maven-3.3.9\repository\org\springframework\boot\spring-boot-starter-web\2.0.5.RELEASE\spring-boot-starter-web-2.0.5.RELEASE.jar;F:\apache-maven-3.3.9\repository\org\springframework\boot\spring-boot-starter\2.0.5.RELEASE\spring-boot-starter-2.0.5.RELEASE.jar;F:\apache-maven-3.3.9\repository\org\springframework\boot\spring-boot\2.0.5.RELEASE\spring-boot-2.0.5.RELEASE.jar;F:\apache-maven-3.3.9\repository\org\springframework\boot\spring-boot-autoconfigure\2.0.5.RELEASE\spring-boot-autoconfigure-2.0.5.RELEASE.jar;F:\apache-maven-3.3.9\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;F:\apache-maven-3.3.9\repository\org\yaml\snakeyaml\1.19\snakeyaml-1.19.jar;F:\apache-maven-3.3.9\repository\org\springframework\boot\spring-boot-starter-json\2.0.5.RELEASE\spring-boot-starter-json-2.0.5.RELEASE.jar;F:\apache-maven-3.3.9\repository\com\fasterxml\jackson\core\jackson-databind\2.9.6\jackson-databind-2.9.6.jar;F:\apache-maven-3.3.9\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;F:\apache-maven-3.3.9\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.6\jackson-datatype-jdk8-2.9.6.jar;F:\apache-maven-3.3.9\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.6\jackson-datatype-jsr310-2.9.6.jar;F:\apache-maven-3.3.9\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.6\jackson-module-parameter-names-2.9.6.jar;F:\apache-maven-3.3.9\repository\org\springframework\boot\spring-boot-starter-tomcat\2.0.5.RELEASE\spring-boot-starter-tomcat-2.0.5.RELEASE.jar;F:\apache-maven-3.3.9\repository\org\apache\tomcat\embed\tomcat-embed-core\8.5.34\tomcat-embed-core-8.5.34.jar;F:\apache-maven-3.3.9\repository\org\apache\tomcat\embed\tomcat-embed-el\8.5.34\tomcat-embed-el-8.5.34.jar;F:\apache-maven-3.3.9\repository\org\apache\tomcat\embed\tomcat-embed-websocket\8.5.34\tomcat-embed-websocket-8.5.34.jar;F:\apache-maven-3.3.9\repository\org\hibernate\validator\hibernate-validator\6.0.12.Final\hibernate-validator-6.0.12.Final.jar;F:\apache-maven-3.3.9\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;F:\apache-maven-3.3.9\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;F:\apache-maven-3.3.9\repository\com\fasterxml\classmate\1.3.4\classmate-1.3.4.jar;F:\apache-maven-3.3.9\repository\org\springframework\spring-web\5.0.9.RELEASE\spring-web-5.0.9.RELEASE.jar;F:\apache-maven-3.3.9\repository\org\springframework\spring-beans\5.0.9.RELEASE\spring-beans-5.0.9.RELEASE.jar;F:\apache-maven-3.3.9\repository\org\springframework\spring-webmvc\5.0.9.RELEASE\spring-webmvc-5.0.9.RELEASE.jar;F:\apache-maven-3.3.9\repository\org\springframework\spring-aop\5.0.9.RELEASE\spring-aop-5.0.9.RELEASE.jar;F:\apache-maven-3.3.9\repository\org\springframework\spring-context\5.0.9.RELEASE\spring-context-5.0.9.RELEASE.jar;F:\apache-maven-3.3.9\repository\org\springframework\spring-expression\5.0.9.RELEASE\spring-expression-5.0.9.RELEASE.jar;F:\apache-maven-3.3.9\repository\org\springframework\boot\spring-boot-starter-logging\2.0.5.RELEASE\spring-boot-starter-logging-2.0.5.RELEASE.jar;F:\apache-maven-3.3.9\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;F:\apache-maven-3.3.9\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;F:\apache-maven-3.3.9\repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;F:\apache-maven-3.3.9\repository\org\apache\logging\log4j\log4j-to-slf4j\2.10.0\log4j-to-slf4j-2.10.0.jar;F:\apache-maven-3.3.9\repository\org\apache\logging\log4j\log4j-api\2.10.0\log4j-api-2.10.0.jar;F:\apache-maven-3.3.9\repository\org\slf4j\jul-to-slf4j\1.7.25\jul-to-slf4j-1.7.25.jar;F:\apache-maven-3.3.9\repository\org\springframework\spring-core\5.0.9.RELEASE\spring-core-5.0.9.RELEASE.jar;F:\apache-maven-3.3.9\repository\org\springframework\spring-jcl\5.0.9.RELEASE\spring-jcl-5.0.9.RELEASE.jar;F:\apache-maven-3.3.9\repository\log4j\log4j\1.2.14\log4j-1.2.14.jar;F:\apache-maven-3.3.9\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;F:\apache-maven-3.3.9\repository\org\apache\httpcomponents\httpclient\4.5.3\httpclient-4.5.3.jar;F:\apache-maven-3.3.9\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;F:\apache-maven-3.3.9\repository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar;F:\apache-maven-3.3.9\repository\org\apache\httpcomponents\httpcore\4.4.5\httpcore-4.4.5.jar;F:\apache-maven-3.3.9\repository\org\apache\httpcomponents\httpasyncclient\4.1.3\httpasyncclient-4.1.3.jar;F:\apache-maven-3.3.9\repository\org\apache\httpcomponents\httpcore-nio\4.4.6\httpcore-nio-4.4.6.jar;F:\apache-maven-3.3.9\repository\com\alibaba\fastjson\1.2.56\fastjson-1.2.56.jar;G:\idea_workspace\Sentinel-release-1.6\sentinel-extension\sentinel-datasource-extension\target\classes;F:\apache-maven-3.3.9\repository\com\google\guava\guava\19.0\guava-19.0.jar;F:\apache-maven-3.3.9\repository\com\fasterxml\jackson\core\jackson-core\2.9.8\jackson-core-2.9.8.jar;F:\apache-maven-3.3.9\repository\org\apache\curator\curator-recipes\4.0.1\curator-recipes-4.0.1.jar;F:\apache-maven-3.3.9\repository\org\apache\curator\curator-framework\4.0.1\curator-framework-4.0.1.jar;F:\apache-maven-3.3.9\repository\org\apache\curator\curator-client\4.0.1\curator-client-4.0.1.jar;F:\apache-maven-3.3.9\repository\org\apache\zookeeper\zookeeper\3.5.3-beta\zookeeper-3.5.3-beta.jar;F:\apache-maven-3.3.9\repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar;F:\apache-maven-3.3.9\repository\io\netty\netty\3.10.5.Final\netty-3.10.5.Final.jar;D:\IntelliJ IDEA 2018.1.3\lib\idea_rt.jar;C:\Users\Administrator\AppData\Local\Temp\capture2313jars\debugger-agent.jar
2019-10-20 23:21:50.663  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:java.library.path=C:\Program Files\Java\jdk1.8.0_151\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_151\bin;C:\Program Files\Java\jdk1.8.0_151\jre\bin;G:\mysql\mysql-5.7.23-winx64\bin;D:\Microsoft VS Code\bin;D:\node\;D:\scala-2.11.8\bin;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;F:\soft-data\node_global;;.
2019-10-20 23:21:50.663  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:java.io.tmpdir=C:\Users\Administrator\AppData\Local\Temp\
2019-10-20 23:21:50.664  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:java.compiler=<NA>
2019-10-20 23:21:50.664  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:os.name=Windows 10
2019-10-20 23:21:50.664  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:os.arch=amd64
2019-10-20 23:21:50.664  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:os.version=10.0
2019-10-20 23:21:50.664  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:user.name=Administrator
2019-10-20 23:21:50.664  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:user.home=C:\Users\Administrator
2019-10-20 23:21:50.664  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:user.dir=G:\idea_workspace\Sentinel-release-1.6
2019-10-20 23:21:50.665  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:os.memory.free=245MB
2019-10-20 23:21:50.665  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:os.memory.max=3620MB
2019-10-20 23:21:50.665  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Client environment:os.memory.total=322MB
2019-10-20 23:21:50.693  INFO 14748 --- [           main] o.a.c.f.imps.CuratorFrameworkImpl        : Starting
2019-10-20 23:21:50.701  INFO 14748 --- [           main] org.apache.zookeeper.ZooKeeper           : Initiating client connection, connectString=192.168.1.104:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionState@366d8b97
2019-10-20 23:21:50.707  INFO 14748 --- [           main] org.apache.zookeeper.ClientCnxnSocket    : jute.maxbuffer value is 4194304 Bytes
2019-10-20 23:21:50.718  INFO 14748 --- [168.1.104:2181)] org.apache.zookeeper.ClientCnxn          : Opening socket connection to server 192.168.1.104/192.168.1.104:2181. Will not attempt to authenticate using SASL (unknown error)
2019-10-20 23:21:50.720  INFO 14748 --- [168.1.104:2181)] org.apache.zookeeper.ClientCnxn          : Socket connection established, initiating session, client: /192.168.1.102:3439, server: 192.168.1.104/192.168.1.104:2181
2019-10-20 23:21:50.729  INFO 14748 --- [           main] o.a.c.f.imps.CuratorFrameworkImpl        : Default schema
2019-10-20 23:21:50.766  INFO 14748 --- [168.1.104:2181)] org.apache.zookeeper.ClientCnxn          : Session establishment complete on server 192.168.1.104/192.168.1.104:2181, sessionid = 0x100071367780004, negotiated timeout = 40000
2019-10-20 23:21:50.777  INFO 14748 --- [ain-EventThread] o.a.c.f.state.ConnectionStateManager     : State change: CONNECTED
2019-10-20 23:21:50.796  INFO 14748 --- [ain-EventThread] o.a.c.framework.imps.EnsembleTracker     : New config event received: {}

我连的是远程的zookeeper,为甚恶魔这里zookeeper还是读我本地的信息,

org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /sentinel_rule_config/order-app
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:115) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
	at org.apache.zookeeper.KeeperException.create(KeeperException.java:51) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
	at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:2019) ~[zookeeper-3.5.3-beta.jar:3.5.3-beta-8ce24f9e675cbefffb8f21a47e06b42864475a60]
	at org.apache.curator.framework.imps.GetDataBuilderImpl$4.call(GetDataBuilderImpl.java:327) ~[curator-framework-4.0.1.jar:4.0.1]
	at org.apache.curator.framework.imps.GetDataBuilderImpl$4.call(GetDataBuilderImpl.java:316) ~[curator-framework-4.0.1.jar:4.0.1]
	at org.apache.curator.connection.StandardConnectionHandlingPolicy.callWithRetry(StandardConnectionHandlingPolicy.java:64) ~[curator-client-4.0.1.jar:na]
	at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:100) ~[curator-client-4.0.1.jar:na]
	at org.apache.curator.framework.imps.GetDataBuilderImpl.pathInForeground(GetDataBuilderImpl.java:313) ~[curator-framework-4.0.1.jar:4.0.1]
	at org.apache.curator.framework.imps.GetDataBuilderImpl.forPath(GetDataBuilderImpl.java:304) ~[curator-framework-4.0.1.jar:4.0.1]

当我点流控规则时就报错了。。
我用telnet测试过 192.168.1.104 2181 是通的,不知道哪里出现了问题。。。

写回答

1回答

用银河口袋的露娜

提问者

2019-10-21

解决了


第一次点这里的新增的时候会报错的//img1.sycdn.imooc.com/szimg/5dac85eb089578d309070653.jpg

后面,按照老师的教程那样添加是没问题的,而且还给我zookeeper新增了/sentinel_rule_config目录

之后,我再做这个操作就没问题了


0
0

Spring Cloud微服务安全实战 可落地的安全方案

从API到复杂微服务场景,实战部署可落地的安全方案。

1029 学习 · 370 问题

查看课程