2016-11-14 15:21:29 +01:00
---
title: Run hawkBit
2018-08-01 11:01:02 +02:00
parent: Guides
weight: 31
2016-11-14 15:21:29 +01:00
---
2024-11-05 11:41:56 +02:00
In this guide we describe how to run a full featured hawkBit setup based on a production ready infrastructure. It is
based on the hawkBit example modules and update server.
2016-11-14 15:21:29 +01:00
2019-01-31 07:29:27 +01:00
<!--more-->
2016-11-14 15:21:29 +01:00
2018-08-01 11:01:02 +02:00
{{% note %}}
2024-11-05 11:41:56 +02:00
The update server can in fact be run stand alone. However, only with an embedded H2, no Device Management Federation API
and no artifact storage.
2018-08-01 11:01:02 +02:00
{{% /note %}}
2016-11-14 15:21:29 +01:00
2018-08-01 11:01:02 +02:00
## System Architecture
2019-01-31 07:29:27 +01:00
2016-11-14 15:21:29 +01:00
This guide describes a target architecture that is more like one that you will expect in a production system.
2024-11-27 08:14:52 +02:00
- hawkBit [Update Server ](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-monolith/hawkbit-update-server ).
2016-11-14 15:21:29 +01:00
- [MariaDB ](https://mariadb.org ) for the repository.
- [RabbitMQ ](https://www.rabbitmq.com ) for DMF communication.
- For testing and demonstration purposes we will also use:
2024-10-04 10:21:03 +03:00
- [hawkBit Device Simulator ](https://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-device-simulator ).
- [hawkBit Management API example client ](https://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-example-mgmt-feign-client ).
2016-11-14 15:21:29 +01:00
2018-08-01 11:01:02 +02:00
## Prerequisites
2019-01-31 07:29:27 +01:00
2024-10-04 10:21:03 +03:00
- You have a working [hawkBit core build ](https://github.com/eclipse-hawkbit/hawkbit ).
- You have a working [hawkBit examples build ](https://github.com/eclipse-hawkbit/hawkbit-examples ).
2016-11-14 15:21:29 +01:00
## Adapt hawkBit Update Server and Device Simulator to your environment.
2024-11-05 11:41:56 +02:00
As mentioned you can create your own application with hawkBit inside or adapt the existing example app. The second
option will be shown here.
2016-11-14 15:21:29 +01:00
2017-03-30 08:46:31 +02:00
### Configure MariaDB/MySQL connection settings.
2016-11-14 15:21:29 +01:00
2024-11-05 11:41:56 +02:00
For this you can either edit the existing _ application.properties _ or create
a [new profile ](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config-profile-specific-properties ).
2016-11-14 15:21:29 +01:00
2019-01-31 07:29:27 +01:00
```properties
2016-11-14 15:21:29 +01:00
spring.jpa.database=MYSQL
2023-03-28 07:16:25 +02:00
spring.datasource.url=jdbc:mariadb://localhost:3306/YOUR_SCHEMA
2016-11-14 15:21:29 +01:00
spring.datasource.username=YOUR_USER
spring.datasource.password=YOUR_PWD
spring.datasource.driverClassName=org.mariadb.jdbc.Driver
2018-08-01 11:01:02 +02:00
```
2016-11-14 15:21:29 +01:00
2024-11-05 11:41:56 +02:00
Note: On Ubuntu 18.04 with MariaDB 10.1 installed from the default repository via apt install _ COLLATE option _ of
database have to be changed manually to "latin1".
For recent versions of MariaDB running on Ubuntu this is not required (
cf. [system variables ](https://mariadb.com/kb/en/differences-in-mariadb-in-debian-and-ubuntu ), [issue ](https://github.com/eclipse-hawkbit/hawkbit/issues/963 ))
2020-10-02 14:11:13 +02:00
2016-11-14 15:21:29 +01:00
### Configure RabbitMQ connection settings for update server and device simulator (optional).
2024-11-05 11:41:56 +02:00
We provide already defaults that should work with a standard Rabbit installation. Otherwise configure the following in
the `application.properties` of the two services:
2016-11-14 15:21:29 +01:00
2019-01-31 07:29:27 +01:00
```properties
2016-11-14 15:21:29 +01:00
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
spring.rabbitmq.virtualHost=/
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
2018-08-01 11:01:02 +02:00
```
2016-11-14 15:21:29 +01:00
2024-10-04 10:21:03 +03:00
### Adapt hostname of example scenario [creation script](https://github.com/eclipse-hawkbit/hawkbit-examples/blob/master/hawkbit-example-mgmt-simulator/src/main/resources/application.properties)
2016-11-14 15:21:29 +01:00
Should only be necessary if your system does not run on localhost or uses a different port than the example app.
Adapt `application.properties` in this case:
2019-01-31 07:29:27 +01:00
```properties
2016-11-14 15:21:29 +01:00
hawkbit.url=localhost:8080
2018-08-01 11:01:02 +02:00
```
2019-01-31 07:29:27 +01:00
2016-11-14 15:21:29 +01:00
or provide the parameter on command line:
2019-01-31 07:29:27 +01:00
```properties
2016-11-14 15:21:29 +01:00
hawkbit-example-mgmt-simulator-##VERSION ##.jar --hawkbit.url=YOUR_HOST:PORT
2018-08-01 11:01:02 +02:00
```
2016-11-14 15:21:29 +01:00
## Compile & Run
2019-01-31 07:29:27 +01:00
### Compile & Run your _"production ready"_ app
2016-11-14 15:21:29 +01:00
2024-11-27 08:14:52 +02:00
see [update server ](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-monolith/hawkbit-update-server )
2016-11-14 15:21:29 +01:00
2024-10-04 10:21:03 +03:00
### Compile & Run example scenario [creation script](https://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-example-mgmt-simulator) (optional)
2016-11-14 15:21:29 +01:00
2024-11-05 11:41:56 +02:00
This has to be done before the device simulator is started. hawkBit creates the mandatory tenant metadata with first
login into either Management API (which is done by this client).
2016-11-14 15:21:29 +01:00
2024-11-05 11:41:56 +02:00
However, this is not done by _ DMF _ which is in fact used by the device simulator, i.e. without calling _ Management API _
first hawkBit would drop all _ DMF _ messages as the tenant is unknown.
2016-11-14 15:21:29 +01:00
2019-01-31 07:29:27 +01:00
### Compile & Run device simulator (optional)
2016-11-14 15:21:29 +01:00
2024-10-04 10:21:03 +03:00
see [device simulator ](https://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-device-simulator )
2016-11-14 15:21:29 +01:00
2019-01-31 07:29:27 +01:00
# Enjoy hawkBit with a real database, artifact storage and all [interfaces](../../apis/) available