小编给大家分享一下如何单机模式安装Hbase,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
上传hbase工具
解压缩
[hadoop@master installer]$ tar xzf hbase-0.94.16-security.tar.gz
[hadoop@master installer]$ ls
eclipse-jee-indigo-SR2-linux-gtk.tar.gz hadoop-eclipse-plugin-1.2.1.zip
hadoop-1.2.1.tar.gz hbase-0.94.16-security
hadoop-eclipse-plugin-1.2.1 hbase-0.94.16-security.tar.gz
[hadoop@master installer]$ mv hbase-0.94.16-security ..
创建软连接
[hadoop@master ~]$ ln -s hbase-0.94.16-security/ hbase
[hadoop@master ~]$ ll
总计 40
drwxr-xr-x 3 hadoop hadoop 4096 10-15 09:56 Desktop
drwxrwxr-x 9 hadoop hadoop 4096 10-16 03:54 eclipse
lrwxrwxrwx 1 hadoop hadoop 13 10-15 07:01 hadoop -> hadoop-1.2.1/
drwxr-xr-x 16 hadoop hadoop 4096 10-15 07:35 hadoop-1.2.1
lrwxrwxrwx 1 hadoop hadoop 23 10-24 02:03 hbase -> hbase-0.94.16-security/
drwxr-xr-x 10 hadoop hadoop 4096 2014-01-11 hbase-0.94.16-security
drwxrwxr-x 2 hadoop hadoop 4096 10-16 06:02 input
drwxrwxr-x 3 hadoop hadoop 4096 10-24 02:03 installer
drwxrwxr-x 2 hadoop hadoop 4096 10-16 06:06 program
drwxrwxr-x 4 hadoop hadoop 4096 10-16 06:08 tmp
drwxrwxr-x 3 hadoop hadoop 4096 10-15 09:54 workspace
drwxrwxr-x 5 hadoop hadoop 4096 10-16 06:00 workspace2
[hadoop@master ~]$
配置os环境变量
[hadoop@master ~]$ vim .bashrc
export JAVA_HOME=/usr/java/jdk1.6.0_27
export HADOOP1_HOME=/home/hadoop/hadoop
export HBASE_HOME=/home/hadoop/hbase
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP1_HOME/bin:$HBASE_HOME/bin
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib
配置hbase
[hadoop@master hbase]$ pwd
/home/hadoop/hbase
[hadoop@master hbase]$ cd conf
[hadoop@master conf]$ pwd
/home/hadoop/hbase/conf
[hadoop@master conf]$
[hadoop@master conf]$ vim hbase-env.sh
修改java环境变量
export JAVA_HOME=/usr/java/jdk1.6.0_27
export HBASE_HEAPSIZE=50
[hadoop@master conf]$ vim hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///home/hadoop/hbase/data</value>
</property>
</configuration>
这里先使用本机,单点模式。
[hadoop@master conf]$ mkdir -p /home/hadoop/hbase/data
使文件生效
[hadoop@master ~]$ . .bashrc
启动hbase
[hadoop@master ~]$ start-hbase.sh
starting master, logging to /home/hadoop/hbase/logs/hbase-hadoop-master-master.out
[hadoop@master ~]$ jps
5946 NameNode
2572 HMaster
6189 JobTracker
2775 Jps
6108 SecondaryNameNode
[hadoop@master ~]$
只有单点模式,所以只有HMaster,很快就启动成功。
进入shell
[hadoop@master ~]$ hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>">
Version 0.94.16, r1557241, Fri Jan 10 20:10:24 UTC 2014
hbase(main):001:0>quit
单机模式很简单
[hadoop@master ~]$ stop-hbase.sh
stopping hbase................
以上是“如何单机模式安装Hbase”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。