1、什么时Zookeeper

ZooKeeper:分布式服务框架 Zookeeper -- 管理分布式环境中的数据。

2、安装

1》官网下载压缩包并解压zookeeper-3.4.14.zip

2》在zookeeper-3.4.14的Home目录新建data、log文件夹

3》进入conf目录,复制其中的zoo_sample.cfg文件到同级目录,重命名为zoo.cfg(Zookeeper 在启动时会找这个文件作为默认配置文件)。修改其中的dataDir、dataLogDir

...
# example sakes.
dataDir=F:\\ebook\\Dubbo\\zookeeper-3.4.14\\data
dataLogDir=F:\\ebook\\Dubbo\\zookeeper-3.4.14\\log
# the port at which the clients will connect
...

3、启动测试

Microsoft Windows [版本 10.0.17763.737]
(c) Microsoft Corporation。保留所有权利。 F:\ebook\Dubbo\zookeeper-3.4.\bin>zkServer.cmd F:\ebook\Dubbo\zookeeper-3.4.\bin>call "C:\Program Files\Java\jdk1.8.0_65"\bin\java "-Dzookeeper.log.dir=F:\ebook\Dubbo\zookeeper-3.4.14\bin\.." "-Dzookeeper.root.logger=INFO,CONSOLE" -cp "F:\ebook\Dubbo\zookeeper-3.4.14\bin\..\build\classes;F:\ebook\Dubbo\zookeeper-3.4.14\bin\..\build\lib\*;F:\ebook\Dubbo\zookeeper-3.4.14\bin\..\*;F:\ebook\Dubbo\zookeeper-3.4.14\bin\..\lib\*;F:\ebook\Dubbo\zookeeper-3.4.14\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "F:\ebook\Dubbo\zookeeper-3.4.14\bin\..\conf\zoo.cfg"
-- ::, [myid:] - INFO [main:QuorumPeerConfig@] - Reading configuration from: F:\ebook\Dubbo\zookeeper-3.4.\bin\..\conf\zoo.cfg
-- ::, [myid:] - INFO [main:DatadirCleanupManager@] - autopurge.snapRetainCount set to
-- ::, [myid:] - INFO [main:DatadirCleanupManager@] - autopurge.purgeInterval set to
-- ::, [myid:] - INFO [main:DatadirCleanupManager@] - Purge task is not scheduled.
-- ::, [myid:] - WARN [main:QuorumPeerMain@] - Either no config or no quorum defined in config, running in standalone mode
-- ::, [myid:] - INFO [main:QuorumPeerConfig@] - Reading configuration from: F:\ebook\Dubbo\zookeeper-3.4.\bin\..\conf\zoo.cfg
-- ::, [myid:] - INFO [main:ZooKeeperServerMain@] - Starting server
-- ::, [myid:] - INFO [main:Environment@] - Server environment:zookeeper.version=3.4.-4c25d480e66aadd371de8bd2fd8da255ac140bcf, built on // : GMT
-- ::, [myid:] - INFO [main:Environment@] - Server environment:host.name=DESKTOP-V80IF6T
-- ::, [myid:] - INFO [main:Environment@] - Server environment:java.version=1.8.0_65
-- ::, [myid:] - INFO [main:Environment@] - Server environment:java.vendor=Oracle Corporation
-- ::, [myid:] - INFO [main:Environment@] - Server environment:java.home=C:\Program Files\Java\jdk1..0_65\jre
-- ::, [myid:] - INFO [main:Environment@] - Server environment:java.class.path=F:\ebook\Dubbo\zookeeper-3.4.\bin\..\build\classes;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\build\lib\*;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\zookeeper-3.4..jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\lib\audience-annotations-0.5..jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\lib\jline-0.9..jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\lib\log4j-1.2..jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\lib\netty-3.10..Final.jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\lib\slf4j-api-1.7..jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\lib\slf4j-log4j12-1.7..jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\conf
-- ::, [myid:] - INFO [main:Environment@] - Server environment:java.library.path=C:\Program Files\Java\jdk1..0_65\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.\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Program Files\Java\jdk1..0_65\bin;D:\fyliu\softwares\apache-maven-3.6.\bin;D:\fyliu\softwares\apache-ant-1.9.\bin;;.
-- ::, [myid:] - INFO [main:Environment@] - Server environment:java.io.tmpdir=C:\Users\lfy\AppData\Local\Temp\
-- ::, [myid:] - INFO [main:Environment@] - Server environment:java.compiler=<NA>
-- ::, [myid:] - INFO [main:Environment@] - Server environment:os.name=Windows
-- ::, [myid:] - INFO [main:Environment@] - Server environment:os.arch=amd64
-- ::, [myid:] - INFO [main:Environment@] - Server environment:os.version=10.0
-- ::, [myid:] - INFO [main:Environment@] - Server environment:user.name=lfy
-- ::, [myid:] - INFO [main:Environment@] - Server environment:user.home=C:\Users\lfy
-- ::, [myid:] - INFO [main:Environment@] - Server environment:user.dir=F:\ebook\Dubbo\zookeeper-3.4.\bin
-- ::, [myid:] - INFO [main:ZooKeeperServer@] - tickTime set to
-- ::, [myid:] - INFO [main:ZooKeeperServer@] - minSessionTimeout set to -
-- ::, [myid:] - INFO [main:ZooKeeperServer@] - maxSessionTimeout set to -
-- ::, [myid:] - INFO [main:ServerCnxnFactory@] - Using org.apache.zookeeper.server.NIOServerCnxnFactory as server connection factory
-- ::, [myid:] - INFO [main:NIOServerCnxnFactory@] - binding to port 0.0.0.0/0.0.0.0:
Microsoft Windows [版本 10.0.17763.737]
(c) Microsoft Corporation。保留所有权利。 C:\Users\lfy>jps -l -v
exit -Xms128m -Xmx1008m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB= -ea -XX:CICompilerCount= -Dsun.io.useCanonPrefixCache=false -Djava.net.preferIPv4Stack=true -Djdk.http.auth.tunneling.disabledSchemes="" -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Djdk.attach.allowAttachSelf -Dkotlinx.coroutines.debug=off -Djdk.module.illegalAccess.silent=true -Djb.vmOptionsFile=C:\Users\lfy\.IntelliJIdea2019.\config\idea64.exe.vmoptions -Djava.library.path=D:\fyliu\softwares\ideaIU-2019.2..win\jbr\\bin;D:\fyliu\softwares\ideaIU-2019.2..win\jbr\\bin\server -Didea.jre.check=true -Dide.native.launcher=true -Didea.paths.selector=IntelliJIdea2019. -XX:ErrorFile=C:\Users\lfy\java_error_in_idea_%p.log -XX:HeapDumpPath=C:\Users\lfy\java_error_in_idea.hprof
sun.tools.jps.Jps -Dapplication.home=C:\Program Files\Java\jdk1..0_65 -Xms8m
org.jetbrains.idea.maven.server.RemoteMavenServer36 -Djava.awt.headless=true -Dmaven.defaultProjectBuilder.disableGlobalModelCache=true -Xmx768m -Didea.maven.embedder.version=3.6. -Dmaven.ext.class.path=D:\fyliu\softwares\ideaIU-2019.2..win\plugins\maven\lib\maven-event-listener.jar -Dfile.encoding=GBK
org.apache.zookeeper.server.quorum.QuorumPeerMain -Dzookeeper.log.dir=F:\ebook\Dubbo\zookeeper-3.4.\bin\.. -Dzookeeper.root.logger=INFO,CONSOLE C:\Users\lfy>

