1 Star 1 Fork 1

sungaoyong / geomesa-nifi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

GeoMesa NiFi

GeoMesa-NiFi allows you to ingest data into GeoMesa using the NiFi dataflow framework. Currently, the following datastores are supported:

  • Accumulo
  • HBase
  • Kafka
  • FileSystem (HDFS, S3)

Building from Source

To build, simply clone and build with maven:

git clone git@github.com:geomesa/geomesa-nifi.git
cd geomesa-nifi
mvn clean install

Dependency Versions

The nar contains bundled dependencies. To change the dependency versions, modify the <accumulo.version>, <hbase.version> and/or <kafka.version> properties in the pom.xml before building.

Installation

To install the GeoMesa processors you will need to copy the appropriate nar file into the lib directory of your NiFi installation. There is currently a single nar file:

Nar Datastores
geomesa-nifi-nar-$VERSION.nar Accumulo, HBase, Kafka

For example, to install the nar after building from source:

cp geomesa-nifi/geomesa-nifi-nar/target/geomesa-nifi-nar-$VERSION.nar $NIFI_HOME/lib/

Upgrading

In order to upgrade, replace the geomesa-nifi-nar files with the latest version. For version-specific changes, see Upgrade Path.

SFTs and Converters

GeoMesa NiFi nar files package a set of predefined SimpleFeatureType schema definitions and GeoMesa Converter definitions for popular data sources including:

  • Twitter
  • GDelt
  • OpenStreetMaps

The full list of converters can be found in the GeoMesa source:

https://github.com/locationtech/geomesa/tree/master/geomesa-tools/conf/sfts

Defining custom SFTs and Converters

There are two ways of providing custom SFTs and converters:

  • Providing a reference.conf file via a jar in the lib dir
  • Providing the config definitions via the Processor configuration

SFTs and Converters on the Classpath

To bundle configuration in a jar file simply place your config in a file named reference.conf and place it in a jar file:

jar cvf data-formats.jar reference.conf

You can verify your jar was building properly:

$ jar tvf data-formats.jar
     0 Mon Mar 20 18:18:36 EDT 2017 META-INF/
    69 Mon Mar 20 18:18:36 EDT 2017 META-INF/MANIFEST.MF
 28473 Mon Mar 20 14:49:54 EDT 2017 reference.conf

Definining SFTs and Converters via the UI

The preferred way of providing SFTs and Converters is direction in the Processor configuration via the NiFi UI. Simply copy/paste your typesafe configuration into the SftSpec and ConverterSpec property fields.

Processors

This project provides the following processors:

  • PutGeoMesaAccumulo - Ingest data into GeoMesa Accumulo
  • PutGeoMesaHBase - Ingest data into GeoMesa HBase
  • PutGeoMesaKafka - Ingest data into GeoMesa Kafka
  • PutGeoTools - Ingest data into an arbitrary GeoTools Datastore based on parameters using a GeoMesa converter or avro
  • ConvertToGeoAvro - Use a GeoMesa converter to create geoavro

PutGeoMesaAccumulo

The PutGeoMesaAccumulo processor is used for ingesting data into an Accumulo backed GeoMesa datastore. To use this processor first add it to the workspace and open the properties tab of its configuration. Descriptions of the properties are given below:

Property Description
Mode Converter or Avro file ingest mode switch.
SftName Name of the SFT on the classpath to use. This property overrides SftSpec.
ConverterName Name of converter on the classpath to use. This property overrides ConverterSpec.
FeatureNameOverride Override the feature name on ingest.
SftSpec SFT specification String. Overwritten by SftName if SftName is valid.
ConverterSpec Converter specification string. Overwritten by ConverterName if ConverterName is valid.
accumulo.instance.id Accumulo instance ID
accumulo.zookeepers Comma separated list of zookeeper IPs or hostnames
accumulo.user Accumulo username with create-table and write permissions
accumulo.password Accumulo password for given username
accumulo.visibilities Accumulo scan visibilities
accumulo.catalog Name of the table to write to. If using namespaces be sure to include that in the name.
accumulo.write.threads Number of threads to use when writing data to GeoMesa, has a linear effect on CPU and memory usage
geomesa.stats.enable Enable stats table generation
accumulo.mock Use a mock instance of Accumulo
GeoMesa Configuration Service Configuration service to use. More about this feature below.

GeoMesa Configuration Service

The PutGeoMesa plugin supports NiFi Controller Services to manage common configurations. This allows the user to specify a single location to store the Accumulo connection parameters. This allows you to add new PutGeoMesa processors without having to enter duplicate data.

To add the GeomesaConfigControllerService access the Contoller Settings from NiFi global menu and navigate to the ControllerServices tab and click the + to add a new service. Search for the GeomesaConfigControllerService and click add. Edit the new service and enter the appropriate values for the properties listed.

To use this feature, after configuring the service, select the appropriate Geomesa Config Controller Service from the drop down of the GeoMesa Configuration Service property. When a controller service is selected the accumulo.zookeepers, accumulo.instance.id, accumulo.user, accumulo.password and accumulo.catalog parameters are not required or used.

PutGeoMesaHBase

The PutGeoMesaHBase processor is used for ingesting data into an HBase backed GeoMesa datastore. To use this processor first add it to the workspace and open the properties tab of its configuration. Descriptions of the properties are given below:

