zoukankan      html  css  js  c++  java
  • hadoop 笔记(hbase)

    hbase 基础:

    hbase是基于列的数据,其数据模式如下:

    1、安装

      1.1)hbase安装分为单机、伪分布式、分布式,单机下安装不依赖于hadoop;因为不需要分布式文件系统支持;
      1.2)安装并启动服务:
        tar xfz hbase-0.94.12.tar.gz;
        start-hbase.sh
        stop-hbase.sh
        备注:需要先安装jdk
      1.3) 配置hbase-site.xml
        <configuration>
          <property>
            <name>hbase.rootdir</name>
            <value>file:///tmp/hbase</value> //如果是集群配置这里就是hadoop的文件系统
          </property>
        </configuration>
      1.3)启动shell控制台
        hbase shell

      备注:需要配置环境变量,否则执行该命令需要在bin目录下

    2. CRUD
      2.1) 创建
        create 'ti','f1','f2'

      行为 ti,有f1,f2两个列簇

      2.2)查看创建的行
        list
        显示t1被创建

      2.3) 插入(每次操作一个cell)
        put 'ti', 'fredric', 'f1:name','sinny'
        put 'ti', 'fredric', 'f1:age','12
        put 'ti', 'sinny', 'f2:site','hangzhou'

      2.4) 查看
        scan 'ti'

        结果如下:
        ROW COLUMN+CELL
        fredric column=f1:age, timestamp=1437120810615, value=12
        fredric column=f1:name, timestamp=1437120785387, value=sinny
        sinny column=f2:site, timestamp=1437120892777, value=hangzhou

      2.5)获取
        get 'ti','fredric'
        get 'ti', 'fredric', {COLUMN => 'f1', TIMESTAMP => 1437120810615}

      2.6) 删除
        disable 'ti'
        drop 'ti'

  • 相关阅读:
    C#冒泡排序--详解
    盘古搜索--实例解析
    ajax提交表单序列化(serialize())数据
    随机数大揭秘
    静态代码块(主要是注意执行顺序)
    单例模式
    递归
    vue路由嵌套(邹文丰)
    vue computed和 methods、 watch 区别(邹文丰)
    vuex状态管理mutations,getters,actions总结(邹文丰)
  • 原文地址:https://www.cnblogs.com/Fredric-2013/p/4654963.html
Copyright © 2011-2022 走看看