2016-11-14 15:21:29 +01:00
---
title: Clustering
2018-08-01 11:01:02 +02:00
parent: Guides
weight: 33
2016-11-14 15:21:29 +01:00
---
2025-04-02 12:25:08 +03:00
hawkBit is able to run in a cluster. This guide provides insights in the basic concepts and how to
2024-11-05 11:41:56 +02:00
setup your own cluster. You can find additional information in
2024-11-27 08:14:52 +02:00
the [hawkBit runtimes's README ](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-monolith/hawkbit-update-server/README.md ).
2018-08-01 11:01:02 +02:00
<!--more-->
2016-11-14 15:21:29 +01:00
2018-08-01 11:01:02 +02:00
## Big picture
2016-11-14 15:21:29 +01:00
2018-08-01 11:01:02 +02:00

2016-11-14 15:21:29 +01:00
2018-08-01 11:01:02 +02:00
## Events
2016-11-14 15:21:29 +01:00
2024-11-05 11:41:56 +02:00
Event communication between nodes is based on [Spring Cloud Bus ](https://cloud.spring.io/spring-cloud-bus/ )
and [Spring Cloud Stream ](http://docs.spring.io/spring-cloud-stream/docs/current/reference/htmlsingle/ ). There are
different [binder implementations ](http://docs.spring.io/spring-cloud-stream/docs/current/reference/htmlsingle/#_binders )
available. The _ hawkbit Update Server _ uses RabbitMQ binder. Every node gets his own queue to receive cluster events,
the default payload is JSON.
If an event is thrown locally at one node, it will be automatically delivered to all other available nodes via the
Spring Cloud Bus's topic exchange:
2016-11-14 15:21:29 +01:00
2018-08-01 11:01:02 +02:00

2016-11-14 15:21:29 +01:00
Via the ServiceMatcher you can check whether an event happened locally at one node or on a different node.
`serviceMatcher.isFromSelf(event)`
2018-08-01 11:01:02 +02:00
## Caching
2016-11-14 15:21:29 +01:00
2024-11-05 11:41:56 +02:00
Every node is maintaining its own caches independent from other nodes. So there is no globally shared/synchronized cache
instance within the cluster. In order to keep nodes in sync a TTL (time to live) can be set for all caches to ensure
that after some time the cache is refreshed from the database. To enable the TTL just set the property "
hawkbit.cache.global.ttl" (value in milliseconds). Of course you can implement a shared cache, e.g. Redis.
2024-10-04 10:21:03 +03:00
See [CacheAutoConfiguration ](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/cache/CacheAutoConfiguration.java )
2016-11-14 15:21:29 +01:00
2018-08-01 11:01:02 +02:00
## Schedulers
2016-11-14 15:21:29 +01:00
2024-11-05 11:41:56 +02:00
Every node has multiple schedulers which run after a defined period of time. All schedulers always run on every node.
2025-04-02 12:25:08 +03:00
This has to be kept in mind e.g. if the scheduler executes critical code which has to be executed only once. This is implemented via using, by default, distributed database based lock.
2016-11-14 15:21:29 +01:00
2018-08-01 11:01:02 +02:00
## Known constraints
2016-11-14 15:21:29 +01:00
2018-08-01 11:01:02 +02:00
### Denial-of-Service (DoS) filter
2024-11-05 11:41:56 +02:00
hawkBit owns the feature of guarding itself from DoS attacks,
2024-11-12 12:06:56 +02:00
a [DoS filter ](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/security/DosFilter.java ).
2024-11-05 11:41:56 +02:00
It reduces the maximum number of requests per seconds which can be configured for read and write requests.
This mechanism is only working for every node separately, i.e. in a cluster environment the worst-case behaviour would
be that the maximum number of requests per seconds will be increased to its product if every request is handled by a
different node.
2016-11-14 15:21:29 +01:00
The same constraint exists with the validator to check if a user tried too many logins within a defined period of time.