启动客户端连接。

Microsoft Windows [版本 10.0.17763.737]
(c) Microsoft Corporation。保留所有权利。 F:\ebook\Dubbo\zookeeper-3.4.\bin>zkCli.cmd
Connecting to localhost:
-- ::, [myid:] - INFO [main:Environment@] - Client environment:zookeeper.version=3.4.-4c25d480e66aadd371de8bd2fd8da255ac140bcf, built on // : GMT
-- ::, [myid:] - INFO [main:Environment@] - Client environment:host.name=DESKTOP-V80IF6T
-- ::, [myid:] - INFO [main:Environment@] - Client environment:java.version=1.8.0_65
-- ::, [myid:] - INFO [main:Environment@] - Client environment:java.vendor=Oracle Corporation
-- ::, [myid:] - INFO [main:Environment@] - Client environment:java.home=C:\Program Files\Java\jdk1..0_65\jre
-- ::, [myid:] - INFO [main:Environment@] - Client environment:java.class.path=F:\ebook\Dubbo\zookeeper-3.4.\bin\..\build\classes;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\build\lib\*;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\zookeeper-3.4..jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\lib\audience-annotations-0.5..jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\lib\jline-0.9..jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\lib\log4j-1.2..jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\lib\netty-3.10..Final.jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\lib\slf4j-api-1.7..jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\lib\slf4j-log4j12-1.7..jar;F:\ebook\Dubbo\zookeeper-3.4.\bin\..\conf
-- ::, [myid:] - INFO [main:Environment@] - Client environment:java.library.path=C:\Program Files\Java\jdk1..0_65\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.\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Program Files\Java\jdk1..0_65\bin;D:\fyliu\softwares\apache-maven-3.6.\bin;D:\fyliu\softwares\apache-ant-1.9.\bin;;.
-- ::, [myid:] - INFO [main:Environment@] - Client environment:java.io.tmpdir=C:\Users\lfy\AppData\Local\Temp\
-- ::, [myid:] - INFO [main:Environment@] - Client environment:java.compiler=<NA>
-- ::, [myid:] - INFO [main:Environment@] - Client environment:os.name=Windows
-- ::, [myid:] - INFO [main:Environment@] - Client environment:os.arch=amd64
-- ::, [myid:] - INFO [main:Environment@] - Client environment:os.version=10.0
-- ::, [myid:] - INFO [main:Environment@] - Client environment:user.name=lfy
-- ::, [myid:] - INFO [main:Environment@] - Client environment:user.home=C:\Users\lfy
-- ::, [myid:] - INFO [main:Environment@] - Client environment:user.dir=F:\ebook\Dubbo\zookeeper-3.4.\bin
-- ::, [myid:] - INFO [main:ZooKeeper@] - Initiating client connection, connectString=localhost: sessionTimeout= watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@531d72ca
Welcome to ZooKeeper!
-- ::, [myid:] - INFO [main-SendThread(localhost:):ClientCnxn$SendThread@] - Opening socket connection to server localhost/::::::::. Will not attempt to authenticate using SASL (unknown error)
-- ::, [myid:] - INFO [main-SendThread(localhost:):ClientCnxn$SendThread@] - Socket connection established to localhost/::::::::, initiating session
JLine support is enabled
[zk: localhost:(CONNECTING) ]

