010_redhat安装zookeeper

1.环境准备

准备一台linux服务器
ZooKeeper服务器是用Java创建的,它运行在JVM之上。需要安装JDK 7或更高版本。
我测试安装的jdk1.8

2.下载上传zookeeper安装包

1)官网下载zookeeper-3.6.4安装包

apache-zookeeper-3.6.4-bin.tar.gz

2)创建soft文件夹

#根目录创建 /soft
mkdir soft
#使用终端工具把下载的zookeeper安装包上传到服务器上 /soft 目录下

3.解压

将tar包解压到/usr/local/目录下

tar -zxvf apache-zookeeper-3.6.4-bin.tar.gz  -C /usr/local/

4.配置启动

1、配置zoo.cfg

进入到conf目录拷贝一个zoo_sample.cfg并完成配置

#进入到conf目录
[root@rhel local]# cd /usr/local/apache-zookeeper-3.6.4-bin/conf
#拷贝
cp  zoo_sample.cfg  zoo.cfg

#打开目录
[root@rhel local]# cd /usr/local/apache-zookeeper-3.6.4-bin
#创建zooKeeper存储目录
[root@rhel apache-zookeeper-3.6.4-bin]# mkdir zkdata
#修改zoo.cfg
vim /opt/zooKeeper/apache-zooKeeper-3.5.6-bin/conf/zoo.cfg


# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/usr/local/apache-zookeeper-3.6.4-bin/zkdata
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#

#修改存储目录:dataDir=/usr/local/apache-zookeeper-3.6.4-bin/zkdata

2、启动zookeeper

cd /opt/zooKeeper/apache-zooKeeper-3.5.6-bin/bin/

 ./zkServer.sh  start
#启动
[root@rhel bin]# ./zkServer.sh  start
#启动成功	Starting zookeeper ... STARTED
ZooKeeper JMX enabled by default
Using config: /usr/local/apache-zookeeper-3.6.4-bin/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
#查看zookeeper状态	standalone代表zk没有搭建集群,现在是单节点
[root@rhel bin]# ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/apache-zookeeper-3.6.4-bin/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Mode: standalone

小结

zookeeper的安装在RedHat与CentOS、ubuntu 等Linux系统下的安装基本相同,我是在redhat系统中操作的,安装步骤做个记录,仅供参考。

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值