今天我来写一写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. mitmproxy(TLS错误)

    一.原来的基础上添加代码 """ This inline script allows conditional TLS Interception based on a us ...

  2. Windows + Python + flup + flask + fastcgi + Nginx配置

    Nginx配置 # HTTPS server { listen ssl; server_name kvaccount.xx.io; ssl_certificate "C:/xx/conf/s ...

  3. webpack知识点散记

    1.今天学习webpack  ,刚开头就碰到了钉子,因为现在都是4+的版本,用以前的老命令不好使,如下例子及解决办法 不好用:  webpack3的   打包文件   webpack a.js b.j ...

  4. linux下软件包的安装方式

    参考:https://blog.51cto.com/13589255/2071277

  5. Ubuntu18安装LAMP环境详细步骤

    Ubuntu18安装Lamp环境 1.su root  切换root账号(root账户权限高不用总输入sudo) 更新源 阿里源网址:https://opsx.alibaba.com/mirror 更 ...

  6. 通过while循环一步步实现九九乘法表

    # 打印#做出@列的效果height = int(input("height: ")) #用户输入一个高度 num_height = heightwhile num_height ...

  7. springboot + shiro+登录 微信登录 次数验证资料

    分享一个朋友的人工智能教程.零基础!通俗易懂!风趣幽默!大家可以看看是否对自己有帮助,点击查看教程. 1.https://blog.csdn.net/xtiawxf/article/details/5 ...

  8. mysql数据库索引优化

    参考 :http://www.cnblogs.com/yangmei123/archive/2016/04/10/5375723.html MySQL数据库的优化:    数据库优化的目的:     ...

  9. Adaboost的python实现

    不要总是掉包欧,真的丢人啊,一起码起来! '''函数的功能:单层决策树分类函数参数说明: xMat:数据矩阵 i:第i列,第几个特征 Q:阈值返回分类结果: re'''import numpy as ...

  10. 从架构师视角看是否该用Kotlin做服务端开发?

    前言 自从Oracle收购Sun之后,对Java收费或加强控制的尝试从未间断,谷歌与Oracle围绕Java API的官司也跌宕起伏.虽然Oracle只是针对Oracle JDK8的升级收费,并释放了 ...