This page explains how to do a basic installation of the HBase Indexer on a single machine.
这篇会讲解如何在单机中进行Hbase Indexer的基础安装。
Before you start, make sure that you have the required software installed (they can all be running on single machine).
在开始之前,请确认你已经安装了所有需要的软件(他们可以都可以在单机运行)。
获取Hbase Indexer(Get the HBase Indexer)
Check out the code and build the tar.gz distribution.
签出代码并生成tar.gz的发布包。
1 | git clone git://github.com/NGDATA/hbase-indexer.git |
Next, unpackage the tar.gz distribution (in the example below it is unpacked under your $HOME directory).
接下来,解压tar.gz发布包(这个例子中,他被解压到$HOME目录)。
1 | tar zxvf hbase-indexer-dist/target/hbase-indexer-1.0-SNAPSHOT.tar.gz -C ~ |
配置Hbase Indexer(Configure HBase Indexer)
In the hbase-indexer directory, edit the file conf/hbase-indexer-site.xml and configure the ZooKeeper connection string (twice, once for hbase-indexer, and once for hbase, alternatively you can copy your hbase-site.xmlto the conf directory).
在hbase-indexer目录,编辑conf/hbase-indexer-site.xml 文件并配置ZooKeeper的连接串(两次,一次用于hbase-indexer,一次用于Hbase,或者你可以拷贝你的hbase-site.xml到你的conf目录)。
1 | <property> |
If you have not defined JAVA_HOME globally, and the bin/hbase-indexer script would complain it doesn’t find you Java, you can set the JAVA_HOME in the script conf/hbase-indexer-env.sh.
如果你没有定义全局的JAVA_HOME,bin/hbase-indexer脚本会报没有找到Java,你可以通过运行conf/hbase-indexer-env.sh来设置JAVA_HOME。
配置Hbase(Configure HBase)
In order to use the HBase Indexer, replication must be enabled in HBase. There are also a number of other HBase settings that can be set to optimize the working of the HBase indexer.
为了运行Hbase Indexer,复制集必须开启。同时还有一些HBase的设置需要配置以便优代Hbase Indexer的运行。
Add the settings below to your hbase-site.xml configuration on all HBase region servers, and restart HBase.
所有的分区服务上的hbase-site.xml添加如下配置,然后重启Hbase。
1 | <configuration> |
添加Indexer jar到HBase(Add indexer jars to HBase)
The HBase Indexer includes two jar files that need to be in the classpath of HBase. Copy these from the lib directory of the unpacked hbase-indexer installation into the lib directory of HBase for each region server.
Hbase Indexer包含两个jar文件需要在Hbase的类目录下。将解压目录hbase-indexer下的lib中的这些文件拷贝到所有Hbase分区服务器的lib目录。
1 | cp lib/hbase-sep-* $HBASE_HOME/lib |
启动Solr(Start Solr)
Ensure that Solr is running. In general, it’s easiest to have Solr use the same ZooKeeper instance as HBase.
确保Solr已经运行。通常,很容易让Hbase和Solr共用相同的ZooKeeper。
Assuming that you’ve downloaded Solr 4.2.0 and you’re running ZooKeeper on the current machine, you can start up the base Solr in cloud mode using the example schema as follows:
假设你已经下载了Solr 4.2.0并且ZooKeeper运行在当前机器,你可能通过下列脚本在云模式运行Solr。
1 | cd $SOLR_HOME/example |