1. 下载解压GeoMesa HBase二进制包

wget https://github.com/locationtech/geomesa/releases/download/geomesa_2.11-2.3.2/geomesa-hbase_2.11-2.3.2-bin.tar.gz
tar -zxvf geomesa-hbase_2.11-2.3.2-bin.tar.gz

因为开源许可的限制,有几个jar包需要手动执行安装,进入geomesa-hbase bin 目录执行

sh install-jai.sh
sh install-jline.sh

2. 配置环境变量

# 编辑 /etc/profile
vim /etc/profile
# geomesa_hbase
export GEOMESA_HBASE_HOME=/home/local/geomesa-hbase_2.11-2.3.2
export PATH=$PATH:$GEOMESA_HBASE_HOME/bin
export GEOMESA_HADOOP_CLASSPATH=$HADOOP_HOME
export GEOMESA_HBASE_CLASSPATH=$HBASE_HOME
# 生效环境变量
source /etc/profile

3. HBase安装GeoMesa运行时jar,并注册协处理器(Coprocessors)

# hadoop fs -put ${GEOMESA_HBASE_HOME}/dist/hbase/geomesa-hbase-distributed-runtime-$VERSION.jar ${hbase.dynamic.jars.dir}/
# 官方文档上的这个命令不生效,手动拷贝jar到hbase/lib下
cp $GEOMESA_HBASE_HOME/dist/hbase/geomesa-hbase-distributed-runtime_2.11-2.3.2.jar $HBASE_HOME/lib

注册HBase 协处理器(Coprocessors) 使hbase运行时能够访问geomesa-hbase-distributed-runtimejar包,hbase conf/hbase-site.xml添加如下内容:

<property>
	<name>hbase.coprocessor.user.region.classes</name>
	<value>org.locationtech.geomesa.hbase.coprocessor.GeoMesaCoprocessor</value>
</property>

4. 验证

下载构建 geomesa-tutorials

git clone https://github.com/geomesa/geomesa-tutorials.git
cd geomesa-tutorials
# 构建指定模块
mvn clean package -pl geomesa-tutorials-hbase/geomesa-tutorials-hbase-quickstart -am 
# 执行quickstart例子,注意替换版本号
java -cp geomesa-tutorials-hbase/geomesa-tutorials-hbase-quickstart/target/geomesa-tutorials-hbase-quickstart-2.4.0-SNAPSHOT.jar \
     org.geomesa.example.hbase.HBaseQuickStart \
     --hbase.zookeepers localhost           \
     --hbase.catalog quick-start-example