其他分享
首页 > 其他分享> > Hadoop3.1.3:安装zookeeper

Hadoop3.1.3:安装zookeeper

作者:互联网

首先进到/opt/software/目录下,使用命令下载zookeeper包

wget https://ftp.jaist.ac.jp/pub/apache/zookeeper/zookeeper-3.6.3/apache-zookeeper-3.6.3-bin.tar.gz

解压:tar -zxvf apache-zookeeper-3.6.3-bin.tar.gz

移动至module文件夹

mv apache-zookeeper-3.6.3-bin/ /opt/module/apache-zookeeper-3.6.3-bin/

进入主目录创建data文件

cd /opt/module/apache-zookeeper-3.6.3-bin
mkdir data

在conf目录下修改配置信息

cp zoo_sample.cfg  zoo.cfg
vim zoo.cfg
令dataDir=/opt/module/apache-zookeeper-3.6.3-bin/data

在bin目录下启动zookeeper

./zkServer.sh start

在这里插入图片描述
查看状态:./zkServer.sh status
在这里插入图片描述
重启:./zkServer.sh restart
在这里插入图片描述

配置快捷启动命令:

cd /home/hadoop/bin/
vim zookeeper.sh
#!/bin/bash
if [ $# -lt 1 ]
then
 echo "No Args Input..."
 exit ;
fi
case $1 in
"start")
 echo " =================== 启动 zookeeper 集群 ==================="
 ssh hadoop102 "/opt/module/apache-zookeeper-3.6.3-bin/bin/zkServer.sh start"
;;
"stop")
 echo " =================== 关闭 zookeeper 集群 ==================="
 ssh hadoop102 "/opt/module/apache-zookeeper-3.6.3-bin/bin/zkServer.sh stop"
;;
*)
 echo "Input Args Error..."
;;
esac
chmod 777 zookeeper.sh

测试脚本~~ zookeeper.sh start
在这里插入图片描述

zookeeper.sh stop

在这里插入图片描述

标签:bin,3.6,zookeeper,module,Hadoop3.1,sh,apache,安装
来源: https://blog.csdn.net/qq_42967961/article/details/117653662