1.HDFS安装
参考:hadoop-hdfs
2.Hbase安装
在启动hdfs后。
2.1将Hbase解压,并且放入指定目录
cd /home/pp_res/
tar -zxvf hbase-1.0.3-bin.tar.gz
mkdir -p /data/service
mv hbase-1.0.3/ /data/service/hbase
2.2修改hbase-env.sh的JAVA_HOME环境变量位置
cd /data/service/hbase/conf/
vi hbase-env.sh
在27行左右的位置,修改如下
export JAVA_HOME=java路径
2.3修改Hbase的配置信息
vi hbase-site.xml
在结尾修改成如下,这里我们指定Hbase本地来存储数据,生产环境将数据建议存入HDFS中。
2.4启动hbase
cd /data/service/hbase/bin
./start-hbase.sh
查看Hbase是否启动成功,如果启动成功的会看到"HMaster"的进程
[root@localhost bin]# jps
12075 Jps
11784 HMaster
2.5 初始化Hbase的pinpoint库
执行pinpoint提供的Hbase初始化语句,这时会初始化一会。
./hbase shell/home/pp_res/hbase-create.hbase
执行完了以后,进入Hbase
./hbase shell
进入后可以看到Hbase的版本,还有一些相关的信息
2016-11-15 01:55:44,861 WARN [main] util.NativeCodeLoader: Unable to loadnative-hadoop library for your platform... using built
in-java classes where applicableHBaseShell; enter 'help
Type "exit
Version 1.0.3,rf1e1312f9790a7c40f6a4b5a1bab2ea1dd559890, Tue Jan 19 19:26:53 PST 2016
hbase(main):001:0>
输入"status 'detailed'"可以查看刚才初始化的表,是否存在
hbase(main):001:0> status 'detailed'
version 1.0.3
0 regionsInTransition
master coprocessors: []
1 live servers
localhost:50887 1478538574709
requestsPerSecond=0.0, numberOfOnlineRegions=498, usedHeapMB=24,maxHeapMB=237, numberOfStores=626, numberOfStorefiles=0, storefileUncom
pressedSizeMB=0, storefileSizeMB=0,memstoreSizeMB=0, storefileIndexSizeMB=0, readRequestsCount=7714, writeRequestsCount=996,rootIndexSizeKB=0, totalStaticIndexSizeKB=0, totalStaticBloomSizeKB=0,totalCompactingKVs=0, currentCompactedKVs=0, compactionProgressPct=NaN,coprocessors=[MultiRowMutationEndpoint] "AgentEvent,,1478539104778.aa1b3b14d0b48d83cbf4705b75cb35b7."
numberOfStores=1, numberOfStorefiles=0, storefileUncompressedSizeMB=0,storefileSizeMB=0, memstoreSizeMB=0, storefileIndexSizeMB=0,
readRequestsCount=0, writeRequestsCount=0,rootIndexSizeKB=0, totalStaticIndexSizeKB=0, totalStaticBloomSizeKB=0,totalCompactingKVs=0, currentCompactedKVs=0, compactionProgressPct=NaN,completeSequenceId=-1, dataLocality=0.0
...
也可以登录web,来查看HBase的数据是否初始化成功
HbaseWeb :http://192.168.245.134:16010/master-status