论坛网站免费建设模板下载安装,当地公交建设公司的官网,营业推广促销,wordpress主题换图片不显示一、安装条件前置
实验zookeeper安装在【Hadoop入门#xff08;二#xff09;集群安装】机器上#xff0c;已完成安装jdk,hadoop和ssh配置环境等。
zookeeper所依赖的虚拟机和操作系统配置
环境#xff1a;ubuntu14 apache-zookeeper-3.5.6-bin.tar jdk1.8ssh
虚拟机…一、安装条件前置
实验zookeeper安装在【Hadoop入门二集群安装】机器上已完成安装jdk,hadoop和ssh配置环境等。
zookeeper所依赖的虚拟机和操作系统配置
环境ubuntu14 apache-zookeeper-3.5.6-bin.tar jdk1.8ssh
虚拟机vmware10 二、zookeeper安装环境设置
1下载
下载网站 下载镜像 2上传到linux系统解压
tar xvf apache-zookeeper-3.5.6-bin.tar.gz
#放在统一的软件目录下
mv apache-zookeeper-3.5.6-bin ~/software/
3 新建数据目录
cd ~/software/apache-zookeeper-3.5.6-bin
#zk的数据目录
mkdir -p zkData/data
#zk的日子目录
mkdir -p zkData/logs
4配置zoo.cfg
cd ~/software/apache-zookeeper-3.5.6-bin/conf
cp zoo_sample.cfg zoo.cfg
vim zoo.cfg
编辑zoo.cfg
# The number of milliseconds of each tick
tickTime2000
# The number of ticks that the initial
# synchronization phase can take
initLimit10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.# 注释掉默认dataDir
# dataDir/tmp/zookeeper
## the port at which the clients will connect
clientPort2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns60
#
# 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.snapRetainCount3
# Purge task interval in hours
# Set to 0 to disable auto purge feature
#autopurge.purgeInterval1#新增的配置server.i的i是数据目录zkData/data下的myid
dataDir/home/mk/software/apache-zookeeper-3.5.6-bin/zkData/data
dataLogDir/home/mk/software/apache-zookeeper-3.5.6-bin/zkData/logs
server.1hadoop01:2888:3888
server.2hadoop02:2888:3888
server.3hadoop03:2888:38885复制到hadoop02、hadoop03
scp -r /home/mk/software/apache-zookeeper-3.5.6-bin mkhadoop02:/home/mk/software/
scp -r /home/mk/software/apache-zookeeper-3.5.6-bin mkhadoop03:/home/mk/software/
6配置myid
hadoop01
echo 1 ~/software/apache-zookeeper-3.5.6-bin/zkData/data/myid
hadoop02
echo 2 ~/software/apache-zookeeper-3.5.6-bin/zkData/data/myid
hadoop03
echo 3 ~/software/apache-zookeeper-3.5.6-bin/zkData/data/myid 三、启动Zookeeper
1启动
zookeeper没有集群启动需要每个机器各自启动
hadoop01、hadoop02、hadoop03都执行启动指令
~/software/apache-zookeeper-3.5.6-bin/bin/zkServer.sh start2检查启动状态
~/software/apache-zookeeper-3.5.6-bin/bin/zkServer.sh statushadoop01 hadoop02 hadoop03 3创建节点
haddoop01登录zk
~/software/apache-zookeeper-3.5.6-bin/bin/zkCli.sh
ls /
create /test
ls /
delete /testhadoop02登录zk
~/software/apache-zookeeper-3.5.6-bin/bin/zkCli.sh
ls /hadoop03登录zk
~/software/apache-zookeeper-3.5.6-bin/bin/zkCli.sh
ls /4关闭
~/software/apache-zookeeper-3.5.6-bin/binzkServer.sh stop