-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
Getting Started | ||
=============== | ||
############### | ||
.. toctree:: | ||
:maxdepth: 1 | ||
:hidden: | ||
|
||
prerequisites | ||
start-metadata-repository | ||
|
||
Alright, you have read basic information of the IoTCrawler components and have brief idea about the overall architecture. Now, you want to run an | ||
instance of IoTCrawler. Before, we get into the specifics of IoTCrawler components, it is advised to install all the :doc:`prerequisites` installed on your machine. | ||
|
||
Once you have installed the prerequisites, you are ready to :doc:`start-metadata-repository`, which is one of the core components of the IoTCrawler. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Prerequisites | ||
############# | ||
Install the following tools before you star working with any tutorial of IoTCrawler. | ||
|
||
Git | ||
*** | ||
Download and install the latest version of `git <https://git-scm.com/downloads>`_. | ||
|
||
cURL | ||
**** | ||
Download and install the latest version of `cURL <https://curl.haxx.se/download.html>`_ tool. | ||
|
||
Docker and Docker Compose | ||
************************* | ||
Download and install the latest version of `Docker <https://docs.docker.com/engine/install/>`_ and `Docker Compose <https://docs.docker.com/compose/install/>`_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Start MetaData Repository | ||
|
||
Download the [Docker Compose](https://github.com/IoTCrawler/iotcrawler-samples/blob/master/getting-started/mdr/docker-compose-mdr.yml) file, go to the directory and run following command. | ||
|
||
``` | ||
docker-compose up -f docker-compose-mdr.yml -d | ||
``` | ||
|
||
This will start the docker containers for kafka, postgres, zookeeper and scorpio broker. Output of the command will be similar to following. | ||
|
||
``` | ||
Creating network "mdr_default" with the default driver | ||
Creating mdr_zookeeper_1 ... done | ||
Creating mdr_postgres_1 ... done | ||
Creating mdr_kafka_1 ... done | ||
Creating mdr_scorpio_1 ... done | ||
``` | ||
|
||
You can check the running containers with following command. | ||
|
||
``` | ||
docker ps -a | ||
``` | ||
|
||
If everything is running fine then you are ready to add your first entity. Use the following command. | ||
|
||
``` | ||
curl -X POST 'http://localhost:9090/ngsi-ld/v1/entities/' --header 'Content-Type: application/ld+json' -d '{ | ||
"id": "house1:smartrooms:room1", | ||
"type": "Room", | ||
"temperature": { | ||
"value": 21, | ||
"unitCode": "CEL", | ||
"type": "Property", | ||
"providedBy": { | ||
"type": "Relationship", | ||
"object": "smartbuilding:house1:sensor001" | ||
} | ||
}, | ||
"isPartOf": { | ||
"type": "Relationship", | ||
"object": "smartcity:houses:house1" | ||
}, | ||
"@context": [{"Room": "urn:mytypes:room", "temperature": "myuniqueuri:temperature", "isPartOf": "myuniqueuri:isPartOf"},"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"] | ||
}' | ||
``` | ||
|
||
You can get the entity back with following request. | ||
|
||
``` | ||
curl http://localhost:9090/ngsi-ld/v1/entities/house1:smartrooms:room1 | ||
``` | ||
|
||
You can remove the containers and clean your environment when you are finished. | ||
|
||
``` | ||
docker-compose -f docker-compose-mdr.yml down | ||
``` |