User Tools

Site Tools

Table of Contents

IoTivity + DOCKER

If you are working or deploying a cloud based IoTivity solution, you have to build and deploy more then one component. The IoTivity cloud stack is composed of 4 subsystems, Interface, Account Server, Resource Dictionary and Message Queue. These components also have some dependencies as the Apache Kafka, the Zookeeper and the MongoDB.

To start a development is bit tedious and requires preparation of an whole environment. In case of a production or a test deployment, you have to install all dependencies on the machine. In case of a multi-node system you have to define what will run on which machine without orchestration possibilities.

Because of these demands the IoTivity was dockerized. Each cloud subsystem is in the separate Docker Container.

Setup Docker

Follow official steps for the Docker CE installation here.
When you've successfully installed the Docker, initialize the Docker Swarm. More info about the Swarm can be found here.

docker swarm init

If you're setting up an environment with multiple machines, for example cluster of Amazon EC2s, run that command on one of the instances and others should join this manager. After executing the command you'll get as response the command for other EC2 instances.

Docker compose file

The docker compose file contains all required services for running the whole IoTivity cloud stack. You can of course run container separately if you need.

Docker compose file is available from version 1.3 and you can find it here.

Now you can access IoTivity Cloud Interface on it's default port 5683.

If you're running IoTivity Cloud stack on multiple nodes of the Docker Wwarm, they are distributed automatically and you can use address of any node/manager in swarm to access IoTivity cloud regardless the node when it's running. Docker Swarm has it's own DNS and knows which service is listening on port 5683.

If you want to stop the IoTivity cloud stack, execute:

docker stack rm iotivity

Enjoy and if you have any questions, open a question on the Stackoverflow with the tag iotivity.