今天我来写一写zookeeper集群的搭建流程

1.zookeeper的搭建不难,难的是对他的理解以及良好的使用.单机版的zookeeper只需要解压后直接命令 启动即可 解压zookeeper,tar -zxvf zookeeper-3.4.6.tar.g

2.集群的话,需要复制文件 把单机版的zookeeper-3.4.6拷贝到/usr/local/solrcloud下,复制三份分别并将目录名改为zookeeper1、zookeeper2、zookeeper3

3.进入zookeeper1文件夹,创建data目录。并在data目录中创建一个myid文件内容为“1”(echo 1 >> data/myid)。

4.进入conf文件夹,把zoo_sample.cfg改名为zoo.cfg

5.修改zoo.cfg。 修改: dataDir=/usr/local/solrcloud/zookeeper1/data clientPort=2181(zookeeper2中为2182、zookeeper3中为2183) 添加: server.1=192.168.25.150:2881:3881 server.2=192.168.25.150:2882:3882 server.3=192.168.25.150:2883:3883

6.接下来把剩下的两个全部按照这个方式来修改 注意:第二个的端口号和路径要改,而添加的server不变 后面端口依次改为2182和2183

# 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=/usr/local/solrcloud/zookeeper1/data

# 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.htm

l#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

server.1=192.168.25.150:2881:3881

server.2=192.168.25.150:2882:3882

server.3=192.168.25.150:2883:3883

7.修改完成后分别启动三个zookeeper /usr/local/solrcloud/zookeeper1/bin/zkServer.sh start /usr/local/solrcloud/zookeeper2/bin/zkServer.sh start

/usr/local/solrcloud/zookeeper3/bin/zkServer.sh start

8.查看zookeeper的状态 /usr/local/solrcloud/zookeeper1/bin/zkServer.sh status /usr/local/solrcloud/zookeeper2/bin/zkServer.sh status /usr/local/solrcloud/zookeeper3/bin/zkServer.sh status

9.最后记得添加端口号,或者关闭防火墙

zookeeper以及集群的搭建的更多相关文章

  1. ZooKeeper伪集群环境搭建

    1.从官网下载程序包. 2.解压. [dev@localhost software]$ tar xzvf zookeeper-3.4.6.tar.gz 3.进入zookeeper文件夹后创建data文 ...

  2. Zookeeper服务器集群的搭建与操作

    ZooKeeper 作用:Zookeeper 可以用来保证数据在zk集群之间的数据的事务性一致(原子操作). 介绍:Zookeeper 是 Google 的 Chubby一个开源的实现,是 Hadoo ...

  3. zookeeper伪集群的搭建

    由于公司服务器数量的限制,我们往往没有那么多的服务器用来搭建zookeeper的集群,所以产生了伪集群的搭建,也就是将多个zookeeper搭建在同一台机器上. 准备工作: 1,一台服务器,我们这里用 ...

  4. 【Zookeeper】集群环境搭建

    一.概述 1.1 Zookeeper的角色 1.2 Zookeeper的读写机制 1.3 Zookeeper的保证 1.4 Zookeeper节点数据操作流程 二.Zookeeper 集群环境搭建 2 ...

  5. zookeeper 单机. 集群环境搭建

    zookeeper分布式系统中面临的很多问题, 如分布式锁,统一的命名服务,配置中心,集群的管理Leader的选举等 环境准备 分布式系统中各个节点之间通信,Zookeeper保证了这个过程中 数据的 ...

  6. Hadoop+HBase+ZooKeeper分布式集群环境搭建

    一.环境说明 集群环境至少需要3个节点(也就是3台服务器设备):1个Master,2个Slave,节点之间局域网连接,可以相互ping通,下面举例说明,配置节点IP分配如下: Hostname IP ...

  7. ZooKeeper伪集群的搭建(Windows)

    首先下载 zookeeper 地址:https://www.apache.org/dyn/closer.cgi/zookeeper/ 1.下载完成解压后修改文件夹名字为zookeeper1,然后删除c ...

  8. Zookeeper分布式集群搭建

    实验条件:3台安装linux的机子,配置好Java环境. 步骤1:下载并分别解包到每台机子的/home/iHge2k目录下,附上下载地址:http://mirrors.cnnic.cn/apache/ ...

  9. zookeeper集群环境搭建详细图文教程

    zookeeper集群环境搭建详细图文教程 zhoubang @ 2018-01-02 [文档大纲] 友情介绍 软件环境 注意点 环境安装 1. 新建用于存储安装包以及软件安装的目录 2. 下载安装z ...

随机推荐

  1. css画布

    绘制基本图形 绘制直线 <style> .canvas{ } </style> <canvas id="myCanvas1" style=" ...

  2. 06--Java--Scanner类读入控制台

    Scanner类读入控制台 1.什么是Scanner类 Scanner类是java中从控制台读入用户输入的类 import java.util.Scanner; public class a_Lear ...

  3. TensorFlow2 Part3:动态模型建立与训练

    Keras是一个由Python编写的开源人工神经网络库,可以作为Tensorflow.Microsoft-CNTK和Theano的高阶应用程序接口,进行深度学习模型的设计.调试.评估.应用和可视化 [ ...

  4. window下mysql-proxy简单使用

    mysql-proxy是mysql官方提供的mysql中间件服务,上游可接入若干个mysql-client,后端可连接若干个mysql-server.它使用mysql协议,任何使用mysql-clie ...

  5. Codeforces 176B 经典DP

    非常好的一个题目,CF上的DP都比较经典 题意就是 给定一个串A,B,正好执行K次操作,每次操作可以把 A串从中间切开,并调换两部分的位置,问最后得到B串共有多少种不同的切法(只要中间有一次不同,即视 ...

  6. 对于python 3.x与python2.x中新型类的继承特性总结

    (1)一般性继承特性 """ 该文件对于python 3.x 及python 2.x的New-style 类的一般性继承特性进行了说明和测试. (1)实例的继承特性:搜寻 ...

  7. ACM-单词接龙

    题目描述:单词接龙 问题描述:单词接龙是一个与我们经常玩的成语接龙相类似的游戏,现在我们己知一组单词,且给定一个开头的字母,要求出以这个字母开头的最长的“龙”(每个单词都最多在“龙" 中出现 ...

  8. JavaScript(第十一天 9.24)

    Html(决定页面显示的数据)+CSS(决定页面的布局)+JS(和用户或者服务器交互.决定页面的行为) JS前端的编程语言,脚本语言,简单易学,基础是HTML+CSS 编译工具使用:vscode  s ...

  9. POJ 3663:Costume Party

    Costume Party Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 12607   Accepted: 4977 De ...

  10. Egret Engine 2D - 缩放模式和旋转模式说明

    缩放模式和旋转模式说明 缩放模式showAll 常用 noScale noBorder exactFit 次常用 fixedWidth fixedHeight fixedNarrow fixedWid ...