前提:关闭防火墙

(1)查看防火墙是否关闭

systemctl status firewalld

(2)关闭防火墙

systemctl stop firewalld

(3)设置防火墙开机不启动

systemctl disable firewalld

1、将zookeeper安装包拉到/opt/software/文件夹中

安装包版本:apache-zookeeper-3.5.7-bin.tar.gz

2、解压

cd /opt/module/

tar -zxvf apache-zookeeper-3.5.7-bin.tar.gz

3、创建数据文件和目录文件

在zookeeper的跟目录下创建两个文件夹data和log

cd /opt/module/apache-zookeeper-3.5.7-bin/

mkdir data

mkdir log

4、拷贝配置文件

cd /opt/module/apache-zookeeper-3.5.5-bin/conf/

cp zoo_sample.cfg zoo.cfg

5、配置文件更改

vi zoo.cfg

# 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=/opt/module/apache-zookeeper-3.5.7-bin/data

dataLogDir=/opt/module/apache-zookeeper-3.5.7-bin/log

# 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.html#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.0=192.168.1.100:2888:3888

server.1=192.168.1.101:2888:3888

server.2=192.168.1.102:2888:3888

最后所增加的是根据自己的主机名与IP地址相对应

6、创建服务器myid

在data目录下创建一个myid的文件,里面的值可以给个任意的值,但要和上述服务起server.x对应

cd /opt/module/apache-zookeeper-3.5.5-bin/data/

touch myid

7、集群拷贝

scp -r /opt/module/apache-zookeeper-3.5.7-bin root@hadoop101:/opt/module/apache-zookeeper-3.5.5-bin

scp -r /opt/module/apache-zookeeper-3.5.7-bin root@hadoop102:/opt/module/apache-zookeeper-3.5.5-bin

8、集群myid更改

进入到每个节点,修改myid值

集群系统环境变量添加:vi /etc/profile

export ZOOKEEPER_HOME=/opt/module/apache-zookeeper-3.5.7-bin

export PATH=$PATH:$ZOOKEEPER_HOME/bin

保存系统环境变量:source /etc/profile

关闭集群防火墙

9、集群启动

进入到每个节点启动(在100、101、102 里都要启动)

cd /opt/module/apache-zookeeper-3.5.7-bin

zkServer.sh start

zkServer.sh status

如若在100启动时报错那么就先在101、102上启动再回头启动100就可以了

在启动之后在最下面会有一个leader和两个follower就是正确的

这是在100上先运行就会报错

在101上面运行就不会报错

102上面运行也不会报错

当在101、102上运行完再运行100就可以了

10、zkCli连接验证

zkCli.sh -server hadoop100:2181

输入这个命令后它会一直运行,按Ctrl+Z停止运行

用jps查看出现ZooKeeperMain进程

出现QuorumPeerMain则说明zookeeper启动成功

Hadoop环境搭建 Zookeeper集群部署相关推荐

  1. Linux下搭建 kafka集群 + zookeeper集群部署 安装、启动、停止

    文章目录 一.环境部署总览 1. 软件版本选型 2. 服务器软件部署总览 二.软件部署手册 2.1. JDK 2.2. kafka 2.3. Kafka Eagle 2.4. mysql 2.5. z ...

  2. zookeeper集群部署(分布式)

    描述 ZooKeeper可以用来保证数据在zookeeper集群之间的数据的事务一致性. 如何搭建ZooKeeper集群 1.         Zookeeper服务集群规模不小于三个节点,要求各服务 ...

  3. 使用Cloudera Manager搭建zookeeper集群及HDFS HA实战篇

    使用Cloudera Manager搭建zookeeper集群及HDFS HA实战篇 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.使用Cloudera Manager搭建zo ...

  4. 环境搭建-CentOS集群搭建

    环境搭建-CentOS集群搭建 写在前面 最近有许多小伙伴问我,大数据的hadoop分布式集群该如何去搭建.所以,想着,就写一篇博客,帮助到更多刚入门大数据的人.本博客会一步一步带你实现一个Hadoo ...

  5. linux 使用 nginx 搭建 zookeeper 集群

    搭建 zookeeper 集群,笔者这里使用3台 centos7 服务器,它们 ip 分别是 192.168.0.125:192.168.0.123:192.168.0.117,后面简称 125,12 ...

  6. 基于docker搭建zookeeper集群、kafka集群

    zookeeper集群搭建 https://www.cnblogs.com/znicy/p/7717426.html     #Docker中搭建zookeeper集群,昵称:zni.feng htt ...

  7. linux下搭建zookeeper集群

    linux下搭建zookeeper集群 1.准备 1.下载zookeeper压缩包 (注:下载3.4.14版本,3.5以上运行时会少jar包) 2.系统:centOS7 安装好java环境 3.将压缩 ...

  8. docker环境搭建redis-cluster集群(多台机器)

    docker环境搭建redis-cluster集群(多机) Docker多台主机安装Redis集群 Docker安装Redis Cluster 三主三从

  9. 基于docker搭建zookeeper集群、kafka集群(多台真机之间的集群)

    基于docker搭建zookeeper集群.kafka集群---二(多台真机之间的集群) https://blog.csdn.net/diebiao6526/article/details/10143 ...

最新文章

  1. Iptables防火墙配置详解
  2. optee的Share Memory介绍
  3. 浅谈JavaScript中的对象和类型(上)
  4. ASP.NET 2.0 中的代码隐藏和编译
  5. Centos7安装nginx教程!超简单
  6. 基片集成波导原理_第5讲基片集成波导.ppt
  7. 安全验证框架使用笔记001---Shiro简介
  8. 用于创建二维数组的语法
  9. swift菜鸟入门视频教程-02-基本运算符
  10. VC6编译64位程序
  11. R语言 常用的数据分析工具包
  12. Hexo写博客时的图片问题
  13. 记一次计算机课作文,记一次有趣的作文课作文800字
  14. p2psear正在连接服务器,P2PSearcher无法连接到网络,也无法连接到服务器
  15. FME不需要符号库转换CAD填充
  16. flea-jersey使用之Flea RESTful接口服务端接入
  17. 重学Elasticsearch第1章 : Elasticsearch, Kibana概念、Elasticsearch相关术语
  18. vscode预览.mad文件
  19. 几维安全:千锤百炼,锻造移动游戏安全防护黄金铠甲 1
  20. 机械手臂类机器人现状

热门文章

  1. 一亿现金和清华录取通知书,你选哪个?
  2. 大鱼号自媒体怎么开通原创功能,大鱼号怎么赚钱
  3. c++: 移动构造/赋值 和 拷贝构造/赋值
  4. Python实现微信批量发送消息
  5. EndNote两台电脑同步library
  6. 声音导引系统及信号采集处理电路设计
  7. QuaterDeck 什么鬼意思?
  8. [PPTX解析] 图片效果算法篇:重新着色
  9. 第四范式:借势PC霸主,推出企业级AI操作系统
  10. 不使用中继台,数字对讲机真能实现100公里通话吗?