Importer is costum created script in scala to ingest data to Geomesa. Also it is possible to create, delete and list catalog schemas. List operation show results only in Importer container logs.
$ docker run -d --name some-name -e broker=some-broker -e username=some-username -e password=some-password -e instanceID=some-instance -e zookeepers=some-zookeeper -e topic="geomesa/#" -e topicAdmin="geomesaADMIN" image:tag
Where:
some-name is name you want to assign to your containersome-broker is URL of mqtt broker that Importer will connect to and listen on specified topicssome-username is Accumulo username used to access databasesome-password is Accumulo password for specified usernamesome-instance is Accumulo instanceID (usually Accumulo)some-zookeeper is Zookeeper endpoint that Accumulo useimage is Docker image nametag is Docker image versionTopic and topicAdmin presents topic where Importer will listen and do actions based on incoming messages on them. It is recommended to use our topics.
Topic is used for ingesting data, while topicAdmin is used for operations with schemas.
broker
This is required variable. It specifies URL of mqtt broker that Importer will connect to and listen on specified topics.
username
This is required variable. It specifies Accumulo username used to access database.
password
This is required variable. It specifies Accumulo password for specified username.
instanceID
This is required variable. It specifies instanceID name (usually Accumulo).
zookeepers
This is required variable. It specifies Zookeeper endpoint at which Importer will connect. It must be same Zookeeper that Accumulo use.
TZ
This is optional variable. It specifes timezone. Default value is Europe/Zagreb.
To create schema publish to mqtt topicAdmin following payload:
'{"action":"create","catalog":"geomesa.catalog","schemaname":"schema1","schema":"device_id:String:index=true,*geometry:Point:srid=4326","user-data":{"geomesa.z3.interval":"week","geomesa.xz.precision":"12"}}'
where:
action - defines schema action (create for create, list for list, delete for delete)catalog - defines catalog where schema will be created. It must be defined in form namespace.catalog (namespace where Geomesa jar was loaded)schemaname - defines schema nameschema - defines schema structure to create. Check Geomesa documentation to learn how to define schema structure.user-data - defines non-required costum user-data supported by Geomesa. Check Geomesa documentation to learn what user-data is available. If not passing user-data remove user-data section from payload.To delete schema publish to mqtt topicAdmin following payload:
'{"action":"delete","catalog":"geomesa.catalog","schemaname":"schema1"}'
where:
action - defines schema action (create for create, list for list, delete for delete)catalog - defines catalog name where schema is created. It must be defined in form namespace.catalogschemaname - defines schema name for deleteTo list all catalog schema publish to mqtt topicAdmin following payload:
'{"action":"list","catalog":"geomesa.catalog"}'
where:
action - defines schema action (create for create, list for list, delete for delete)catalog - defines catalog name. It must be defined in form namespace.catalogTo ingest data check costum python script inside this repo. Function arguments are:
data - csv file used for ingestingindices - csv file fields used to create index to prevent ingesting same data multiple times. If None, all fields are used.catalog - catalog name to ingest dataschema - schema name to ingest datamqtt_ip - mqtt to publish data. Must be same mqtt where Importer listen.Example payload to publish is:
{"device_id":"device_id","type":"type","geometry":"POINT (X Y)","timestamp":"2019-12-31T22:00:00.000","value":4.2,"tags":"source=source,city=city,altitude=altitude","INDEX":["device_id","type","geometry","timestamp"]}
Content type
Image
Digest
Size
713.3 MB
Last updated
about 5 years ago
docker pull dalmatialab/importer