Zookeeper - zookeeper安装与配置的更多相关文章

  1. ZooKeeper的安装、配置、启动和使用(一)——单机模式

    ZooKeeper的安装.配置.启动和使用(一)——单机模式 ZooKeeper的安装非常简单,它的工作模式分为单机模式.集群模式和伪集群模式,本博客旨在总结ZooKeeper单机模式下如何安装.配置 ...

  2. ZooKeeper 的安装和配置---单机和集群

    如题本文介绍的是ZooKeeper 的安装和配置过程,此过程非常简单,关键是如何应用(将放在下节及相关节中介绍). 单机安装.配置: 安装非常简单,只要获取到 Zookeeper 的压缩包并解压到某个 ...

  3. Zookeeper的安装的配置

    详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcyt192 安装和配置详解 本文介绍的 Zookeeper 是以 3.2.2 这个 ...

  4. 初识zookeeper(1)之zookeeper的安装及配置

    初识zookeeper(一)之zookeeper的安装及配置 1.简要介绍 zookeeper是一个分布式的应用程序协调服务,是Hadoop和Hbase的重要组件,是一个树型的目录服务,支持变更推送. ...

  5. 浅谈 zookeeper 原理,安装和配置

    当前云计算流行, 单一机器额的处理能力已经不能满足我们的需求,不得不采用大量的服务集群.服务集群对外提供服务的过程中,有很多的配置需要随时更新,服务间需要协调工作,那么这些信息如何推送到各个节点?并且 ...

  6. Zookeeper的安装与配置、使用

    Dubbo的介绍 如果表现层和服务层是不同的工程,然而表现层又要调用服务层的服务,肯定不能像之前那样,表现层和服务层在一个项目时,只需把服务层的Java类注入到表现层所需要的类中即可,但现在,表现层和 ...

  7. zookeeper之一 安装和配置(单机+集群)

    这里我以zookeeper3.4.10.tar.gz来演示安装,安装到/usr/local/soft目录下. 一.单机版配置 1.安装和配置 #.下载 wget http://apache.fayea ...

  8. ZooKeeper 单机版安装和配置

    Zookeeper 下载链接:http://mirrors.shu.edu.cn/apache/zookeeper/ #wget https://mirrors.tuna.tsinghua.edu.c ...

  9. 初识zookeeper(一)之zookeeper的安装及配置

    1.简要介绍 zookeeper是一个分布式的应用程序协调服务,是Hadoop和Hbase的重要组件,是一个树型的目录服务,支持变更推送.除此还可以用作dubbo服务的注册中心. 2.安装 2.1 下 ...

  10. zookeeper的安装与配置

    本文将通过三个zookeeper的节点去配置 1.首先去官网下载zookeeper的包 zookeeper-3.4.10.tar.gz 2.用FTP文上传到/usr/local下 3.解压文件tar ...

