diff --git a/src/site/resources/images/architecture.gif b/hbase-site/src/site/resources/images/architecture.gif
similarity index 100%
rename from src/site/resources/images/architecture.gif
rename to hbase-site/src/site/resources/images/architecture.gif
diff --git a/src/site/resources/images/favicon.ico b/hbase-site/src/site/resources/images/favicon.ico
similarity index 100%
rename from src/site/resources/images/favicon.ico
rename to hbase-site/src/site/resources/images/favicon.ico
diff --git a/src/site/resources/images/hadoop-logo.jpg b/hbase-site/src/site/resources/images/hadoop-logo.jpg
similarity index 100%
rename from src/site/resources/images/hadoop-logo.jpg
rename to hbase-site/src/site/resources/images/hadoop-logo.jpg
diff --git a/src/site/resources/images/hbase_logo.png b/hbase-site/src/site/resources/images/hbase_logo.png
similarity index 100%
rename from src/site/resources/images/hbase_logo.png
rename to hbase-site/src/site/resources/images/hbase_logo.png
diff --git a/src/site/resources/images/hfile.png b/hbase-site/src/site/resources/images/hfile.png
similarity index 100%
rename from src/site/resources/images/hfile.png
rename to hbase-site/src/site/resources/images/hfile.png
diff --git a/src/site/resources/images/hfilev2.png b/hbase-site/src/site/resources/images/hfilev2.png
similarity index 100%
rename from src/site/resources/images/hfilev2.png
rename to hbase-site/src/site/resources/images/hfilev2.png
diff --git a/src/site/resources/images/replication_overview.png b/hbase-site/src/site/resources/images/replication_overview.png
similarity index 100%
rename from src/site/resources/images/replication_overview.png
rename to hbase-site/src/site/resources/images/replication_overview.png
diff --git a/src/main/resources/org/apache/hadoop/hbase/mapred/RowCounter_Counters.properties b/src/main/resources/org/apache/hadoop/hbase/mapred/RowCounter_Counters.properties
deleted file mode 100644
index 661e56d01e1..00000000000
--- a/src/main/resources/org/apache/hadoop/hbase/mapred/RowCounter_Counters.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# ResourceBundle properties file for RowCounter MR job
-
-CounterGroupName= RowCounter
-
-ROWS.name= Rows
diff --git a/src/main/resources/org/apache/hadoop/hbase/mapreduce/RowCounter_Counters.properties b/src/main/resources/org/apache/hadoop/hbase/mapreduce/RowCounter_Counters.properties
deleted file mode 100644
index 661e56d01e1..00000000000
--- a/src/main/resources/org/apache/hadoop/hbase/mapreduce/RowCounter_Counters.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# ResourceBundle properties file for RowCounter MR job
-
-CounterGroupName= RowCounter
-
-ROWS.name= Rows
diff --git a/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift b/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift
deleted file mode 100644
index 5bb0f51cbd3..00000000000
--- a/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// NOTE: The "required" and "optional" keywords for the service methods are purely for documentation
-
-namespace java org.apache.hadoop.hbase.thrift2.generated
-namespace cpp apache.hadoop.hbase.thrift2
-namespace rb Apache.Hadoop.Hbase.Thrift2
-namespace py hbase
-namespace perl Hbase
-
-struct TTimeRange {
- 1: required i64 minStamp,
- 2: required i64 maxStamp
-}
-
-/**
- * Addresses a single cell or multiple cells
- * in a HBase table by column family and optionally
- * a column qualifier and timestamp
- */
-struct TColumn {
- 1: required binary family,
- 2: optional binary qualifier,
- 3: optional i64 timestamp
-}
-
-/**
- * Represents a single cell and its value.
- */
-struct TColumnValue {
- 1: required binary family,
- 2: required binary qualifier,
- 3: required binary value,
- 4: optional i64 timestamp
-}
-
-/**
- * Represents a single cell and the amount to increment it by
- */
-struct TColumnIncrement {
- 1: required binary family,
- 2: required binary qualifier,
- 3: optional i64 amount = 1
-}
-
-/**
- * if no Result is found, row and columnValues will not be set.
- */
-struct TResult {
- 1: optional binary row,
- 2: required list HBase is not an ACID compliant database. However, it does guarantee certain specific
- properties. This specification enumerates the ACID properties of HBase. For the sake of common vocabulary, we define the following terms:
- The terms must and may are used as specified by RFC 2119.
- In short, the word "must" implies that, if some case exists where the statement
- is not true, it is a bug. The word "may" implies that, even if the guarantee
- is provided in a current release, users should not rely on it.
-
- A scan is not a consistent view of a table. Scans do
- not exhibit snapshot isolation.
-
- Rather, scans have the following properties:
-
- Those familiar with relational databases will recognize this isolation level as "read committed".
-
- Please note that the guarantees listed above regarding scanner consistency
- are referring to "transaction commit time", not the "timestamp"
- field of each cell. That is to say, a scanner started at time t may see edits
- with a timestamp value greater than t, if those edits were committed with a
- "forward dated" timestamp before the scanner was constructed.
- All of the above guarantees must be possible within HBase. For users who would like to trade
- off some guarantees for performance, HBase may offer several tuning options. For example:
- For more information, see the client architecture or data model sections in the HBase Reference Guide.
- [1] A consistent view is not guaranteed intra-row scanning -- i.e. fetching a portion of
- a row in one RPC then going back to fetch another portion of the row in a subsequent RPC.
- Intra-row scanning happens when you set a limit on how many values to return per Scan#next
- (See Scan#setBatch(int)).
- [2] In the context of HBase, "durably on disk" implies an hflush() call on the transaction
- log. This does not actually imply an fsync() to magnetic media, but rather just that the data has been
- written to the OS cache on all replicas of the log. In the case of a full datacenter power loss, it is
- possible that the edits are not truly durable. [3] Puts will either wholely succeed or wholely fail, provided that they are actually sent
- to the RegionServer. If the writebuffer is used, Puts will not be sent until the writebuffer is filled
- or it is explicitly flushed. This page has been retired. The contents have been moved to the
- Bulk Loading section
- in the Reference Guide.
- HBase is a distributed, column-oriented store, modeled after Google's BigTable. HBase is built on top of Hadoop for its MapReduce and distributed file system implementation. All these projects are open-source and part of the Apache Software Foundation. As being distributed, large scale platforms, the Hadoop and HBase projects mainly focus on *nix environments for production installations. However, being developed in Java, both projects are fully portable across platforms and, hence, also to the Windows operating system. For ease of development the projects rely on Cygwin to have a *nix-like environment on Windows to run the shell scripts. This document explains the intricacies of running HBase on Windows using Cygwin as an all-in-one single-node installation for testing and development. The HBase Overview and QuickStart guides on the other hand go a long way in explaning how to setup HBase in more complex deployment scenario's. For running HBase on Windows, 3 technologies are required: Java, Cygwin and SSH. The following paragraphs detail the installation of each of the aforementioned technologies. HBase depends on the Java Platform, Standard Edition, 6 Release. So the target system has to be provided with at least the Java Runtime Environment (JRE); however if the system will also be used for development, the Jave Development Kit (JDK) is preferred. You can download the latest versions for both from Sun's download page. Installation is a simple GUI wizard that guides you through the process. Cygwin is probably the oddest technology in this solution stack. It provides a dynamic link library that emulates most of a *nix environment on Windows. On top of that a whole bunch of the most common *nix tools are supplied. Combined, the DLL with the tools form a very *nix-alike environment on Windows. For installation, Cygwin provides the To support installation, the Perform following steps to install Cygwin, which are elaboratly detailed in the 2nd chapter of the Cygwin User's Guide: HBase (and Hadoop) rely on SSH for interprocess/-node communication and launching remote commands. SSH will be provisioned on the target system via Cygwin, which supports running Cygwin programs as Windows services! Download the latest release of HBase from the website. As the HBase distributable is just a zipped archive, installation is as simple as unpacking the archive so it ends up in its final installation directory. Notice that HBase has to be installed in Cygwin and a good directory suggestion is to use There are 3 parts left to configure: Java, SSH and HBase itself. Following paragraphs explain eacht topic in detail. One important thing to remember in shell scripting in general (i.e. *nix and Windows) is that managing, manipulating and assembling path names that contains spaces can be very hard, due to the need to escape and quote those characters and strings. So we try to stay away from spaces in path names. *nix environments can help us out here very easily by using symbolic links. Configuring SSH is quite elaborate, but primarily a question of launching it by default as a Windows service.
-This should conclude the installation and configuration of HBase on Windows using Cygwin. So it's time to test it.
-
- #foreach( $subitem in $item.items )
- #menuItem( $subitem )
- #end
-
- #end
- #end
- $img $menu.name
- #else
- $menu.name $img
- #end
- #else
- $menu.name
- #end
- #end
- #if ( $menu.items && $menu.items.size() > 0 )
-
- #foreach( $item in $menu.items )
- #menuItem( $item )
- #end
-
- #end
- #end
-#end
-##
-#macro ( copyright )
- #if ( $project )
- #if ( ${project.organization} && ${project.organization.name} )
- #set ( $period = "" )
- #else
- #set ( $period = "." )
- #end
-##
- #set ( $currentYear = ${currentDate.year} + 1900 )
-##
- #if ( ${project.inceptionYear} && ( ${project.inceptionYear} != ${currentYear.toString()} ) )
- ${project.inceptionYear}-${currentYear}${period}
- #else
- ${currentYear}${period}
- #end
-##
- #if ( ${project.organization} )
- #if ( ${project.organization.name} && ${project.organization.url} )
- ${project.organization.name}.
- #elseif ( ${project.organization.name} )
- ${project.organization.name}.
- #end
- #end
- #end
-#end
-##
-#macro ( publishDate $position $publishDate $version )
- #if ( $publishDate && $publishDate.format )
- #set ( $format = $publishDate.format )
- #else
- #set ( $format = "yyyy-MM-dd" )
- #end
-##
- $dateFormat.applyPattern( $format )
-##
- #set ( $dateToday = $dateFormat.format( $currentDate ) )
-##
- #if ( $publishDate && $publishDate.position )
- #set ( $datePosition = $publishDate.position )
- #else
- #set ( $datePosition = "left" )
- #end
-##
- #if ( $version )
- #if ( $version.position )
- #set ( $versionPosition = $version.position )
- #else
- #set ( $versionPosition = "left" )
- #end
- #else
- #set ( $version = "" )
- #set ( $versionPosition = "left" )
- #end
-##
- #set ( $breadcrumbs = $decoration.body.breadcrumbs )
- #set ( $links = $decoration.body.links )
-
- #if ( $datePosition.equalsIgnoreCase( "right" ) && $links && $links.size() > 0 )
- #set ( $prefix = " |" )
- #else
- #set ( $prefix = "" )
- #end
-##
- #if ( $datePosition.equalsIgnoreCase( $position ) )
- #if ( ( $datePosition.equalsIgnoreCase( "right" ) ) || ( $datePosition.equalsIgnoreCase( "bottom" ) ) )
- $prefix $i18n.getString( "site-renderer", $locale, "template.lastpublished" ): $dateToday
- #if ( $versionPosition.equalsIgnoreCase( $position ) )
- | $i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}
- #end
- #elseif ( ( $datePosition.equalsIgnoreCase( "navigation-bottom" ) ) || ( $datePosition.equalsIgnoreCase( "navigation-top" ) ) )
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- setup.exe
utility that tracks the versions of all installed components on the target system and provides the mechanism for installing or updating everything from the mirror sites of Cygwin.setup.exe
utility uses 2 directories on the target system. The Root directory for Cygwin (defaults to C:\cygwin)
which will become /
within the eventual Cygwin installation; and the Local Package directory (e.g. C:\cygsetup
that is the cache where setup.exe
stores the packages before they are installed. The cache must not be the same folder as the Cygwin root.
-
-Administrator
privileges on the target system.C:\cygwin\root
and C:\cygwin\setup
folders.setup.exe
utility and save it to the Local Package directory.setup.exe
utility,
-
-
-Install from Internet
option,setup.exe
utility in the Local Package folder.CYGWIN_HOME
system-wide environment variable that points to your Root directory.%CYGWIN_HOME%\bin
to the end of your PATH
environment variable.Cygwin.bat
command in the Root folder. You should end up in a terminal window that is running a Bash shell. Test the shell by issuing following commands:
-
-
-cd /
should take you to thr Root directory in Cygwin;LS
commands that should list all files and folders in the current directory.exit
command to end the terminal.
-
-setup.exe
utility.Next
button until the Select Packages
panel is shown.View
button to toggle to the list view, which is ordered alfabetically on Package
, making it easier to find the packages we'll need.Skip
) so it's marked for installation. Use the Next
button to download and install the packages.
-
-
-/usr/local/
(or [Root directory]\usr\local
in Windows slang). You should end up with a /usr/local/hbase-<version>
installation in Cygwin.
-
-/usr/local
to the Java home directory by using the following command and substituting the name of your chosen Java environment:
-LN -s /cygdrive/c/Program\ Files/Java/<jre name> /usr/local/<jre name>
-CD /usr/local/<jre name>
and issueing the command ./bin/java -version
. This should output your version of the chosen JRE.
-
-Run as Administrator
.LS -L
command on the different files. Also, notice the auto-completion feature in the shell using <TAB>
is extremely handy in these situations.
-
-
-chmod +r /etc/passwd
to make the passwords file readable for allchmod u+w /etc/passwd
to make the passwords file writable for the ownerchmod +r /etc/group
to make the groups file readable for all
-
-chmod u+w /etc/group
to make the groups file writable for the owner
-
-chmod 755 /var
to make the var folder writable to owner and readable and executable to allPARANOID
line:
-
-
-ALL : localhost 127.0.0.1/32 : allow
ALL : [::1]/128 : allow
ssh-host-config
-
-
-/etc/ssh_config
, answer yes
./etc/sshd_config
, answer yes
.yes
.sshd
as a service, answer yes
. Make sure you started your shell as Adminstrator!<enter>
as the default is ntsec
.sshd
account, answer yes
.no
as the default will suffice.cyg_server
account, answer yes
. Enter a password for the account.net start sshd
or cygrunsrv --start sshd
. Notice that cygrunsrv
is the utility that make the process run as a Windows service. Confirm that you see a message stating that the CYGWIN sshd service was started succesfully.
-
-mkpasswd -cl > /etc/passwd
mkgroup --local > /etc/group
-
-whoami
to verify your userIDssh localhost
to connect to the system itself
-
-
-yes
when presented with the server's fingerprintexit
command should take you back to your first shell in CygwinExit
should terminate the Cygwin shell.[installation directory]
as working directory.
-
-
-./conf/hbase-env.sh
to configure its dependencies on the runtime environment. Copy and uncomment following lines just underneath their original, change them to fit your environemnt. They should read something like:
-
-
-export JAVA_HOME=/usr/local/<jre name>
export HBASE_IDENT_STRING=$HOSTNAME
as this most likely does not inlcude spaces.hbase-default.xml
file for configuration. Some properties do not resolve to existing directories because the JVM runs on Windows. This is the major issue to keep in mind when working with Cygwin: within the shell all paths are *nix-alike, hence relative to the root /
. However, every parameter that is to be consumed within the windows processes themself, need to be Windows settings, hence C:\
-alike. Change following propeties in the configuration file, adjusting paths where necessary to conform with your own installation:
-
-
-hbase.rootdir
must read e.g. file:///C:/cygwin/root/tmp/hbase/data
hbase.tmp.dir
must read C:/cygwin/root/tmp/hbase/tmp
hbase.zookeeper.quorum
must read 127.0.0.1
because for some reason localhost
doesn't seem to resolve properly on Cygwin.hbase.rootdir
and hbase.tmp.dir
directories exist and have the proper rights set up e.g. by issuing a chmod 777
on them.
-
-CD /usr/local/hbase-<version>
, preferably using auto-completion../bin/start-hbase.sh
-
-
-yes
../logs
directory for any exceptions../bin/hbase shell
-
-create 'test', 'data'
list
put 'test', 'row1', 'data:1', 'value1'
-put 'test', 'row2', 'data:2', 'value2'
-put 'test', 'row3', 'data:3', 'value3'
-scan 'test'
that should list all the rows previously inserted. Notice how 3 new columns where added without changing the schema!disable 'test'
followed by drop 'test'
and verified by list
which should give an empty listing.exit
./bin/stop-hbase.sh
command. And wait for it to complete!!! Killing the process might corrupt your data on disk.
-
-./logs
directory.#hbase@freenode.net
). People are very active and keen to help out!
-Now your HBase server is running, start coding and build that next killer app on this particular, but scalable datastore! -
-HBase is the Hadoop database. Think of it as a distributed, scalable, big data store. -
-- Use HBase when you need random, realtime read/write access to your Big Data. - This project's goal is the hosting of very large tables -- billions of rows X millions of columns -- atop clusters of commodity hardware. -HBase is an open-source, distributed, versioned, column-oriented store modeled after Google's Bigtable: A Distributed Storage System for Structured Data by Chang et al. - Just as Bigtable leverages the distributed data storage provided by the Google File System, HBase provides Bigtable-like capabilities on top of Hadoop and HDFS. -
--
See the Architecture Overview, the Apache HBase Reference Guide FAQ, - and the other documentation links on the left! -
-June 15th, 2012 Birds-of-a-feather in San Jose, day after Hadoop Summit
-May 23rd, 2012 HackConAthon in Palo Alto
-May 22nd, 2012 HBaseCon2012 in San Francisco
- - -- HBase emits Hadoop metrics. -
-First read up on Hadoop metrics. - If you are using ganglia, the GangliaMetrics - wiki page is useful read.
-To have HBase emit metrics, edit $HBASE_HOME/conf/hadoop-metrics.properties
- and enable metric 'contexts' per plugin. As of this writing, hadoop supports
- file and ganglia plugins.
- Yes, the hbase metrics files is named hadoop-metrics rather than
- hbase-metrics because currently at least the hadoop metrics system has the
- properties filename hardcoded. Per metrics context,
- comment out the NullContext and enable one or more plugins instead.
-
- If you enable the hbase context, on regionservers you'll see total requests since last - metric emission, count of regions and storefiles as well as a count of memstore size. - On the master, you'll see a count of the cluster's requests. -
-- Enabling the rpc context is good if you are interested in seeing - metrics on each hbase rpc method invocation (counts and time taken). -
-- The jvm context is - useful for long-term stats on running hbase jvms -- memory used, thread counts, etc. - As of this writing, if more than one jvm is running emitting metrics, at least - in ganglia, the stats are aggregated rather than reported per instance. -
-- In addition to the standard output contexts supported by the Hadoop - metrics package, you can also export HBase metrics via Java Management - Extensions (JMX). This will allow viewing HBase stats in JConsole or - any other JMX client. -
-
- To enable JMX support in HBase, first edit
- $HBASE_HOME/conf/hadoop-metrics.properties
to support
- metrics refreshing. (If you've running 0.94.1 and above, or have already configured
- hadoop-metrics.properties
for another output context,
- you can skip this step).
-
- For remote access, you will need to configure JMX remote passwords - and access profiles. Create the files: -
-$HBASE_HOME/conf/jmxremote.passwd
(set permissions
- to 600)$HBASE_HOME/conf/jmxremote.access
- Finally, edit the $HBASE_HOME/conf/hbase-env.sh
- script to add JMX support:
-
$HBASE_HOME/conf/hbase-env.sh
Add the lines:
- -
- After restarting the processes you want to monitor, you should now be
- able to run JConsole (included with the JDK since JDK 5.0) to view
- the statistics via JMX. HBase MBeans are exported under the
- hadoop
domain in JMX.
-
- For more information on understanding HBase metrics, see the metrics section in the HBase Reference Guide. -
-March 27th, 2012 Meetup @ StumbleUpon in San Francisco
- -January 19th, 2012 Meetup @ EBay
-January 23rd, 2012 HBase 0.92.0 released. Download it!
-December 23rd, 2011 HBase 0.90.5 released. Download it!
-November 29th, 2011 Developer Pow-Wow in SF at Salesforce HQ
-November 7th, 2011 HBase Meetup in NYC (6PM) at the AppNexus office
-August 22nd, 2011 HBase Hackathon (11AM) and Meetup (6PM) at FB in PA
-June 30th, 2011 HBase Contributor Day, the day after the Hadoop Summit hosted by Y!
-June 8th, 2011 HBase Hackathon in Berlin to coincide with Berlin Buzzwords
-May 19th, 2011 HBase 0.90.3 released. Download it!
-April 12th, 2011 HBase 0.90.2 released. Download it!
-March 21st, HBase 0.92 Hackathon at StumbleUpon, SF
-February 22nd, HUG12: February HBase User Group at StumbleUpon SF
-December 13th, HBase Hackathon: Coprocessor Edition
-November 19th, Hadoop HUG in London is all about HBase
-November 15-19th, Devoxx features HBase Training and multiple HBase presentations
-October 12th, HBase-related presentations by core contributors and users at Hadoop World 2010
-October 11th, HUG-NYC: HBase User Group NYC Edition (Night before Hadoop World)
-June 30th, HBase Contributor Workshop (Day after Hadoop Summit)
-May 10th, 2010: HBase graduates from Hadoop sub-project to Apache Top Level Project
-Signup for HBase User Group Meeting, HUG10 hosted by Trend Micro, April 19th, 2010
- -HBase User Group Meeting, HUG9 hosted by Mozilla, March 10th, 2010
-Sign up for the HBase User Group Meeting, HUG8, January 27th, 2010 at StumbleUpon in SF
-September 8th, 2010: HBase 0.20.0 is faster, stronger, slimmer, and sweeter tasting than any previous HBase release. Get it off the Releases page.
-ApacheCon in Oakland: November 2-6th, 2009: - The Apache Foundation will be celebrating its 10th anniversary in beautiful Oakland by the Bay. Lots of good talks and meetups including an HBase presentation by a couple of the lads.
-HBase at Hadoop World in NYC: October 2nd, 2009: A few of us will be talking on Practical HBase out east at Hadoop World: NYC.
-HUG7 and HBase Hackathon: August 7th-9th, 2009 at StumbleUpon in SF: Sign up for the HBase User Group Meeting, HUG7 or for the Hackathon or for both (all are welcome!).
-June, 2009 -- HBase at HadoopSummit2009 and at NOSQL: See the presentations
-March 3rd, 2009 -- HUG6: HBase User Group 6
-January 30th, 2009 -- LA Hbackathon:HBase January Hackathon Los Angeles at Streamy in Manhattan Beach
-This page has been retired. The contents have been moved to the - Distributed Operation: Pseudo- and Fully-distributed modes section - in the Reference Guide. -
- - - -- HBase replication is a way to copy data between HBase deployments. It - can serve as a disaster recovery solution and can contribute to provide - higher availability at the HBase layer. It can also serve more practically; - for example, as a way to easily copy edits from a web-facing cluster to a "MapReduce" - cluster which will process old and new data and ship back the results - automatically. -
-- The basic architecture pattern used for HBase replication is (HBase cluster) master-push; - it is much easier to keep track of what’s currently being replicated since - each region server has its own write-ahead-log (aka WAL or HLog), just like - other well known solutions like MySQL master/slave replication where - there’s only one bin log to keep track of. One master cluster can - replicate to any number of slave clusters, and each region server will - participate to replicate their own stream of edits. For more information - on the different properties of master/slave replication and other types - of replication, please consult - How Google Serves Data From Multiple Datacenters. -
-- The replication is done asynchronously, meaning that the clusters can - be geographically distant, the links between them can be offline for - some time, and rows inserted on the master cluster won’t be - available at the same time on the slave clusters (eventual consistency). -
-- The replication format used in this design is conceptually the same as - - MySQL’s statement-based replication . Instead of SQL statements, whole - WALEdits (consisting of multiple cell inserts coming from the clients' - Put and Delete) are replicated in order to maintain atomicity. -
-- The HLogs from each region server are the basis of HBase replication, - and must be kept in HDFS as long as they are needed to replicate data - to any slave cluster. Each RS reads from the oldest log it needs to - replicate and keeps the current position inside ZooKeeper to simplify - failure recovery. That position can be different for every slave - cluster, same for the queue of HLogs to process. -
-- The clusters participating in replication can be of asymmetric sizes - and the master cluster will do its “best effort” to balance the stream - of replication on the slave clusters by relying on randomization. -
-- As of version 0.92 HBase supports master/master and cyclic replication as - well as replication to multiple slaves. -
- -- The guide on enabling and using cluster replication is contained - in the API documentation shipped with your HBase distribution. -
-- The most up-to-date documentation is - - available at this address. -
-- The following sections describe the life of a single edit going from a - client that communicates with a master cluster all the way to a single - slave cluster. -
-- The client uses a HBase API that sends a Put, Delete or ICV to a region - server. The key values are transformed into a WALEdit by the region - server and is inspected by the replication code that, for each family - that is scoped for replication, adds the scope to the edit. The edit - is appended to the current WAL and is then applied to its MemStore. -
-- In a separate thread, the edit is read from the log (as part of a batch) - and only the KVs that are replicable are kept (that is, that they are part - of a family scoped GLOBAL in the family's schema, non-catalog so not - .META. or -ROOT-, and did not originate in the target slave cluster - in - case of cyclic replication). -
-- The edit is then tagged with the master's cluster UUID. - When the buffer is filled, or the reader hits the end of the file, - the buffer is sent to a random region server on the slave cluster. -
-- Synchronously, the region server that receives the edits reads them - sequentially and separates each of them into buffers, one per table. - Once all edits are read, each buffer is flushed using the normal HBase - client (HTables managed by a HTablePool). This is done in order to - leverage parallel insertion (MultiPut). - The master's cluster UUID is retained in the edits applied at the - slave cluster in order to allow cyclic replication. -
-- Back in the master cluster's region server, the offset for the current - WAL that's being replicated is registered in ZooKeeper. -
-- The edit is inserted in the same way. -
-- In the separate thread, the region server reads, filters and buffers - the log edits the same way as during normal processing. The slave - region server that's contacted doesn't answer to the RPC, so the master - region server will sleep and retry up to a configured number of times. - If the slave RS still isn't available, the master cluster RS will select a - new subset of RS to replicate to and will retry sending the buffer of - edits. -
-- In the mean time, the WALs will be rolled and stored in a queue in - ZooKeeper. Logs that are archived by their region server (archiving is - basically moving a log from the region server's logs directory to a - central logs archive directory) will update their paths in the in-memory - queue of the replicating thread. -
-- When the slave cluster is finally available, the buffer will be applied - the same way as during normal processing. The master cluster RS will then - replicate the backlog of logs. -
-- This section describes in depth how each of replication's internal - features operate. -
-- When a master cluster RS initiates a replication source to a slave cluster, - it first connects to the slave's ZooKeeper ensemble using the provided - cluster key (that key is composed of the value of hbase.zookeeper.quorum, - zookeeper.znode.parent and hbase.zookeeper.property.clientPort). It - then scans the "rs" directory to discover all the available sinks - (region servers that are accepting incoming streams of edits to replicate) - and will randomly choose a subset of them using a configured - ratio (which has a default value of 10%). For example, if a slave - cluster has 150 machines, 15 will be chosen as potential recipient for - edits that this master cluster RS will be sending. Since this is done by all - master cluster RSs, the probability that all slave RSs are used is very high, - and this method works for clusters of any size. For example, a master cluster - of 10 machines replicating to a slave cluster of 5 machines with a ratio - of 10% means that the master cluster RSs will choose one machine each - at random, thus the chance of overlapping and full usage of the slave - cluster is higher. -
-- Every master cluster RS has its own znode in the replication znodes hierarchy. - It contains one znode per peer cluster (if 5 slave clusters, 5 znodes - are created), and each of these contain a queue - of HLogs to process. Each of these queues will track the HLogs created - by that RS, but they can differ in size. For example, if one slave - cluster becomes unavailable for some time then the HLogs should not be deleted, - thus they need to stay in the queue (while the others are processed). - See the section named "Region server failover" for an example. -
-- When a source is instantiated, it contains the current HLog that the - region server is writing to. During log rolling, the new file is added - to the queue of each slave cluster's znode just before it's made available. - This ensures that all the sources are aware that a new log exists - before HLog is able to append edits into it, but this operations is - now more expensive. - The queue items are discarded when the replication thread cannot read - more entries from a file (because it reached the end of the last block) - and that there are other files in the queue. - This means that if a source is up-to-date and replicates from the log - that the region server writes to, reading up to the "end" of the - current file won't delete the item in the queue. -
-- When a log is archived (because it's not used anymore or because there's - too many of them per hbase.regionserver.maxlogs typically because insertion - rate is faster than region flushing), it will notify the source threads that the path - for that log changed. If the a particular source was already done with - it, it will just ignore the message. If it's in the queue, the path - will be updated in memory. If the log is currently being replicated, - the change will be done atomically so that the reader doesn't try to - open the file when it's already moved. Also, moving a file is a NameNode - operation so, if the reader is currently reading the log, it won't - generate any exception. -
-- By default, a source will try to read from a log file and ship log - entries as fast as possible to a sink. This is first limited by the - filtering of log entries; only KeyValues that are scoped GLOBAL and - that don't belong to catalog tables will be retained. A second limit - is imposed on the total size of the list of edits to replicate per slave, - which by default is 64MB. This means that a master cluster RS with 3 slaves - will use at most 192MB to store data to replicate. This doesn't account - the data filtered that wasn't garbage collected. -
-- Once the maximum size of edits was buffered or the reader hits the end - of the log file, the source thread will stop reading and will choose - at random a sink to replicate to (from the list that was generated by - keeping only a subset of slave RSs). It will directly issue a RPC to - the chosen machine and will wait for the method to return. If it's - successful, the source will determine if the current file is emptied - or if it should continue to read from it. If the former, it will delete - the znode in the queue. If the latter, it will register the new offset - in the log's znode. If the RPC threw an exception, the source will retry - 10 times until trying to find a different sink. -
-- If replication isn't enabled, the master's logs cleaning thread will - delete old logs using a configured TTL. This doesn't work well with - replication since archived logs passed their TTL may still be in a - queue. Thus, the default behavior is augmented so that if a log is - passed its TTL, the cleaning thread will lookup every queue until it - finds the log (while caching the ones it finds). If it's not found, - the log will be deleted. The next time it has to look for a log, - it will first use its cache. -
-- As long as region servers don't fail, keeping track of the logs in ZK - doesn't add any value. Unfortunately, they do fail, so since ZooKeeper - is highly available we can count on it and its semantics to help us - managing the transfer of the queues. -
-- All the master cluster RSs keep a watcher on every other one of them to be - notified when one dies (just like the master does). When it happens, - they all race to create a znode called "lock" inside the dead RS' znode - that contains its queues. The one that creates it successfully will - proceed by transferring all the queues to its own znode (one by one - since ZK doesn't support the rename operation) and will delete all the - old ones when it's done. The recovered queues' znodes will be named - with the id of the slave cluster appended with the name of the dead - server. -
-- Once that is done, the master cluster RS will create one new source thread per - copied queue, and each of them will follow the read/filter/ship pattern. - The main difference is that those queues will never have new data since - they don't belong to their new region server, which means that when - the reader hits the end of the last log, the queue's znode will be - deleted and the master cluster RS will close that replication source. -
-- For example, consider a master cluster with 3 region servers that's - replicating to a single slave with id '2'. The following hierarchy - represents what the znodes layout could be at some point in time. We - can see the RSs' znodes all contain a "peers" znode that contains a - single queue. The znode names in the queues represent the actual file - names on HDFS in the form "address,port.timestamp". -
--/hbase/replication/rs/ - 1.1.1.1,60020,123456780/ - 2/ - 1.1.1.1,60020.1234 (Contains a position) - 1.1.1.1,60020.1265 - 1.1.1.2,60020,123456790/ - 2/ - 1.1.1.2,60020.1214 (Contains a position) - 1.1.1.2,60020.1248 - 1.1.1.2,60020.1312 - 1.1.1.3,60020, 123456630/ - 2/ - 1.1.1.3,60020.1280 (Contains a position) --
- Now let's say that 1.1.1.2 loses its ZK session. The survivors will race - to create a lock, and for some reasons 1.1.1.3 wins. It will then start - transferring all the queues to its local peers znode by appending the - name of the dead server. Right before 1.1.1.3 is able to clean up the - old znodes, the layout will look like the following: -
--/hbase/replication/rs/ - 1.1.1.1,60020,123456780/ - 2/ - 1.1.1.1,60020.1234 (Contains a position) - 1.1.1.1,60020.1265 - 1.1.1.2,60020,123456790/ - lock - 2/ - 1.1.1.2,60020.1214 (Contains a position) - 1.1.1.2,60020.1248 - 1.1.1.2,60020.1312 - 1.1.1.3,60020,123456630/ - 2/ - 1.1.1.3,60020.1280 (Contains a position) - - 2-1.1.1.2,60020,123456790/ - 1.1.1.2,60020.1214 (Contains a position) - 1.1.1.2,60020.1248 - 1.1.1.2,60020.1312 --
- Some time later, but before 1.1.1.3 is able to finish replicating the - last HLog from 1.1.1.2, let's say that it dies too (also some new logs - were created in the normal queues). The last RS will then try to lock - 1.1.1.3's znode and will begin transferring all the queues. The new - layout will be: -
--/hbase/replication/rs/ - 1.1.1.1,60020,123456780/ - 2/ - 1.1.1.1,60020.1378 (Contains a position) - - 2-1.1.1.3,60020,123456630/ - 1.1.1.3,60020.1325 (Contains a position) - 1.1.1.3,60020.1401 - - 2-1.1.1.2,60020,123456790-1.1.1.3,60020,123456630/ - 1.1.1.2,60020.1312 (Contains a position) - 1.1.1.3,60020,123456630/ - lock - 2/ - 1.1.1.3,60020.1325 (Contains a position) - 1.1.1.3,60020.1401 - - 2-1.1.1.2,60020,123456790/ - 1.1.1.2,60020.1312 (Contains a position) --
- Yes, this is for much later. -
-- You can use the HBase-provided utility called CopyTable from the package - org.apache.hadoop.hbase.mapreduce in order to have a discp-like tool to - bulk copy data. -
-- Yes, this behavior would help a lot but it's not currently available - in HBase (BatchUpdate had that, but it was lost in the new API). -
-- Here's a list of all the jiras that relate to major issues or missing - features in the replication implementation. -
-The below companies have been gracious enough to provide their commerical tool offerings free of charge to the Apache HBase project. -