学习Hbase之quick start
Loopback IP
/etc/hosts should look something like this:
- vi /etc/hosts
- 127.0.0.1 localhost
- 127.0.0.1 ubuntu.ubuntu-domain ubuntu
1.2.1. Download and unpack the latest stable release.(下载和解压稳定版本)
- $ tar xfvz hbase-0.94.3-security.tar.gz
- $ cd hbase-0.94.3-security
其中hbase.zookeeper.property.dataDir,是ZooKeeper写数据的目录
- <?xml version="1.0"?>
- <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
- hbase.rootdir
- /data/hbase
- hbase.zookeeper.property.dataDir
- /data/zookeeper
1.2.2. Start HBase
- [root@ZSDDB8 hbase-0.94.3-security]# ./bin/start-hbase.sh
- starting master, logging to /root/hbase-0.94.3-security/bin/../logs/hbase-root-master-ZSDDB8.out
Is java Installed?可以查看http://blog.chinaunix.net/space.php?uid=26446098&do=blog&id=3438622 java7安装方式
1.2.3. Shell Exercises
通过shell连接HBASE
- [root@ZSDDB8 hbase-0.94.3-security]# ./bin/hbase shell
- HBase Shell; enter 'help' for list of supported commands.
- Type "exit" to leave the HBase Shell
- Version 0.94.3, r1408904, Wed Nov 14 16:41:36 UTC 2012
- hbase(main):001:0>
创建一个表为test且一个列集合为cf。通过list 'test'验证它的创建然后插入一些数据
- hbase(main):003:0> create 'test', 'cf'
- 0 row(s) in 1.2200 seconds
- hbase(main):002:0> list 'test'
- TABLE
- test
- 1 row(s) in 0.0170 seconds
- 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):005:0> put 'test', 'row2', 'cf:b', 'value2'
- 0 row(s) in 0.0370 seconds
- hbase(main):006:0> put 'test', 'row3', 'cf:c', 'value3'
- 0 row(s) in 0.0450 seconds
- hbase(main):006:0> scan 'test'
- ROW COLUMN+CELL
- row1 column=cf:a, timestamp=1355386368983, value=value1
- row2 column=cf:b, timestamp=1355386374028, value=value2
- row3 column=cf:c, timestamp=1355386377745, value=value3
- 3 row(s) in 0.0600 seconds
- hbase(main):007:0> get 'test', 'row1'
- COLUMN CELL
- cf:a timestamp=1355386368983, value=value1
- 1 row(s) in 0.0330 seconds
- hbase(main):008:0> disable 'test'
- 0 row(s) in 2.0730 seconds
- hbase(main):009:0> drop 'test'
- 0 row(s) in 0.1100 seconds
- hbase(main):013:0> exit
执行stop-hbase.sh关闭HBase
- $ ./bin/stop-hbase.sh
- [root@ZSDDB8 hbase-0.94.3-security]# ./bin/stop-hbase.sh
- stopping hbase...........
1.2.5. Where to go next
The above described standalone setup is good for testing and experiments only. In the next chapter, Chapter 2, Apache HBase (TM) Configuration, we'll go into depth on the different HBase run modes, system requirements running HBase, and critical configurations setting up a distributed HBase deploy.

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
hadoop fsck健康检查
昨天下午的时候检查生产环境的hadoop集群时,发现异常情况如下图: 简要的说明上图的意思,说明有这些文件没有满足副本份数,我副本份数设置的为2份,刚刚起初以为是这个文件只有一个副本了,结果去每台datanode上面去find第一个上图报的block文件时,每台datanode上都有这个block文件,当时真的是奇了怪了,副本是2(我指的是hdfs-site.xml文件里面设置的),每个datanode上都有这个block文件,我的是三个datanode加起来应该是3份,这个数肯定大于默认的副本数,所以应该也不是报副本份数啊!纠结中! 经过一番的查询资料,看到这篇博客对我的启发很大,地址我引用一下,博主别见怪啊! http://blog.chinaunix.net/uid-1838361-id-2981460.html 里面说到一句话让我尝试了一下 结果我查看了一下我的第一个报的block文件,看看文件的副本数是多少? hadoop/bin/hadoop fs -ls /tmp/hadoop-hadoop/mapred/staging/hadoop/.staging/job_20120...
- 下一篇
hadoop下ssh的配置
centos系统自带ssh,版本为openssh4.3 免密码ssh设置(合适的权限很重要) 登入hadoop账户,建立ssh文件夹 mkdir .ssh 现在确认能否不输入口令就用ssh登录本机: $ ssh namenode 如果不输入口令就无法用ssh登陆namenode,执行下面的命令: $ ssh-keygen -t rsa –f ~/.ssh/id_rsa 回车设置密钥,可以设置一个密钥,也可以设置为空密钥。但是安全起见,设置密钥为hadoop,下面利用ssh-agent来设置免密钥登陆集群中其他机器。 私钥放在由-f选项指定的文件之中,例如~/.ssh/id_rsa。存放公钥的文件名称与私钥类似,但是以’.pub’为后缀,本例为~/.ssh/id_rsa.pub $ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys 将ssh密钥存放在namenode机器的~/.ssh/authorized_keys文件中。 再用scp命令将authorized_keys和id_rsa.pub分发到其它机器的相同文件夹下,例如,将a...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- SpringBoot2配置默认Tomcat设置,开启更多高级功能
- SpringBoot2初体验,简单认识spring boot2并且搭建基础工程
- CentOS7,CentOS8安装Elasticsearch6.8.6
- MySQL8.0.19开启GTID主从同步CentOS8
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- CentOS8安装Docker,最新的服务器搭配容器使用
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- Hadoop3单机部署,实现最简伪集群
- Linux系统CentOS6、CentOS7手动修改IP地址
- CentOS7设置SWAP分区,小内存服务器的救世主