Postingan

Menampilkan postingan dari Desember, 2013

HBase Examples

Go to HBase Mode           $hbase shell List all the tables           hbase>list Create HBase table with Normal Mode           hbase>create ‘cars’, ‘vi’ Let’s insert 3 column qualifies (make, model, year) and the associated values into the first row (row1).           hbase>put ‘cars’, ‘row1’, ‘vi:make’, ‘BMW’           hbase>put ‘cars’, ‘row1’, ‘vi:model’, ‘5 series’           hbase>put ‘cars’, ‘row1’, ‘vi:year’, ‘2012’ Now let’s add second row           hbase>put ‘cars’, ‘row2’, ‘vi:make’, ‘Ferari’           hbase>put ‘cars’, ‘row2’, ‘vi:model’, ‘e series’           hbase>put ‘cars’, ‘row2’, ‘vi:year’, ‘2012’ Now let’s add third row           hbase>put ‘cars’, ‘row3’, ‘vi:make’, ‘Honda’ ...

HBase Shell Commands

whoami: Show the current hbase user. Example:          hbase> whoami alter:   Alter column family schema;  pass table name and a dictionary specifying new column family schema. Dictionaries are described below in the GENERAL NOTES section.  Dictionary must include name of column family to alter. For example,  To change or add the 'f1' column family in table 't1' from defaults to instead keep a maximum of 5 cell VERSIONS, do:            hbase> alter 't1', {NAME => 'f1', VERSIONS => 5} To delete the 'f1' column family in table 't1', do:            hbase> alter 't1', {NAME => 'f1', METHOD => 'delete'}  You can also change table-scope attributes like MAX_FILESIZE            MEMSTORE_FLUSHSIZE and READONLY.  For example, to change the max size of a family to 128MB, do:           ...

Hbase Data model

Hbase Data model - These six concepts form the foundation of HBase. Table: HBase organizes data into tables. Table names are Strings and composed of characters that are safe for use in a file system path. Row: Within a table, data is stored according to its row. Rows are identified uniquely by their rowkey. Rowkeys don’t have a data type and are always treated as a byte[]. Column family: Data within a row is grouped by column family. Column families also impact the physical arrangement of data stored in HBase. For this reason,they must be defined up front and aren’t easily modified. Every row in a table has the same column families, although a row need not store data in all its families.Column family names are Strings and composed of characters that are safe for use in a file system path. Column qualifier: Data within a column family is addressed via its column qualifier,or column. Column qualifiers need not be specified in advance. Column qualifiers need not be consiste...

HBase Architecture

Gambar
      The HBase Architecture consists of servers in a Master-Slave relationship as shown below. Typically, the HBase cluster has one Master node, called HMaster and multiple Region Servers called HRegionServer. Each Region Server contains multiple Regions – HRegions. Just like in a Relational Database, data in HBase is stored in Tables and these Tables are stored in Regions. When a Table becomes too big, the Table is partitioned into multiple Regions. These Regions are assigned to Region Servers across the cluster. Each Region Server hosts roughly the same number of Regions. The HMaster in the HBase is responsible for Performing Administration Managing and Monitoring the Cluster Assigning Regions to the Region Servers Controlling the Load Balancing and Failover On the other hand, the HRegionServer perform the following work Hosting and managing Regions Splitting the Regions automatically Handling the read/write requests Communicating w...

Apache HBase

        HBase is an open source, non-relational, distributed database modeled after Google's BigTable and is written in Java. It is developed as part of Apache Software Foundation's Apache Hadoop project and runs on top of HDFS (Hadoop Distributed Filesystem), providing BigTable-like capabilities for Hadoop. HBase features compression, in-memory operation, and Bloom filters on a per-column basis as outlined in the original BigTable paper. Tables in HBase can serve as the input and output for MapReduce jobs run in Hadoop, and may be accessed through the Java API but also through REST, Avro or Thrift gateway APIs. What is HBase?         HBase is a column-oriented database management system that runs on top of HDFS. It is well suited for sparse data sets, which are common in many big data use cases. Unlike relational database systems, HBase does not support a structured query language like SQL; in fact, HBase isn’t a relational data store at ...