blob: af5216e11988342abbfdb97686c650d5775a03ae [file]
<!DOCTYPE html>
<html>
<!--Head section for CSS/Javascript -->
<head>
<meta charset="utf-8">
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<meta name="description" content="IoT Software Update">
<meta name="author" content="">
<!--base to have relative path for offline navigation -->
<title>Eclipse hawkBit - IoT Software Update</title>
<!--Stylesheets-->
<!-- Bootstrap 3.3.1 -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<!-- Font Awesome Icons -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../../css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />
<!-- Custom CSS -->
<link href="../../css/hawkbit.css" rel="stylesheet">
<!--Javascript-->
<!-- JQuery 2.1.1-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Bootstrap 3.3.1 JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../../js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
</head>
<body>
<!--Header section Site navigation -->
<!--base to have relative path for offline navigation -->
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../../index.html">Eclipse hawkBit™</a>
</div>
<div class="collapse navbar-collapse wow fadeIn" id="navbar-collapse" data-wow-delay="0.2s">
<ul class="nav navbar-nav pull-right">
<li >
<a href="../../news/index.html">News</a>
</li>
<li >
<a href="../../documentation/overview/introduction.html">Documentation</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<style>#forkongithub a{background:#8d0c0c;color:#fff;text-decoration:none;font-family:Arial, Helvetica, sans-serif;text-align:center;font-weight:bold;padding:5px 40px;font-size:12px;line-height:3rem;position:relative;transition:0.5s;}#forkongithub a:hover{background:#c11;color:#fff;}#forkongithub a::before,#forkongithub a::after{content:"";width:100%;display:block;position:absolute;top:1px;left:0;height:1px;background:#fff;}#forkongithub a::after{bottom:1px;top:auto;}@media screen and (min-width:800px){#forkongithub{position:fixed;display:block;top:0;right:0;width:50px;overflow:visible;height:200px;z-index:9999;}#forkongithub a{width:260px;position:absolute;top:40px;right:-60px;transform:rotate(45deg);-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);}}</style><span id="forkongithub"><a href="https://github.com/eclipse/hawkbit">Fork me on GitHub</a></span>
<!-- /.container -->
</nav>
<div id="header_wrapper" class="container">
<div class="nav-bar col-md-3">
<nav class="navmenu navmenu-default" role="navigation">
<ul class="nav navmenu-nav">
<!--base to have relative path for offline navigation -->
<li>
Introduction
<ul class="nav navmenu-nav">
<!-- 2nd level -->
<!--base to have relative path for offline navigation -->
<li >
<a href="../../documentation/overview/introduction.html">Overview</a>
</li>
<li >
<a href="../../documentation/overview/features.html">Features</a>
</li>
<li >
<a href="../../documentation/overview/getting-started.html">Getting Started</a>
</li>
</ul>
</li>
<li>
Concepts
<ul class="nav navmenu-nav">
<!-- 2nd level -->
<!--base to have relative path for offline navigation -->
<li >
<a href="../../documentation/architecture/architecture.html">Architecture</a>
</li>
<li >
<a href="../../documentation/architecture/datamodel.html">Data model</a>
</li>
<li >
<a href="../../documentation/architecture/targetstate.html">Target States</a>
</li>
</ul>
</li>
<li>
Interfaces
<ul class="nav navmenu-nav">
<!-- 2nd level -->
<!--base to have relative path for offline navigation -->
<li >
<a href="../../documentation/interfaces/interfaces.html">Overview</a>
</li>
<li >
<a href="../../documentation/interfaces/management-ui.html">Management UI</a>
</li>
<li >
<a href="../../documentation/interfaces/management-api.html">Management API</a>
</li>
<li >
<a href="../../documentation/interfaces/ddi-api.html">DDI API</a>
</li>
<li >
<a href="../../documentation/interfaces/dmf-api.html">DMF API</a>
</li>
</ul>
</li>
<li>
Security
<ul class="nav navmenu-nav">
<!-- 2nd level -->
<!--base to have relative path for offline navigation -->
<li >
<a href="../../documentation/security/security.html">Overview</a>
</li>
</ul>
</li>
<li>
Guides
<ul class="nav navmenu-nav">
<!-- 2nd level -->
<!--base to have relative path for offline navigation -->
<li >
<a href="../../documentation/guide/runhawkbit.html">Build and Run hawkBit</a>
</li>
<li >
<a href="../../documentation/guide/clustering.html">Clustering</a>
</li>
<li >
<a href="../../documentation/guide/customtheme.html">Theme Customization</a>
</li>
<li >
<a href="../../documentation/guide/feignclient.html">Create Feign Client</a>
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div id="page" class="col-md-9">
<div class="inner">
<div id="maincontainer">
<section id="top" class="documentation-section">
<div class="row">
<div class="span8 offset3">
<!--base to have relative path for offline navigation -->
<h1 id="cluster">Cluster</h1>
<p><em>hawkBit</em> is able to run in a cluster with some constraints. This guide provides insights in the basic concepts and how to setup your own cluster. You can find additional information in the <a href="https://github.com/eclipse/hawkbit/blob/master/examples/hawkbit-example-app/README.md">hawkbit example app’s README</a>.</p>
<h1 id="big-picture">Big picture</h1>
<p><img src="../images/overall_cluster.png" alt="" width="100%" /></p>
<h1 id="events">Events</h1>
<p>Event communication between nodes is based on <a href="https://cloud.spring.io/spring-cloud-bus/">Spring Cloud Bus</a> and <a href="http://docs.spring.io/spring-cloud-stream/docs/current/reference/htmlsingle/">Spring Cloud Stream</a>. There are different <a href="http://docs.spring.io/spring-cloud-stream/docs/current/reference/htmlsingle/#_binders">binder implementations</a> available. The <em>hawkbit example app</em> 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:</p>
<p><img src="../images/eventing-within-cluster.png" alt="" width="100%" /></p>
<p>Via the ServiceMatcher you can check whether an event happened locally at one node or on a different node.
<code>serviceMatcher.isFromSelf(event)</code></p>
<h1 id="caching">Caching</h1>
<p>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.
See <a href="https://github.com/eclipse/hawkbit/blob/master/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/cache/CacheAutoConfiguration.java">CacheAutoConfiguration</a></p>
<h1 id="schedulers">Schedulers</h1>
<p>Every node has multiple schedulers which run after a defined period of time. All schedulers always run on every node. This has to be kept in mind e.g. if the scheduler executes critical code which has to be executed only once.</p>
<h1 id="known-constraints">Known constraints</h1>
<h2 id="ui-sessions">UI sessions</h2>
<p>As of today <em>hawkBit</em> isn’t storing user sessions in a shared, clusterwide cache. Session is only bound to the node where the login took place. If this node is going down for whatever reason, the session is lost and the user is forced to login again.
In case that’s not an option, you can help yourself by introducing a shared session cache based on e.g. Redis.
Furthermore <em>hawkBit</em> isn’t supporting session stickiness out of the box either. However most of the well known load balancers out there can solve this issue.</p>
<h2 id="caching-of-download-ids">Caching of download IDs</h2>
<p>The downloadId is generated and stored in the DownloadIdCache. It is used for downloading an artifact.
In <em>hawkbit</em> exists an interface called “<a href="https://github.com/eclipse/hawkbit/blob/master/hawkbit-core/src/main/java/org/eclipse/hawkbit/cache/DownloadIdCache.java">DownloadIdCache</a>” and one implementation of it: “DefaultDownloadIdCache”. This default implementation can’t be used within a cluster. Its containing data is only available inside one node and can’t be shared with other nodes. E.g. the downloadId which is stored in this cache after authentication on node A can only be used for downloading the artifact by node A.
In a cluster-capable environment this fact can lead to issues as it could happen, that the downloadId is stored on node A and node B would like to download the artifact by means of the downloadId which is not available on node B. To solve this issue you can use a cluster-shared cache e.g. Redis or create a new cluster-aware implementation of the interface “DownloadIdCache”.</p>
<h2 id="denial-of-service-dos-filter">Denial-of-Service (DoS) filter</h2>
<p><em>hawkbit</em> owns the feature of guarding itself from DoS attacks, a <a href="https://github.com/eclipse/hawkbit/blob/master/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/DosFilter.java">DoS filter</a>. 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.
The same constraint exists with the validator to check if a user tried too many logins within a defined period of time.</p>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-md-4">
<h3 class="footer-links-header">Quick Links</h3>
<ul class="footer-links clearfix">
<li><a href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a></li>
<li><a href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</a></li>
<li><a href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a></li>
<li><a href="http://www.eclipse.org/legal/">Legal</a></li>
</ul>
<ul class="footer-links clearfix">
<li><a href="http://www.eclipse.org">Eclipse Home</a></li>
<li><a href="http://marketplace.eclipse.org/">Market Place</a></li>
<li><a href="http://live.eclipse.org/">Eclipse Live</a></li>
<li><a href="http://www.planeteclipse.org/">Eclipse Planet</a></li>
</ul>
</div>
<div class="col-md-2">
</div>
</footer>
<!--/.Footer-->
</body>
</html>