当前位置: 首页 > news >正文

Zookeeper 启动闪退

常见的大概这两种情况

1.找不到zoo.cfg文件

在下载zookeeper后,在 %zookeeper安装目录%/conf 目录下有一个zoo.sample.cfg 文件,把 zoo.sample.cfg 文件改名为 zoo.cfg 再重启zkServer.cmd

@echo off
REM Licensed to the Apache Software Foundation (ASF) under one or more
REM contributor license agreements.  See the NOTICE file distributed with
REM this work for additional information regarding copyright ownership.
REM The ASF licenses this file to You under the Apache License, Version 2.0
REM (the "License"); you may not use this file except in compliance with
REM the License.  You may obtain a copy of the License at
REM
REM     http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.setlocal
call "%~dp0zkEnv.cmd"set ZOOMAIN=org.apache.zookeeper.server.quorum.QuorumPeerMain
echo on
call %JAVA% "-Dzookeeper.log.dir=%ZOO_LOG_DIR%" "-Dzookeeper.root.logger=%ZOO_LOG4J_PROP%" -cp "%CLASSPATH%" %ZOOMAIN% "%ZOOCFG%" %*
pause # 在该位置加上这个pause
endlocal

2. JAVA_HOME 没有配置,或者配置出错

zookeeper是一个java进程依赖于jdk,可以查看一下 %zk安装目录%/bin/zkEnv.cmd文件。

@echo off
REM Licensed to the Apache Software Foundation (ASF) under one or more
REM contributor license agreements.  See the NOTICE file distributed with
REM this work for additional information regarding copyright ownership.
REM The ASF licenses this file to You under the Apache License, Version 2.0
REM (the "License"); you may not use this file except in compliance with
REM the License.  You may obtain a copy of the License at
REM
REM     http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.set ZOOCFGDIR=%~dp0%..\conf
set ZOO_LOG_DIR=%~dp0%..
set ZOO_LOG4J_PROP=INFO,CONSOLEREM for sanity sake assume Java 1.6
REM see: http://java.sun.com/javase/6/docs/technotes/tools/windows/java.htmlREM add the zoocfg dir to classpath
set CLASSPATH=%ZOOCFGDIR%REM make it work in the release
SET CLASSPATH=%~dp0..\*;%~dp0..\lib\*;%CLASSPATH%REM make it work for developers
SET CLASSPATH=%~dp0..\build\classes;%~dp0..\build\lib\*;%CLASSPATH%
#这个地方就是配置启动zk找到的配置文件,默认去conf下的zoo.cfg文件
set ZOOCFG=%ZOOCFGDIR%\zoo.cfg@REM setup java environment variablesif not defined JAVA_HOME (echo Error: JAVA_HOME is not set.goto :eof
)set JAVA_HOME=%JAVA_HOME:"=%if not exist "%JAVA_HOME%"\bin\java.exe (echo Error: JAVA_HOME is incorrectly set.goto :eof
)set JAVA="%JAVA_HOME%"\bin\java
# 找到环境变量,看看有没有配置这个"JAVA_HOME"环境变量,
# 注意这个值中的目录文件,在系统的环境变量中结尾不要有\
http://www.lryc.cn/news/128123.html

相关文章:

  • jenkins 安装nodejs 14
  • K8S核心组件etcd详解(上)
  • STM32存储左右互搏 I2C总线FATS读写EEPROM ZD24C1MA
  • 微服务—远程调用(RestTemplate)
  • Fine tune简介
  • centos nginx配置ipv4和ipv6的地址都可以访问同一个网站
  • 高教杯数学建模2020C题总结
  • Swagger
  • Android 13像Settings一样获取热点和网络共享
  • 操作系统搭建相关知识
  • 【校招VIP】前端校招考点之vue底层特性
  • vue3+vite配置vantUI主题
  • C++基础语法——继承
  • vim配置之spf13-vim
  • Azure如何启用网络观察应用程序
  • 分步注册方式 编写驱动
  • repmgr出现双主,并且时间线分叉,删除了最新的时间线节点
  • ThinkPHP中实现IP地址定位
  • 使用Python批量将Word文件转为PDF文件
  • XDR解决方案成为了新的安全趋势
  • 001-Nacos 服务注册
  • 71 # 协商缓存的配置:通过内容
  • 【服务器】Strace显示后台进程输出
  • centos如何安装libssl-dev libsdl-dev libavcodec-dev libavutil-dev ffmpeg
  • 2022年12月 C/C++(二级)真题解析#中国电子学会#全国青少年软件编程等级考试
  • 详谈MongoDB的那些事
  • 企业电子招投标采购系统源码之电子招投标的组成 tbms
  • Android 13 添加自定义分区,恢复出厂设置不被清除
  • 改进YOLO系列:1.添加SE注意力机制
  • RP2040开发板自制树莓派逻辑分析仪