Property Description
Mode Converter or Avro file ingest mode switch.
SftName Name of the SFT on the classpath to use. This property overrides SftSpec.
ConverterName Name of converter on the classpath to use. This property overrides ConverterSpec.
FeatureNameOverride Override the feature name on ingest.
SftSpec SFT specification String. Overwritten by SftName if SftName is valid.
ConverterSpec Converter specification string. Overwritten by ConverterName if ConverterName is valid.
hbase.catalog The base Catalog table name for GeoMesa in HBase
hbase.coprocessor.url A path to a jar file (likely the HBase distributed runtime, likely in HDFS) containing the GeoMesa HBase coprocessors
hbase.security.enabled Enable HBase Security (Visibilities)

PutGeoMesaKafka

The PutGeoMesaKafka processor is used for ingesting data into a Kafka backed GeoMesa datastore. This processor only supports Kafka 0.9 and newer. To use this processor first add it to the workspace and open the properties tab of its configuration. Descriptions of the properties are given below:

Property Description
Mode Converter or Avro file ingest mode switch.
SftName Name of the SFT on the classpath to use. This property overrides SftSpec.
ConverterName Name of converter on the classpath to use. This property overrides ConverterSpec.
FeatureNameOverride Override the feature name on ingest.
SftSpec SFT specification String. Overwritten by SftName if SftName is valid.
ConverterSpec Converter specification string. Overwritten by ConverterName if ConverterName is valid.
kafka.brokers List of Kafka brokers
kafka.zookeepers Comma separated list of zookeeper IPs or hostnames
kafka.zk.path Zookeeper path to Kafka instance
kafka.topic.partitions Number of partitions to use in Kafka topics
kafka.topic.replication Replication factor to use in Kafka topics

PutGeoTools

The PutGeoTools processor is used for ingesting data into a GeoTools compatible datastore. To use this processor first add it to the workspace and open the properties tab of its configuration. Descriptions of the properties are given below:

Property Description
Mode Converter or Avro file ingest mode switch.
SftName Name of the SFT on the classpath to use. This property overrides SftSpec.
ConverterName Name of converter on the classpath to use. This property overrides ConverterSpec.
FeatureNameOverride Override the feature name on ingest.
SftSpec SFT specification String. Overwritten by SftName if SftName is valid.
ConverterSpec Converter specification string. Overwritten by ConverterName if ConverterName is valid.
DataStoreName Name of the datastore to ingest data into.

This processor also accepts dynamic parameters that may be needed for the specific datastore that you're trying to access.

ConvertToGeoAvro

The ConvertToGeoAvro processor leverages GeoMesa's internal converter framework to convert features into Avro and pass them along as a flow to be used by other processors in NiFi. To use this processor first add it to the workspace and open the properties tab of its configuration. Descriptions of the properties are given below:

Property Description
Mode Converter or Avro file ingest mode switch.
SftName Name of the SFT on the classpath to use. This property override SftSpec.
ConverterName Name of converter on the classpath to use. This property overrides ConverterSpec.
FeatureNameOverride Override the feature name on ingest.
SftSpec SFT specification String. Overwritten by SftName if SftName is valid.
ConverterSpec Converter specification string. Overwritten by ConverterName if ConverterName is valid.
OutputFormat Only Avro is supported at this time.

Upgrade Path

1.3.x to 1.4.x

The PutGeoMesaKafka_09 and PutGeoMesaKafka_10 processors have been merged into a single PutGeoMesaKafka processor that will work with both Kafka 09 and 10.

The configuration parameters for the following processors have changed:

  • PutGeoMesaAccumulo
  • PutGeoMesaHBase
  • PutGeoMesaKafka

See Processors for more details.

NiFi User Notes

NiFi allows you to ingest data into GeoMesa from every source GeoMesa supports and more. Some of these sources can be tricky to setup and configure. Here we detail some of the problems we've encountered and how to resolve them.

GetHDFS Processor with Azure Integration

It is possible to use the Hadoop Azure Support to access Azure Blob Storage using HDFS. You can leverage this capability to have the GetHDFS processor pull data directly from the Azure Blob store. However, due to how the GetHDFS processor was written, the fs.defaultFS configuration property is always used when accessing wasb:// URIs. This means that the wasb:// container you want the GetHDFS processor to connect to must be hard coded in the HDFS core-site.xml config. This causes two problems. Firstly, it implies that we can only connect to one container in one account on Azure. Secondly, it causes problems when using NiFi on a server that is also running GeoMesa-Accumulo as the fs.defaultFS property needs to be set to the proper HDFS master NameNode.

There are two ways to circumvent this problem. You can maintain a core-site.xml file for each container you want to access but this is not easily scalable or maintainable in the long run. The better option is to leave the default fs.defaultFS value in the HDFS core-site.xml file. We can then leverage the Hadoop Configuration Resources property in the GetHDFS processor. Normally you would set the Hadoop Configuration Resources property to the location of the core-site.xml and the hdfs-site.xml files. Instead we are going to create an additional file and include it last in the path so that it overwrites the value of the fs.defaultFS when the configuration object is built. To do this simply create a new xml file with an appropriate name (we suggest the name of the container). Insert the fs.defaultFS property into the file and set the value.

<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value>wasb://container@accountName.blob.core.windows.net/</value>
    </property>
</configuration>

Reference

For more information on setting up or using NiFi see the Apache NiFi User Guide

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS

简介

Nifi Processors for ingesting and converting geo data using GeoMesa and GeoTools 展开 收起
Scala
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Scala
1
https://gitee.com/sungaoyong/geomesa-nifi.git
git@gitee.com:sungaoyong/geomesa-nifi.git
sungaoyong
geomesa-nifi
geomesa-nifi
master

搜索帮助

14c37bed 8189591 565d56ea 8189591