安装zookeeper
1.下载:下载链接:http://archive.apache.org/dist/zookeeper/
2.安装 (以3.4.8为例)
mkdir myapp.创建安装目录(当前目录:/opt/software/zookeeper/)
tar -zxf zookeeper-3.4.8.tar.gz -C ./myapp (将安装包解压至myapp目录)
cd myapp/zookeeper-3.4.8/ 进入安装目录.创建data和log目录 mkdir data mkdir logs 用于存储数据和日志
cd conf (进入配置文件目录) 创建配置文件(zoo.cfg): cp zoo_sample.cfg zoo.cfg
对zoo.cfg进行配置:修改和新增配置
dataDir=/opt/software/zookeeper/myapp/zookeeper-3.4.8/data
dataLogDir=/opt/software/zookeeper/myapp/zookeeper-3.4.8/logs
3.启动和停止
./zkServer.sh start ./zkServer.sh stop ./zkServer.sh restart
./zkServer.sh status