tar -xvzf hbase-2.1.0.tar.gz -C ../server/
cd /export/server/hbase-2.1.0/conf
vim hbase-env.sh
# 第28行
export JAVA_HOME=/export/server/jdk1.8.0_241/
export HBASE_MANAGES_ZK=false
vim hbase-site.xml
------------------------------
hbase.rootdir
hdfs://node1.itcast.cn:8020/hbase
hbase.cluster.distributed
true
hbase.zookeeper.quorum
node1.itcast.cn,node2.itcast.cn,node3.itcast.cn
hbase.zookeeper.property.dataDir
/export/server/apache-zookeeper-3.6.0-bin/data
hbase.unsafe.stream.capability.enforce
false
# 配置Hbase环境变量
vim /etc/profile
export HBASE_HOME=/export/server/hbase-2.1.0
export PATH=$PATH:${HBASE_HOME}/bin:${HBASE_HOME}/sbin
#加载环境变量
source /etc/profile
cp $HBASE_HOME/lib/client-facing-thirdparty/htrace-core-3.1.0-incubating.jar $HBASE_HOME/lib/
cd /export/server/hbase-2.1.0/conf
vim regionservers
node1
node2
node3
cd /export/server
scp -r hbase-2.1.0/ node2:$PWD
scp -r hbase-2.1.0/ node3:$PWD
在node2和node3配置加载环境变量
source /etc/profile
cd /export/server
# 启动ZK
./start-zk.sh
# 启动hadoop
start-dfs.sh
# 启动hbase
start-hbase.sh
# 启动hbase shell客户端
hbase shell
# 输入status
[root@node1 ~]# hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/hbase-2.1.0/lib/phoenix-5.0.0-HBase-2.0-client.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hbase-2.1.0/lib/phoenix-5.0.0-HBase-2.0-hive.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hbase-2.1.0/lib/phoenix-5.0.0-HBase-2.0-pig.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hbase-2.1.0/lib/phoenix-5.0.0-HBase-2.0-thin-client.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-2.7.5/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hbase-2.1.0/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
Version 2.1.0, re1673bb0bbfea21d6e5dba73e013b09b8b49b89b, Tue Jul 10 17:26:48 CST 2018
Took 0.0042 seconds
hbase(main):001:0> status
1 active master, 0 backup masters, 3 servers, 0 dead, 21.3333 average load
Took 0.7734 seconds
hbase(main):002:0>
http://node1:16010/master-status
目录名 | 说明 |
---|---|
bin | 所有hbase相关的命令都在该目录存放 |
conf | 所有的hbase配置文件 |
hbase-webapps | hbase的web ui程序位置 |
lib | hbase依赖的java库 |
logs | hbase的日志文件 |
针对大概800TB存储空间的集群中每个Java进程的典型内存配置:
进程 | 堆 | 描述 |
---|---|---|
NameNode | 8 GB | 每100TB数据或每100W个文件大约占用NameNode堆1GB的内存 |
SecondaryNameNode | 8GB | 在内存中重做主NameNode的EditLog,因此配置需要与NameNode一样 |
DataNode | 1GB | 适度即可 |
ResourceManager | 4GB | 适度即可(注意此处是MapReduce的推荐配置) |
NodeManager | 2GB | 适当即可(注意此处是MapReduce的推荐配置) |
HBase HMaster | 4GB | 轻量级负载,适当即可 |
HBase RegionServer | 12GB | 大部分可用内存、同时为操作系统缓存、任务进程留下足够的空间 |
ZooKeeper | 1GB | 适度 |
推荐: