GeoMesa-Accumulo安装并运行示例

来源:互联网 发布:提现接口网站 php 编辑:程序博客网 时间:2024/06/04 23:31

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

安装geomesa

git clone https://github.com/locationtech/geomesa.gitcd geomesamvn clean install -DskipTests=true
  • 1
  • 2
  • 3

安装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
  • 1

设置accumulo命令行工具

在geomesa-accumulo_2.11-1.3.0/conf下的geomesa-env.sh中加入hadoop和accumulo根目录

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

运行配置文件

bin/geomesa configure
  • 1

一路y

环境变量

.bashrc或.bash_profile中加入

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

source .bash_profile

Geomesa-tutorials下载

git clone https://github.com/geomesa/geomesa-tutorials.gitcd geomesa-tutorialsmvn clean install -pl geomesa-quickstart-accumulo
  • 1
  • 2
  • 3
  • 4
  • 5

运行示例程序

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
  • 1

会看到:

Creating feature-type (schema):  AccumuloQuickStartThe version of ZooKeeper being used doesn't support Container nodes. CreateMode.PERSISTENT will be used instead.Creating new featuresInserting new featuresSubmitting query1.  Bierce|931|Sat Jul 05 06:25:38 CST 2014|POINT (-76.51304097832912 -37.49406125975311)|null2.  Bierce|394|Sat Aug 02 07:55:05 CST 2014|POINT (-77.42555615743139 -37.26710898726304)|null3.  Bierce|343|Wed Aug 06 16:59:22 CST 2014|POINT (-76.66826220670282 -37.44503877750368)|null4.  Bierce|259|Fri Aug 29 03:59:30 CST 2014|POINT (-76.90122194030118 -37.148525741002466)|null5.  Bierce|640|Mon Sep 15 03:48:25 CST 2014|POINT (-77.36222958792739 -37.13013846773835)|null6.  Bierce|322|Wed Jul 16 05:09:42 CST 2014|POINT (-77.01760098223343 -37.30933767159561)|null7.  Bierce|925|Mon Aug 18 11:28:33 CST 2014|POINT (-76.5621106573523 -37.34321201566148)|null8.  Bierce|589|Sat Jul 05 14:02:15 CST 2014|POINT (-76.88146600670152 -37.40156607152168)|null9.  Bierce|886|Wed Jul 23 02:12:36 CST 2014|POINT (-76.59795732474399 -37.18420917493149)|nullSubmitting secondary index queryFeature ID Observation.859 | Who: BierceFeature ID Observation.355 | Who: BierceFeature ID Observation.940 | Who: BierceFeature ID Observation.631 | Who: BierceFeature ID Observation.817 | Who: BierceSubmitting secondary index query with sorting (sorted by 'What' descending)Feature ID Observation.999 | Who: Addams | What: 999Feature ID Observation.996 | Who: Addams | What: 996Feature ID Observation.993 | Who: Addams | What: 993Feature ID Observation.990 | Who: Addams | What: 990Feature ID Observation.987 | Who: Addams | What: 987
原创粉丝点击