HBase和Hive的基本配置
master节点:lab201,slave节点:lab201,lab202,lab203
三个节点均执行如下操作( 以下以master结点为例)
[root@lab201 ~]# tar xf hbase-0.90.6-cdh3u6.tar.gz -C /usr/local/
[root@lab201 local]# ln -sv hbase-0.90.6-cdh3u6/ hbase
[root@lab202 ~]# vim /etc/profile.d/hbase.sh
HBASE_HOME=/usr/local/hbase
PATH=$HBASE_HOME/bin:$PATH
export HBASE_HOME PATH
[root@lab201 ~]# chown -R hduser.hduser /usr/local/hbase/
master节点配置:
[root@lab201 conf]# vim hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://lab201:8020/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>lab201,lab202,lab203</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2222</value>
</property>
</configuration>
[hduser@lab201 ~]$ vim /usr/local/hbase/conf/regionservers
lab201
lab202
lab203
[root@lab201 ~]# scp /usr/local/hbase/conf/hbase-site.xml /usr/local/hbase/conf/regionservers hduser@lab202:/usr/local/hbase/conf/
[root@lab201 ~]# scp /usr/local/hbase/conf/hbase-site.xml /usr/local/hbase/conf/regionservers hduser@lab203:/usr/local/hbase/conf/
[hduser@lab201 ~]$ start-hbase.sh 查看主节点上启动的进程
12717 HRegionServer
13533 HQuorumPeer
13600 HMaster
[hduser@lab202 conf]$ jps 查看从节点上启动的进程
4025 HRegionServer
3937 HQuorumPeer
验证是否正常:
web访问master的60010端口,slave的60030端口,查看能否正常访问
用shell连接Hbase进行功能测试:
[hduser@lab201 ~]$ hbase shell
hbase(main):003:0> create 'test', 'cf'
0 row(s) in 1.2200 seconds
hbase(main):003:0> list 'table'
test
1 row(s) in 0.0550 seconds
hbase(main):004:0> put 'test', 'row1', 'cf:a', 'value1'
0 row(s) in 0.0560 seconds
hbase(main):007:0> scan 'test'
ROW COLUMN+CELL
row1 column=cf:a, timestamp=1288380727188, value=value1
1 row(s) in 0.0590 seconds