GeoMesa-Accumulo安装并运行示例


参考官网
http://www.geomesa.org/documentation/tutorials/geomesa-quickstart-accumulo.html

##安装geomesa

git clone https://github.com/locationtech/geomesa.git
cd geomesa
mvn clean install -DskipTests=true

##安装zookeeper
将ZooKeeper启动
bin/zkServer.sh start

##安装accumulo
http://blog.csdn.net/qiaojialin/article/details/60571984
bin/start-all.sh

启动accumulo会有个警告,默认打开文件数为256,推荐XXX。没找到在哪配置

##安装Geomesa-accumulo分布式运行库
这里有编译好的,下载一个1.3.0的就可以了
https://repo.locationtech.org/content/repositories/geomesa-releases/org/locationtech/geomesa/geomesa-accumulo-dist_2.11/
解压缩

将geomesa-accumulo_2.11-1.3.0/dist/accumulo/geomesa-accumulo-distributed-runtime_2.11-1.3.0.jar 复制到ACCUMULO_HOME/lib/ext 下,如果有两个jar包,复制一个就好,不要raster的。我这里只有一个,官网说有两个。

##安装namespace
用geomesa-accumulo_2.11-1.3.0/bin下的setup-namespace.sh脚本设置用户名密码和namespace

./setup-namespace.sh -u root -p root -n myNamespace

##设置accumulo命令行工具
在geomesa-accumulo_2.11-1.3.0/conf下的geomesa-env.sh中加入hadoop和accumulo根目录

export HADOOP_HOME=/Users/qiaojialin/Documents/hadoop-2.7.3
export ACCUMULO_HOME=/Users/qiaojialin/Documents/accumulo-1.8.1

运行配置文件

bin/geomesa configure

一路y

##环境变量
.bashrc或.bash_profile中加入

export GEOMESA_ACCUMULO_HOME=/Users/qiaojialin/Documents/geomesa-accumulo_2.11-1.3.0
export PATH=${GEOMESA_ACCUMULO_HOME}/bin:$PATH

source .bash_profile

##Geomesa-tutorials下载

git clone https://github.com/geomesa/geomesa-tutorials.git

cd geomesa-tutorials

mvn clean install -pl geomesa-quickstart-accumulo

##运行示例程序

java -cp target/geomesa-quickstart-accumulo-1.3.0.0-m3-SNAPSHOT.jar com.example.geomesa.accumulo.AccumuloQuickStart -instanceId accumulo-instance -zookeepers localhost -user root -password root -tableName testgeomesa

会看到:

Creating feature-type (schema):  AccumuloQuickStart
The version of ZooKeeper being used doesn't support Container nodes. CreateMode.PERSISTENT will be used instead.
Creating new features
Inserting new features
Submitting query
1.  Bierce|931|Sat Jul 05 06:25:38 CST 2014|POINT (-76.51304097832912 -37.49406125975311)|null
2.  Bierce|394|Sat Aug 02 07:55:05 CST 2014|POINT (-77.42555615743139 -37.26710898726304)|null
3.  Bierce|343|Wed Aug 06 16:59:22 CST 2014|POINT (-76.66826220670282 -37.44503877750368)|null
4.  Bierce|259|Fri Aug 29 03:59:30 CST 2014|POINT (-76.90122194030118 -37.148525741002466)|null
5.  Bierce|640|Mon Sep 15 03:48:25 CST 2014|POINT (-77.36222958792739 -37.13013846773835)|null
6.  Bierce|322|Wed Jul 16 05:09:42 CST 2014|POINT (-77.01760098223343 -37.30933767159561)|null
7.  Bierce|925|Mon Aug 18 11:28:33 CST 2014|POINT (-76.5621106573523 -37.34321201566148)|null
8.  Bierce|589|Sat Jul 05 14:02:15 CST 2014|POINT (-76.88146600670152 -37.40156607152168)|null
9.  Bierce|886|Wed Jul 23 02:12:36 CST 2014|POINT (-76.59795732474399 -37.18420917493149)|null
Submitting secondary index query
Feature ID Observation.859 | Who: Bierce
Feature ID Observation.355 | Who: Bierce
Feature ID Observation.940 | Who: Bierce
Feature ID Observation.631 | Who: Bierce
Feature ID Observation.817 | Who: Bierce
Submitting secondary index query with sorting (sorted by 'What' descending)
Feature ID Observation.999 | Who: Addams | What: 999
Feature ID Observation.996 | Who: Addams | What: 996
Feature ID Observation.993 | Who: Addams | What: 993
Feature ID Observation.990 | Who: Addams | What: 990
Feature ID Observation.987 | Who: Addams | What: 987

转载自:https://blog.csdn.net/qiaojialin/article/details/60572149

You may also like...

退出移动版