| <!DOCTYPE html> |
| <html lang="en"> |
| |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| |
| <title>Build DistributedLog from Source</title> |
| <meta name="description" content="Apache DistributedLog is an high performance replicated log. |
| "> |
| |
| <link rel="stylesheet" href="/docs/latest/styles/site.css"> |
| <link rel="stylesheet" href="/docs/latest/css/theme.css"> |
| <!-- JQuery --> |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> |
| <script src="/docs/latest/js/bootstrap.min.js"></script> |
| <link rel="canonical" href="http://bookkeeper.apache.org/distributedlog/docs/latest/start/building.html" data-proofer-ignore> |
| <link rel="alternate" type="application/rss+xml" title="Apache DistributedLog" href="http://bookkeeper.apache.org/distributedlog/docs/latest/feed.xml"> |
| <!-- Font Awesome --> |
| <script src="//cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.0/anchor.min.js"></script> |
| <!-- Google Analytics --> |
| <script> |
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
| |
| ga('create', 'UA-83870961-1', 'auto'); |
| ga('send', 'pageview'); |
| </script> |
| <!-- End Google Analytics --> |
| <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico"> |
| </head> |
| |
| |
| <body role="document"> |
| |
| |
| <nav class="navbar navbar-default navbar-fixed-top"> |
| <div class="container"> |
| <div class="navbar-header"> |
| <a href="/" class="navbar-brand" > |
| <img alt="Brand" style="height: 28px" src="/docs/latest/images/distributedlog_logo_navbar.png"> |
| </a> |
| <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> |
| <span class="sr-only">Toggle navigation</span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </button> |
| </div> |
| <div id="navbar" class="navbar-collapse collapse"> |
| <ul class="nav navbar-nav"> |
| <!-- Overview --> |
| <li><a href="/docs/latest/">V0.5.0</a></li> |
| <!-- Concepts --> |
| <li><a href="/docs/latest/basics/introduction">Concepts</a></li> |
| <!-- Quick Start --> |
| <li> |
| <a href="/docs/latest/start" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Start<span class="caret"></span></a> |
| <ul class="dropdown-menu" role="menu"> |
| |
| |
| <li> |
| <a href="/docs/latest/start/building.html"> |
| Build DistributedLog from Source |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/start/download.html"> |
| Download Releases |
| </a> |
| </li> |
| |
| <li role="separator" class="divider"></li> |
| <li class="dropdown-header"><strong>Quickstart</strong></li> |
| |
| |
| <li> |
| <a href="/docs/latest/start/quickstart.html"> |
| Setup & Run Example |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/tutorials/basic-1.html"> |
| API - Write Records (via core library) |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/tutorials/basic-2.html"> |
| API - Write Records (via write proxy) |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/tutorials/basic-5.html"> |
| API - Read Records |
| </a> |
| </li> |
| |
| <li role="separator" class="divider"></li> |
| <li class="dropdown-header"><strong>Deployment</strong></li> |
| |
| |
| <li> |
| <a href="/docs/latest/deployment/cluster.html"> |
| Cluster Setup |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/deployment/global-cluster.html"> |
| Global Cluster Setup |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/deployment/docker.html"> |
| Docker |
| </a> |
| </li> |
| |
| </ul> |
| </li> |
| <!-- API --> |
| <li> |
| <a href="/docs/latest/start" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">API<span class="caret"></span></a> |
| <ul class="dropdown-menu" role="menu"> |
| <li><a href="/docs/latest/api/java">Java</a></li> |
| </ul> |
| </li> |
| <!-- User Guide --> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">User Guide<span class="caret"></span></a> |
| <ul class="dropdown-menu"> |
| |
| |
| <li> |
| <a href="/docs/latest/basics/introduction.html"> |
| Introduction |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/user_guide/considerations/main.html"> |
| Considerations |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/user_guide/architecture/main.html"> |
| Architecture |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/user_guide/api/main.html"> |
| API |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/user_guide/configuration/main.html"> |
| Configuration |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/user_guide/design/main.html"> |
| Detail Design |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/user_guide/globalreplicatedlog/main.html"> |
| Global Replicated Log |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/user_guide/implementation/main.html"> |
| Implementation |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/user_guide/references/main.html"> |
| References |
| </a> |
| </li> |
| |
| </ul> |
| </li> |
| <!-- Admin Guide --> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Admin Guide<span class="caret"></span></a> |
| <ul class="dropdown-menu"> |
| <li><a href="/docs/latest/deployment/cluster">Cluster Setup</a></li> |
| |
| |
| <li> |
| <a href="/docs/latest/admin_guide/operations.html"> |
| Operations |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/admin_guide/loadtest.html"> |
| Load Test |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/admin_guide/performance.html"> |
| Performance Tuning |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/admin_guide/hardware.html"> |
| Hardware |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/admin_guide/monitoring.html"> |
| Monitoring |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/admin_guide/zookeeper.html"> |
| ZooKeeper |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/admin_guide/bookkeeper.html"> |
| BookKeeper |
| </a> |
| </li> |
| |
| </ul> |
| </li> |
| <!-- Tutorials --> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Tutorials<span class="caret"></span></a> |
| <ul class="dropdown-menu"> |
| <li class="dropdown-header"><strong>Basic</strong></li> |
| <li><a href="/docs/latest/tutorials/basic-1">Write Records (via Core Library)</a></li> |
| <li><a href="/docs/latest/tutorials/basic-2">Write Records (via Write Proxy)</a></li> |
| <li><a href="/docs/latest/tutorials/basic-3">Write Records to multiple streams</a></li> |
| <li><a href="/docs/latest/tutorials/basic-4">Atomic Write Records</a></li> |
| <li><a href="/docs/latest/tutorials/basic-5">Tailing Read Records</a></li> |
| <li><a href="/docs/latest/tutorials/basic-6">Rewind Read Records</a></li> |
| <li role="separator" class="divider"></li> |
| <li class="dropdown-header"><strong>Messaging</strong></li> |
| |
| |
| <li> |
| <a href="/docs/latest/tutorials/messaging-1.html"> |
| Write records to partitioned streams |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/tutorials/messaging-2.html"> |
| Write records to multiple streams (load balancer) |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/tutorials/messaging-3.html"> |
| At-least-once Processing |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/tutorials/messaging-4.html"> |
| Exact-Once Processing |
| </a> |
| </li> |
| |
| <li> |
| <a href="/docs/latest/tutorials/messaging-5.html"> |
| Implement a kafka-like pub/sub system |
| </a> |
| </li> |
| |
| <li role="separator" class="divider"></li> |
| <li class="dropdown-header"><strong>Replicated State Machines</strong></li> |
| |
| |
| <li> |
| <a href="/docs/latest/tutorials/replicatedstatemachines.html"> |
| Build replicated state machines |
| </a> |
| </li> |
| |
| <li role="separator" class="divider"></li> |
| <li class="dropdown-header"><strong>Analytics</strong></li> |
| <li><a href="/docs/latest/tutorials/analytics-mapreduce">Process log streams using MapReduce</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div><!--/.nav-collapse --> |
| </div> |
| </nav> |
| |
| |
| <link rel="stylesheet" href=""> |
| |
| |
| <div class="container" role="main"> |
| |
| <div class="row"> |
| |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| |
| <div class="col-md-8 col-md-offset-2"> |
| <div class="contents topic" id="this-page-covers-how-to-build-distributedlog-0-5-0-from-sources"> |
| <p class="topic-title first">This page covers how to build DistributedLog 0.5.0 from sources.</p> |
| <ul class="simple"> |
| <li><a class="reference internal" href="#build-distributedlog" id="id1">Build DistributedLog</a><ul> |
| <li><a class="reference internal" href="#build" id="id2">Build</a></li> |
| <li><a class="reference internal" href="#scala-versions" id="id3">Scala Versions</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="section" id="build-distributedlog"> |
| <h2><a class="toc-backref" href="#id1">Build DistributedLog</a></h2> |
| <p>In order to build DistributedLog you need the source code. Either <a class="reference external" href="/docs/latest/download">download the source of a release</a> or <a class="reference external" href="https://github.com/apache/distributedlog">clone the git repository</a>.</p> |
| <p>In addition you need <strong>Maven 3</strong> and a <strong>JDK</strong> (Java Development Kit). DistributedLog requires <strong>at least Java 7</strong> to build. We recommend using Java 8.</p> |
| <p>To clone from git, enter:</p> |
| <figure class="code"><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span> |
| </pre></td><td class="code"><pre><code class="bash"><span class="line"><span></span>git clone https://github.com/apache/distributedlog |
| </span></code></pre></td></tr></table></div></figure><p>The simplest way of building DistributedLog is by running:</p> |
| <figure class="code"><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span> |
| </pre></td><td class="code"><pre><code class="bash"><span class="line"><span></span>mvn clean package -DskipTests |
| </span></code></pre></td></tr></table></div></figure><p>This instructs <a class="reference external" href="http://maven.apache.org">Maven</a> (<cite>mvn</cite>) to first remove all existing builds (<cite>clean</cite>) and then create a new DistributedLog package(<cite>package</cite>). The <cite>-DskipTests</cite> command prevents Maven from executing the tests.</p> |
| <div class="section" id="build"> |
| <h3><a class="toc-backref" href="#id2">Build</a></h3> |
| <ul class="simple"> |
| <li>Build all the components without running tests</li> |
| </ul> |
| <figure class="code"><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span> |
| </pre></td><td class="code"><pre><code class="bash"><span class="line"><span></span>mvn clean package -DskipTests |
| </span></code></pre></td></tr></table></div></figure><ul class="simple"> |
| <li>Build all the components and run all the tests</li> |
| </ul> |
| <figure class="code"><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span> |
| </pre></td><td class="code"><pre><code class="bash"><span class="line"><span></span>mvn clean package |
| </span></code></pre></td></tr></table></div></figure><ul class="simple"> |
| <li>Build a single component: as distributedlog is using shade plugin. shade only run when packaging so pre-install the dependencies before building a single component.</li> |
| </ul> |
| <figure class="code"><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span> |
| <span class="line-number">2</span> |
| </pre></td><td class="code"><pre><code class="bash"><span class="line"><span></span>mvn clean install -DskipTests |
| </span><span class="line">mvn -pl :<module-name> package <span class="o">[</span>-DskipTests<span class="o">]</span> // example: mvn-pl :distributedlog-core package |
| </span></code></pre></td></tr></table></div></figure><ul class="simple"> |
| <li>Test a single class: as distributedlog is using shade plugin. shade only run when packaging so pre-install the dependencies before building a single component.</li> |
| </ul> |
| <figure class="code"><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span> |
| <span class="line-number">2</span> |
| </pre></td><td class="code"><pre><code class="bash"><span class="line"><span></span>mvn clean install -DskipTests |
| </span><span class="line">mvn -pl :<module-name> clean <span class="nb">test</span> -Dtest<span class="o">=</span><test-class-name> |
| </span></code></pre></td></tr></table></div></figure></div> |
| <div class="section" id="scala-versions"> |
| <h3><a class="toc-backref" href="#id3">Scala Versions</a></h3> |
| <p>DistributedLog has dependencies such as <a class="reference external" href="https://twitter.github.io/util/">Twitter Util</a>, <a class="reference external" href="https://twitter.github.io/finagle/">Finagle</a> written in <a class="reference external" href="http://scala-lang.org">Scala</a>. Users of the Scala API and libraries may have to match the Scala version of DistributedLog with the Scala version of their projects (because Scala is not strictly backwards compatible).</p> |
| <p><strong>By default, DistributedLog is built with the Scala 2.11</strong>. To build DistributedLog with Scala <em>2.10</em>, you can change the default Scala <em>binary version</em> with the following script:</p> |
| <figure class="code"><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span> |
| <span class="line-number">2</span> |
| <span class="line-number">3</span> |
| <span class="line-number">4</span> |
| </pre></td><td class="code"><pre><code class="bash"><span class="line"><span></span><span class="c1"># Switch Scala binary version between 2.10 and 2.11</span> |
| </span><span class="line">tools/change-scala-version.sh <span class="m">2</span>.10 |
| </span><span class="line"><span class="c1"># Build with Scala version 2.10</span> |
| </span><span class="line">mvn clean install -DskipTests |
| </span></code></pre></td></tr></table></div></figure><p>DistributedLog is developed against Scala <em>2.11</em> and tested additionally against Scala <em>2.10</em>. These two versions are known to be compatible. Earlier versions (like Scala <em>2.9</em>) are <em>not</em> compatible.</p> |
| <p>Newer versions may be compatible, depending on breaking changes in the language features used by DistributedLog's dependencies, and the availability of DistributedLog's dependencies in those Scala versions.</p> |
| </div> |
| </div> |
| |
| |
| </div> |
| |
| |
| |
| </div> |
| |
| |
| <hr> |
| <div class="row"> |
| <div class="col-xs-12"> |
| <footer> |
| <p class="text-center">© Copyright 2016 |
| <a href="http://www.apache.org">The Apache Software Foundation.</a> All Rights Reserved. |
| </p> |
| <p class="text-center"> |
| <a href="/docs/latest/feed.xml">RSS Feed</a> |
| </p> |
| </footer> |
| </div> |
| </div> |
| <!-- container div end --> |
| </div> |
| |
| |
| <script> |
| (function () { |
| 'use strict'; |
| anchors.options.placement = 'right'; |
| anchors.add(); |
| })(); |
| </script> |
| |
| </body> |
| |
| </html> |