Zookeeper简介和安装(二)
一、简介:
Zookeeper是一个分布式协调服务,提供的服务如下:
命名服务:类似于DNS,但仅对于节点
配置管理:服务配置信息的管理
集群管理:Dubbo使用Zookeeper实现服务治理
分布式锁:选举一个leader,这样某一时刻只有一个服务在干活,当leader出问题时释放锁,立即切到另一个服务
二、下载:
链接:https://pan.baidu.com/s/1ba8eYSxqnR1MdCxvQqWMTA 密码:ie5r
三、三种安装模式:
单机、真分布集群模式、伪分布集群模式
四、伪分布式集群搭建:
1、进入C:\zookeeper-3.3.6\conf目录,将zoo_sample.cfg拷贝成3份,分别为:zoo1.cfg、zoo2.cfg、zoo3.cfg
zoo1.cfg内容:
#心跳时间
tickTime=
#初始连接能容忍最多心跳次数
initLimit=
#leader与follower之间的通信时长
syncLimit=
#保存数据的目录
dataDir=C:/zookeeper/zk1
#zk监听端口号
clientPort=
#
server.=master::
server.=slave1::
server.=slave2::
zoo2.cfg内容:
# The number of milliseconds of each tick
tickTime=
# The number of ticks that the initial
# synchronization phase can take
initLimit=
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=
# the directory where the snapshot is stored.
dataDir=C:/zookeeper/zk2/
# the port at which the clients will connect
clientPort= server.=master::
server.=slave1::
server.=slave2::
zoo3.cfg内容:
# The number of milliseconds of each tick
tickTime=
# The number of ticks that the initial
# synchronization phase can take
initLimit=
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=
# the directory where the snapshot is stored.
dataDir=C:/zookeeper/zk3/
# the port at which the clients will connect
clientPort= server.=master::
server.=slave1::
server.=slave2::
2、hosts配置
127.0.0.1 master
127.0.0.1 slave1
127.0.0.1 slave2
3、zk保存数据的目录,zk1目录新建myid的文件,内容为1,zk2目录新建myid的文件,内容为2,以此类推
4、进入C:\zookeeper-3.3.6\bin目录,将zkServer.cmd拷贝成3份,分别为:zkServer-1.cmd、zkServer-2.cmd、zkServer-3.cmd
zkServer-1.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
set ZOOCFG=..\conf\zoo1.cfg echo on
java "-Dzookeeper.log.dir=%ZOO_LOG_DIR%" "-Dzookeeper.root.logger=%ZOO_LOG4J_PROP%" -cp "%CLASSPATH%" %ZOOMAIN% "%ZOOCFG%" %* endlocal
zkServer-2.cmd和zkServer-3.cmd只是set ZOOCFG指定的cfg文件不一样
5、启动zkServer-1.cmd、zkServer-2.cmd、zkServer-3.cmd
Zookeeper简介和安装(二)的更多相关文章
- Zookeeper简介与安装
Zookeeper:A Distributed Coordination Service for Distributed Applications. 一.Zookeeper简介 众所周知,协同服务是分 ...
- Zookeeper简介及安装(一)
1 Zookeeper入门1.1 概述Zookeeper是一个开源的分布式的,为分布式应用提供协调服务的Apache项目. 1.2 特点 1.3 数据结构 1.4 应用场景提供的服务包括:统一命名服务 ...
- Zookeeper简介和安装(四)
一.简介: Zookeeper是一个分布式协调服务,提供的服务如下: 命名服务:类似于DNS,但仅对于节点 配置管理:服务配置信息的管理 集群管理:Dubbo使用Zookeeper实现服务治理 分布式 ...
- Apache Kafka简介与安装(二)
Kafka在Windows环境上安装与运行 简介 Apache kafka 是一个分布式的基于push-subscribe的消息系统,它具备快速.可扩展.可持久化的特点.它现在是Apache旗下的一个 ...
- zookeeper:一.zookeeper集群安装
1.zookeeper简介2.安装zookeeper2.1 安装环境准备2.2 安装zookeeper2.2.1.解压zookeeper压缩包到/opt/zookeeper2.2.2.编辑zookee ...
- Zookeeper简介及使用
一.Zookeeper简介 1.zookeeper简介 动物管理员 Apache ZooKeeper致力于开发和维护开源服务器,实现高度可靠的分布式协调. 2.什么是ZooKeeper? ZooKee ...
- 细细品味Storm_Storm简介及安装
Storm是由专业数据分析公司BackType开发的一个分布式实时数据处理软件,可以简单.高效.可靠地处理大量的数据流.Twitter在2011年7月收购该公司,并于2011年9月底正式将Storm项 ...
- VMware vSphere 5.1 简介与安装
虚拟化系列-VMware vSphere 5.1 简介与安装 标签: 虚拟化 esxi5.1 VMware vSphere 5.1 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 . ...
- Nutch搜索引擎(第2期)_ Solr简介及安装
1.Solr简介 Solr是一个高性能,采用Java5开发,基于Lucene的全文搜索服务器.同时对其进行了扩展,提供了比Lucene更为丰富的查询语言,同时实现了可配置.可扩展并对查询性能进行了优化 ...
随机推荐
- Android数据库框架——ORMLite轻量级的对象关系映射(ORM)Java包
Android数据库框架--ORMLite轻量级的对象关系映射(ORM)Java包 事实上,我想写数据库的念头已经很久了,在之前写了一个答题系统的小项目那只是初步的带了一下数据库,数据库是比较强大的, ...
- JSP标签JSTL(4)--URL
<c:url>标签作用是将一个URL地址格式化为一个字符串,并且保存在一个变量当中.它具有URL自动重写功能.value指定的URL可以是当前工程的一个URL地址,也可以是其他web工程的 ...
- 四大组件之Activity小结
一大波面试就要靠近,赶紧总结总结一些基础问题 1.Activity的概念 是Android应用层开发的四大组件之一,主要负责和用户交互部分,有自己的生命周期,在其上可以布置按钮,文本框等各种控件,简单 ...
- TCP的ACK确认系列 — 延迟确认
主要内容:TCP的延迟确认.延迟确认定时器的实现. 内核版本:3.15.2 我的博客:http://blog.csdn.net/zhangskd 延迟确认模式 发送方在发送数据包时,如果发送的数据包有 ...
- 海量数据挖掘MMDS week3:流算法Stream Algorithms
http://blog.csdn.net/pipisorry/article/details/49183379 海量数据挖掘Mining Massive Datasets(MMDs) -Jure Le ...
- C语言的引用计数与对象树
引用计数与对象树 cheungmine 2013-12-28 0 引言 我们经常在C语言中,用指针指向一个对象(Object)的结构,也称为句柄(Handle),利用不透明指针的技术把结构数据封装成对 ...
- Dynamics CRM 2011/2013 DeveloperToolkit的使用
Dynamic CRM 2011的SDK中提供了一个叫DeveloperToolkit的工具,他的用途官方说明说的很明确,能方便开发者在VS中直接部署webresource.plugin.workfl ...
- Swift基础之UITableView(之前写的知识点都是最新的2.2版本样式,欢迎大家参考,可以相互交流)
//这里只是列举了经常使用的UITableView的属性和方法,其他的都可以类似使用,注意用法即可 //设置全局变量UITableView var myTableView = UITa ...
- 对嵌入式开发C语言结构体的一点总结
今天冬至居然不上班,公司的良心啊!这回有心情写博客和日志了,好了,废话不多说.直接看下文: 鉴于嵌入式开发过程中,C语言结构体的使用当然是必不可少.话说,基础什么的比你会更牛逼的算法更重要,基础不牢, ...
- AngularJS进阶(一)深入理解ANGULARUI路由_UI-ROUTER
深入理解ANGULARUI路由_UI-ROUTER 最近在用 ionic写个webapp 看到几个demo中路由有好几种,搞的有点晕,查下资料研究下,做个笔记,其中大部分为摘抄别人的,做个说明免得被人 ...