Windows 系统下载安装 ZooKeeper
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Windows 系统下载安装 ZooKeeper,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2885字,纯文字阅读大概需要5分钟。
内容图文
Windows 系统下载安装 ZooKeeper
这里演示 Apache ZooKeeper 3.4.14 版本的下载与安装
1. 进入官网下载 ZooKeeper
ZooKeeper 官网地址: https://zookeeper.apache.org/
点击上面官网链接进入官网
跳转页面后,点击下载
2. Zookeeper 安装
-
下载完后直接解压,解压后目录如下:
-
创建一个 data 文件夹和 log 文件夹
-
进入 config 文件夹,将 zoo_sample.cfg 复制一份,并重命名 zoo.cfg
-
修改 zoo.cfg 内的配置信息
dataDir 和 dataLogDir 根据自己的真实路径填写。就是我们刚刚创建的 data 和 log 文件夹的位置
# 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=D:\\Code\\tool\\java\\zookeeper-3.4.14\\zookeeper-3.4.14\\data dataLogDir=D:\\Code\\tool\\java\\zookeeper-3.4.14\\zookeeper-3.4.14\\log # 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
3. 运行 ZooKeeper
-
进入 bin 目录,启动 zkServer.cmd
如果闪退的话,就代表启动失败,可能是我们刚刚配置错误了。
编辑 zkServer.cmd 文件,增加 @pause 让它报错时停下来,然后根据报错百度查询解决方案。
java.io.IOException: Unable to create data directory XXX 代表是文件路径错误了,检查 dataDir 和 dataLogDir 的路径
@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 endlocal
-
运行成功
内容总结
以上是互联网集市为您收集整理的Windows 系统下载安装 ZooKeeper全部内容,希望文章能够帮你解决Windows 系统下载安装 ZooKeeper所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。