blob: ba671f6fd11970e516e847f267312b22952d1ba8 [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="run-hawkbit">Run hawkBit</h1>
<p>In this guide we describe how to run a full featured hawkBit setup based on a production ready infrastructure. It is based on the <em>hawkBit</em> example modules. We call these <em>examples</em> as we expect that developers who intend to create a <em>hawkBit</em> based IoT application on their own will create a custom <a href="http://projects.spring.io/spring-boot/">Spring Boot</a> app based on <em>hawkBit</em> as demonstrated with the <a href="https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-example-app">hawkBit example app</a>.</p>
<p>Note: the example app can in fact be run <a href="https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-example-app">stand alone</a>. However, only with an embedded H2, no <a href="https://github.com/eclipse/hawkbit/wiki/Device-Management-Federation-API">Device Management Federation API</a> and no artifact storage.</p>
<p>This guide will focus on a complete setup that includes all <em>hawkBit</em> features.</p>
<h1 id="system-architecture">System Architecture</h1>
<p>This guide describes a target architecture that is more like one that you will expect in a production system.</p>
<ul>
<li>hawkBit Update Server <a href="https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-example-app">example app</a>.</li>
<li><a href="https://mariadb.org">MariaDB</a> for the repository.</li>
<li><a href="https://www.mongodb.org">MongoDB</a> for artifact storage.</li>
<li><a href="https://www.rabbitmq.com">RabbitMQ</a> for DMF communication.</li>
<li>For testing and demonstration purposes we will also use:</li>
<li><a href="https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-device-simulator">hawkBit Device Simulator</a>.</li>
<li><a href="https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-mgmt-api-client">hawkBit Management API example client</a>.</li>
</ul>
<h1 id="prerequisites">Prerequisites</h1>
<ul>
<li>You have a MongoDB (&gt;= 3.0), RabbitMQ and MariaDB/MySQL installed and running in your environment.</li>
<li>You have a working <a href="https://github.com/eclipse/hawkbit">hawkBit build</a>.</li>
</ul>
<h1 id="steps">Steps</h1>
<h2 id="adapt-hawkbit-update-server-and-device-simulator-to-your-environment">Adapt hawkBit Update Server and Device Simulator to your environment.</h2>
<p>As mentioned you can create your own application with <em>hawkBit</em> inside or adapt the existing example app. The second option will be shown here.</p>
<h3 id="set-mariadb-dependency-to-compile-in-the-example-app-pomhttpsgithubcomeclipsehawkbitblobmasterexampleshawkbit-example-apppomxml">Set MariaDB dependency to compile in the <a href="https://github.com/eclipse/hawkbit/blob/master/examples/hawkbit-example-app/pom.xml">example App POM</a></h3>
<figure class="highlight"><pre><code class="language-plaintext" data-lang="plaintext">&lt;dependency&gt;
&lt;groupId&gt;org.mariadb.jdbc&lt;/groupId&gt;
&lt;artifactId&gt;mariadb-java-client&lt;/artifactId&gt;
&lt;scope&gt;compile&lt;/scope&gt;
&lt;/dependency&gt;</code></pre></figure>
<h3 id="configure-mariadbmysql-and-mongodb-connection-settings">Configure MariaDB/MySQL and MongoDB connection settings.</h3>
<p>For this you can either edit the existing <em>application.properties</em> or create a <a href="http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config-profile-specific-properties">new profile</a>.</p>
<figure class="highlight"><pre><code class="language-plaintext" data-lang="plaintext">spring.jpa.database=MYSQL
spring.datasource.url=jdbc:mysql://localhost:3306/YOUR_SCHEMA
spring.datasource.username=YOUR_USER
spring.datasource.password=YOUR_PWD
spring.datasource.driverClassName=org.mariadb.jdbc.Driver
spring.data.mongodb.uri=mongodb://localhost/hawkbitArtifactRepository</code></pre></figure>
<h3 id="configure-rabbitmq-connection-settings-for-update-server-and-device-simulator-optional">Configure RabbitMQ connection settings for update server and device simulator (optional).</h3>
<p>We provide already defaults that should work with a standard Rabbit installation. Otherwise configure the following in the <code>application.properties</code> of the two services:</p>
<figure class="highlight"><pre><code class="language-plaintext" data-lang="plaintext">spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
spring.rabbitmq.virtualHost=/
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672</code></pre></figure>
<h3 id="adapt-hostname-of-example-scenario-creation-scripthttpsgithubcomeclipsehawkbittreemasterexampleshawkbit-mgmt-api-client-optional">Adapt hostname of example scenario <a href="https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-mgmt-api-client">creation script</a> (optional)</h3>
<p>Should only be necessary if your system does not run on localhost or uses a different port than the example app.</p>
<p>Adapt <code>application.properties</code> in this case:</p>
<figure class="highlight"><pre><code class="language-plaintext" data-lang="plaintext">hawkbit.url=localhost:8080</code></pre></figure>
<p>or provide the parameter on command line:</p>
<figure class="highlight"><pre><code class="language-plaintext" data-lang="plaintext">hawkbit-example-mgmt-simulator-##VERSION##.jar --hawkbit.url=YOUR_HOST:PORT</code></pre></figure>
<h2 id="compile--run">Compile &amp; Run</h2>
<h3 id="compile--run-your-production-ready-app">Compile &amp; Run your <em>“production ready”</em> app.</h3>
<p>see <a href="https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-example-app">example app</a></p>
<h3 id="compile--run-example-scenario-creation-scripthttpsgithubcomeclipsehawkbittreemasterexampleshawkbit-mgmt-api-client-optional">Compile &amp; Run example scenario <a href="https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-mgmt-api-client">creation script</a> (optional).</h3>
<p>This has to be done before the device simulator is started. <em>hawkBit</em> creates the mandatory tenant metadata with first login into either <em>Management UI</em> or API (which is done by this client).</p>
<p>However, this is not done by <em>DMF</em> which is in fact used by the device simulator, i.e. without calling <em>Management API</em> first <em>hawkBit</em> would drop all <em>DMF</em> messages as the tenant is unknown.</p>
<h3 id="compile--run-device-simulator-optional">Compile &amp; Run device simulator (optional).</h3>
<p>see <a href="https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-device-simulator">device simulator</a></p>
<h2 id="enjoy-hawkbit-with-a-real-database-artifact-storage-and-all-interfaceshttpsgithubcomeclipsehawkbitwikiinterfaces-available">Enjoy hawkBit with a real database, artifact storage and all <a href="https://github.com/eclipse/hawkbit/wiki/Interfaces">interfaces</a> available.</h2>
<p><img src="../images/gettingStartedResult.png" alt="" width="100%" /></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>