赞
踩









- 使用这个下载地址的版本,可以避免错误三的情况!

zkService .cmd,会出现以下问题
问题一:
错误:找不到或无法加载主类 org.apache.zookeeper.server.quorum.QuorumPeerMain
问题二:
ERROR [main:o.a.z.s.q.QuorumPeerMain@99]
- Invalid config, exiting abnormally org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException:
Error processing C:\environment\apache-zookeeper-3.8.0-bin\apache-zookeeper-3.8.0-bin\bin\..\conf\zoo.cfg
问题三:
ZooKeeper audit is disabled
pause命令,查看详细的错误信息 
C:\environment\apache-zookeeper-3.7.1\apache-zookeeper-3.7.1\bin>call
"C:\Program Files\Java\jdk1.8.0_131"\bin\java
"-Dzookeeper.log.dir=C:\environment\apache-zookeeper-3.7.1\apache-zookeeper-3.7.1\bin\..\logs"
"-Dzookeeper.root.logger=INFO,CONSOLE"
"-Dzookeeper.log.file=zookeeper-HP-server-DESKTOP-OGQJ662.log"
"-XX:+HeapDumpOnOutOfMemoryError"
"-XX:OnOutOfMemoryError=cmd /c taskkill /pid %%p /t /f" -cp
"C:\environment\apache-zookeeper-3.7.1\apache-zookeeper-3.7.1\bin\..\build\classes;
C:\environment\apache-zookeeper-3.7.1\apache-zookeeper-3.7.1\bin\..\build\lib\*;
C:\environment\apache-zookeeper-3.7.1\apache-zookeeper-3.7.1\bin\..\*;
C:\environment\apache-zookeeper-3.7.1\apache-zookeeper-3.7.1\bin\..\lib\*;
C:\environment\apache-zookeeper-3.7.1\apache-zookeeper-3.7.1\bin\..\conf"
org.apache.zookeeper.server.quorum.QuorumPeerMain
"C:\environment\apache-zookeeper-3.7.1\apache-zookeeper-3.7.1\bin\..\conf\zoo.cfg"
错误: 找不到或无法加载主类 org.apache.zookeeper.server.quorum.QuorumPeerMain
- 注:zookeeper 3.5 版本以后,命名就发生了改变,如 apache-zookeeper-3.8.0.tar.gz 这般命名的,都是未编译的,而 apache-zookeeper-3.8.0-bin.tar.gz 这般命名的,才是已编译的包。
2023-01-29 17:02:21,637 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@177]
- Reading configuration from: C:\environment\apache-zookeeper-3.8.0-bin\apache-zookeeper-3.8.0-bin\bin\..\conf\zoo.cfg
2023-01-29 17:02:21,640 [myid:] - ERROR [main:o.a.z.s.q.QuorumPeerMain@99]
- Invalid config, exiting abnormally org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException:
Error processing C:\environment\apache-zookeeper-3.8.0-bin\apache-zookeeper-3.8.0-bin\bin\..\conf\zoo.cfg
conf文件夹下的zoo.cfg文件zoo_saple.cfg文件复制一份,重命名为zoo.cfgzoo.cfg可以看到Zookeeper默认的端口号为:2181# The number of milliseconds of each tick tickTime=2000 # The number of ticks that the initial # synchronization phase can take initLimit=10 # The number of ticks that can pass between # sending a request and getting an acknowledgement syncLimit=5 # the directory where the snapshot is stored. # do not use /tmp for storage, /tmp here is just # example sakes. dataDir=/tmp/zookeeper # the port at which the clients will connect clientPort=2181 # the maximum number of client connections. # increase this if you need to handle more clients #maxClientCnxns=60 # # Be sure to read the maintenance section of the # administrator guide before turning on autopurge. # # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance # # The number of snapshots to retain in dataDir #autopurge.snapRetainCount=3 # Purge task interval in hours # Set to "0" to disable auto purge feature #autopurge.purgeInterval=1 ## Metrics Providers # # https://prometheus.io Metrics Exporter #metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider #metricsProvider.httpPort=7000 #metricsProvider.exportJvmInfo=true
- 注意
- dataDir=./ 临时数据存储的目录(可写相对路径)
- clientPort=2181 zookeeper的端口号
zkService.cmd又又又遇到了错误!2023-01-29 17:11:11,775 [myid:] - INFO [main:o.a.z.a.ZKAuditProvider@42] - ZooKeeper audit is disabled.
zookeeper新增的审核日志是默认关闭,所以控制台输出ZooKeeper audit is disabled。zookeeper的配置文件zoo.cfg新增一行audit.enable=true即可
zkService.cmd文件中的pause命令删除zkService.cmd服务端,在最后看到下面的信息,表明运行成功![myid:] - INFO [main:o.a.z.a.Slf4jAuditLogger@35] - user=HP operation=serverStart result=success
zkCli.cmd客户端[myid:] - INFO [SyncThread:0:o.a.z.s.p.FileTxnLog@285] - Creating new log file: log.1
WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0]
ls /:列出zookeeper根下保存的所有节点
create –e /yang 123:创建一个/yang节点,值为666
get /yang:获取/yang节点的值
选择使用稳定版本master版本

遇到问题:按照提示操作即可
node-v9.11.1-win-x64.zip下载下来,然后修改为node-9.11.1-win-x64.zip放到相应的目录下[INFO] Downloading https://nodejs.org/dist/v9.11.1/node-v9.11.1-win-x64.zip to
C:\environment\apache-maven-3.6.3\maven-repo\com\github\eirslett\node\9.11.1\node-9.11.1-win-x64.zip
然后重新运行命令mvn clean package -Dmaven.test.skip=true进行打包!

生成的jar包在dubbo-admin-master\dubbo-admin-distribution\target目录下
执行jar包java -jar dubbo-admin-0.5.0.jar

未开启Zookeeper,所以会出现错误
java.lang.IllegalStateException: java.lang.IllegalStateException: zookeeper not connected
at org.apache.dubbo.config.deploy.DefaultApplicationDeployer.prepareEnvironment(DefaultApplicationDeployer.java:678)
at org.apache.dubbo.config.deploy.DefaultApplicationDeployer.startConfigCenter(DefaultApplicationDeployer.java:261)
at org.apache.dubbo.config.deploy.DefaultApplicationDeployer.initialize(DefaultApplicationDeployer.java:185)
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.prepare(DefaultModuleDeployer.java:470)
at org.apache.dubbo.config.spring.context.DubboConfigApplicationListener.initDubboConfigBeans
(DubboConfigApplicationListener.java:71)
master-0.2.0版本
dubbo-admin\src\main\resources \application.properties 中可指定zookeeper地址server.port=7001
spring.velocity.cache=false
spring.velocity.charset=UTF-8
spring.velocity.layout-url=/templates/default.vm
spring.messages.fallback-to-system-locale=false
spring.messages.basename=i18n/message
spring.root.password=root
spring.guest.password=guest
dubbo.registry.address=zookeeper://127.0.0.1:2181
dubbo-admin目录下,使用管理员身份运行命令mvn clean package -Dmaven.test.skip=true进行打包
dubbo-admin-master-0.2.0\dubbo-admin\target目录下,可以看到生成的jar包dubbo-admin-master-0.2.0\dubbo-admin\target目录下,执行命令java -jar dubbo-admin-0.0.1-SNAPSHOT.jarhttp://localhost:7001/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。