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. k8s配置文件模板

    一,deployment Deployment为Pod和Replica Set下一代Replication Controller)提供声明式更新 1,配置示例 apiVersion: apps/v1 ...

  2. CentOS7.2 安装 PHP7.2

    安装源 安装 EPEL 软件包: $ sudo yum install epel-release 安装 remi 源: $ sudo yum install http://rpms.remirepo. ...

  3. linux 文件目录介绍

    网上的资源 太多了,copy 过来 留给自己用吧! 摘自 : http:/ 使用linux也有一年多时间了  最近也是一直在维护网站系统主机  下面是linux目录结构说明 本人使用的是centos系 ...

  4. QBXTD2上午

    话说lyd昨天没讲完他的该死的贪心,所以今天继续讲 贪心思想是考虑AB是最快的人,CD是最慢的人,要把CD两个人送过河,只有两种方案,牵扯到四个人,并且n个规模的原问题化成了n-2个规模的子问题 那么 ...

  5. 状压dfs小记

    一点前(tu)言(cao) 真的考起dfs来可谓是什么都能往dfs上套 状压不止能dp,还能与dfs结合成为搜索好(duliu)题 剪枝卡常司空见惯(打开题解一看并不是纯dfs,emmmm) 开始正文 ...

  6. 阶段3 2.Spring_03.Spring的 IOC 和 DI_9 spring的依赖注入

    新建工程 改成jar包 加入spring的依赖 复制之前的工程代码 再复制配置文件 fac factory整个删除 构造函数也删除.删除后的代码.如下 配置文件中的注释都删除掉 spring中的依赖注 ...

  7. 慕课网_细说多线程之Thread VS Runnable

    第1章 课前准备 1-1 前言 (00:49) 第2章 Thread VS Runnable 2-1 回顾线程创建的两种方式 (02:33) 继承Thread类 class MyThread exte ...

  8. 使用ssh-agent管理私钥

    使用ssh-agent的好处: 如果有多台远程服务器与多个私钥文件,ssh-gent将会尝试使用不同的私钥文件建立连接,直至成功 假如有 A.B.C 三台服务器,A是控制节点,A可以直接登录B,但是无 ...

  9. VBA删除空白行列

    '删除空行 Sub DeleteEmptyRows() Dim LastRow As Long, r As Long LastRow = ActiveSheet.UsedRange.Rows.Coun ...

  10. java:Hibernate框架4(延迟加载(lazy),抓取(fetch),一级缓存,get,load,list,iterate,clear,evict,flush,二级缓存,注解,乐观锁和悲观锁,两者的比较)

    1.延时加载和抓取: hibernate.cfg.xml: <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-co ...