随机推荐

  1. DOM 修改与DOM元素

    ㈠HTML DOM - 修改 修改 HTML = 改变元素.属性.样式和事件.   ①创建 HTML 内容 改变元素内容的最简单的方法是使用 innerHTML 属性. 下面的例子改变一个 <p ...

  2. poj 2187 Beauty Contest 凸包模板+求最远点对

    题目链接 题意:给你n个点的坐标,n<=50000,求最远点对 #include <iostream> #include <cstdio> #include <cs ...

  3. ZooKeeper 简介说明

    1.什么是Zookeeper? Zookeeper是一个高效的分布式协调服务,它暴露了一些公用服务,比如命名/配置管理/同步控制/群组服务等.我们可以使用Zookeeper来实现比如达成共识/集群管理 ...

  4. MySql中根据一列状态值查询状态的个数

    最近搞报表的项目,要写数据库sql语句,根据状态值查询状态的个数,这个开始难为到我了,不过已经有解决办法了. 在数据库表中有一个字段是状态(zt),这里面有1-7这7个状态,现在查询每个状态的数量,并 ...

  5. Struts2拦截器和过滤器的区别?

    ①过滤器依赖于Servlet容器,而拦截器不依赖于Servlet容器. ②Struts2 拦截器只能对Action请求起作用,而过滤器则可以对几乎所 有请求起作用. ③拦截器可以访问 Action上下 ...

  6. 【学习】windows 下PostgreSQL导入sql文件

    在软件的安装目录的bin文件下打开命令行工具 输入: psql -d 数据库名称 -h 数据库地址 -p  5432  -U  postgres  -f  sql文件(E:\Config\SQL\iS ...

  7. Android Context介绍

    转载(Android Context完全解析与各种获取Context方法):https://www.cnblogs.com/chenxibobo/p/6136693.html

  8. forms authentication原理

    细说ASP.NET Forms身份认证 asp.net 登陆验证 Form表单验证的3种方式 Understanding and Implementing ASP.NET Custom Forms A ...

  9. MSTest/NUnit 单元测试 代码覆盖率试用 OpenCover 和ReportGenerator

    VS自带是单元测试代码覆盖率(VS自带这个是最佳选择)需要企业版才有.很蛋疼...... 1.下载安装OpenCover 和ReportGenerator. 关于这2个是干啥的百度下.简单说就是可以分 ...

  10. leetcode23 合并k个排序链表

    /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode ...