安装环境
jdk1.8
zookeeper3.4.14
hbase 2.2.1
hadoop 2.8.5
版本兼容一览
首推清华镜像下载站下载所需包
清华镜像
单机版zookeeper部署
解压下载好的zookeeper包,到自己的目录
cd zookeeper/
进入zookeeper目录
创建文件夹data 用来存储同步信息
mkdir data
进入到conf目录
cp zoo_sample.cfg zoo.cfg
vim zoo.cfg
修改添加zoo.cfg文件内容如下:
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/usr/zookeeper/data #这是刚刚创建的data目录用来存储同步信息
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# 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.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
server.1=localhost:2888:3888 #单机版添加一个server即可
然后再回到创建的data目录:
touch myid
echo 1 >> myid
进入到bin目录
./zkServer.sh start
./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/zookeeper/bin/../conf/zoo.cfg
Mode: standalone
发现是standalone即可
安装Hbase
解压下载好的hbase包到自定义的目录
wget https://mirrors.tuna.tsinghua.edu.cn/apache/hbase/2.2.1/hbase-2.2.1-bin.tar.gz
进入到hbase目录下,将lib中zookeeper的jar包换成自己相应版本的
[root@hadoop lib]# cp /usr