Device Connectivity Made Easy

Focus on your product and innovation and leave communication and management to DeviceHive.

Get Started

Deployment with Docker

Overview

The easiest way to try DeviceHive locally or in your development datacenter is to deploy it using Docker Compose.

This will start complete DeviceHive.com server running:

  • devicehive frontend
  • devicehive backend
  • kafka
  • zookeeper
  • postresql
  • admin console

Configure

  1. Install Docker Compose using official instructions.
  2. git clone https://github.com/devicehive/devicehive-docker.git
  3. cd rdbms-image

Configure

PostgreSQL

  • ${DH_POSTGRES_ADDRESS} — Address of PostgreSQL server instance.
  • ${DH_POSTGRES_PORT} — Port of PostgreSQL server instance. Default: 5432. Igonred if ${DH_POSTGRES_ADDRESS} is undefined.
  • ${DH_POSTGRES_DB} — PostgreSQL database name for DeviceHive meta data. It is assumed that it already exists and either blank or has been initialized by DeviceHive. Ignored if ${DH_POSTGRES_ADDRESS} is undefined.
  • ${DH_POSTGRES_USERNAME} and ${DH_POSTGRES_PASSWORD} — login/password for DeviceHive user in PostgreSQL that have full access to ${DH_POSTGRES_DB}. Igonred if ${DH_POSTGRES_ADDRESS} is undefined.

Kafka

To enable DeviceHive to communicate over Apache Kafka message bus to scale out and interoperate with other componets, such us Apache Spark, or to enable support of Apache Cassandra for fast and scalable storage of device messages define the following environment variables:

  • ${DH_KAFKA_ADDRESS} — Address of Apache Kafka broker node. If no address is defined DeviceHive will run in standalone mode.
  • ${DH_KAFKA_PORT} — Port of Apache Kafka broker node. Igonred if ${DH_KAFKA_ADDRESS} is undefined.
  • ${DK_ZH_ADDRESS} — Comma-separated list of addressed of ZooKeeper instances. Ignored if ${DH_KAFKA_ADDRESS} is undefined.
  • ${DK_ZK_PORT} — Port of ZooKeeper instances. Ignored if ${DH_KAFKA_ADDRESS} is undefined.
  • ${DH_RPC_SERVER_REQ_CONS_THREADS} — Kafka request consumer threads, defaults to 1.
  • ${DH_RPC_SERVER_WORKER_THREADS} — Server worker threads, defaults to 1.
  • ${DH_RPC_SERVER_DISR_WAIT_STRATEGY} — Disruptor wait strategy, defaults to blocking. Available options are: sleeping, yielding, busy-spin.
  • ${DH_RPC_CLIENT_RES_CONS_THREADS} — Kafka response consumer threads, defaults to 1.

More configurable parameters at devicehive-start.sh and devicehive-start.sh.

Run

In order to run DeviceHive stack in Docker containers, define environment variables as per your requirements and run:

docker-compose up

you can access your DeviceHive API http://devicehive-host-url/api.

Deployment with Docker