finalshell中zookeeper安装与配置
时间: 2023-12-15 19:33:31 浏览: 136
以下是在finalshell中安装和配置zookeeper的步骤:
1.下载zookeeper二进制文件,可以从官网下载或使用以下命令下载:
```shell
wget https://downloads.apache.org/zookeeper/zookeeper-3.7.0/apache-zookeeper-3.7.0-bin.tar.gz
```
2.解压缩zookeeper文件:
```shell
tar -zxvf apache-zookeeper-3.7.0-bin.tar.gz
```
3.将解压后的文件夹移动到finalshell的module目录下:
```shell
mv apache-zookeeper-3.7.0-bin ~/finalshell/module/
```
4.创建zookeeper数据目录:
```shell
mkdir -p ~/finalshell/data/zookeeper
```
5.复制zookeeper配置文件:
```shell
cp ~/finalshell/module/apache-zookeeper-3.7.0-bin/conf/zoo_sample.cfg ~/finalshell/module/apache-zookeeper-3.7.0-bin/conf/zoo.cfg
```
6.编辑zookeeper配置文件:
```shell
vim ~/finalshell/module/apache-zookeeper-3.7.0-bin/conf/zoo.cfg
```
将dataDir=/tmp/zookeeper改为dataDir=~/finalshell/data/zookeeper
7.启动zookeeper服务器:
```shell
~/finalshell/module/apache-zookeeper-3.7.0-bin/bin/zkServer.sh start
```
8.检查zookeeper服务器是否已启动:
```shell
~/finalshell/module/apache-zookeeper-3.7.0-bin/bin/zkServer.sh status
```
9.关闭zookeeper服务器:
```shell
~/finalshell/module/apache-zookeeper-3.7.0-bin/bin/zkServer.sh stop
```