Skip to content

Getting started

Anton Medviediev edited this page May 3, 2017 · 12 revisions

Running DeviceHive Server as a standalone application

Prerequisites

In order to use DeviceHive framework you must have the following components installed and configured:

Build packages

  • Download source code from GitHub using "Download ZIP" button. It should always point to recent stable or beta release, but you always can get any other tag or branch. It also can be done using one of Git version control client or git command line tool. If you prefer git, clone project using command

git clone https://github.com/devicehive/devicehive-java-server.git

After that you can switch to the tag or branch you need. The list of all available releases can be found at https://github.com/devicehive/devicehive-java-server/releases Execute following command from ${devicehive-java-server-directory}.

mvn clean package

If there are no errors, compilation and packaging are completed and you can go to the next step.

Running Apache Kafka

Start Zookeeper and Apache Kafka brokers as explained at official documentation (http://kafka.apache.org/documentation.html#quickstart). If your Kafka brokers are installed on the different machines, please specify their hostname/ports at app.properties file. You need to update zookeeper.connect (zookeeper's contact point) and bootstrap.servers (list of brokers) properties.

Starting database

  • After you have downloaded and installed PostgreSQL (see https://wiki.postgresql.org/wiki/Detailed_installation_guides) you have to create new user. This step is required for database migrations to work properly. By default, DH expects that the username is postgres and the password is 12345. You can change this in the DH configuration files.
  • Create database with the name devicehive using user that have been created at step 1. This user should be owner of database.
  • Database schema will be initialized on application startup.

Running application

  • To start application, you have to start the backend and the frontend. To do this, first run following command:

java -jar ${devicehive-java-server-directory}/devicehive-backend/target/devicehive-backend-<version>-boot.jar

Wait for the application to start, then run:

java -jar ${devicehive-java-server-directory}/devicehive-frontend/target/devicehive-frontend-<version>-boot.jar

This will start embedded undertow application server on default port 8080 and deploy DeviceHive application.

Clone this wiki locally