Skip to content

Commit

Permalink
Updating 1.0.x documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lagom Build Server authored and Play Team committed Mar 11, 2016
1 parent 4d50c20 commit 66b4dec
Show file tree
Hide file tree
Showing 251 changed files with 1,165 additions and 1,283 deletions.
2 changes: 1 addition & 1 deletion documentation/1.0.x/Cluster.html
Expand Up @@ -79,7 +79,7 @@ <h1 id="Cluster"><a class="section-marker" href="#Cluster">§</a>Cluster</h1><p>
</code></pre><p>Alternatively, this can be defined as Java system properties when starting the JVM:</p>
<pre class="prettyprint"><code>-Dakka.cluster.seed-nodes.0=akka.tcp://MyService@host1:2552
-Dakka.cluster.seed-nodes.1=akka.tcp://MyService@host2:2552
</code></pre><p>The node that is configured first in the list of <code>seed-nodes</code> is special. Only that node that will join itself. It is used for bootstrapping the cluster.</p><p>The reason for the special first seed node is to avoid forming separated islands when starting from an empty cluster. If the first seed node is restarted and there is an existing cluster it will try to join the other seed nodes, i.e. it will join the existing cluster.</p><p>You can read more about cluster joining in the <a href="http://doc.akka.io/docs/akka/2.4.2/java/cluster-usage.html#Joining_to_Seed_Nodes">Akka documentation</a>.</p><h2 id="Downing"><a class="section-marker" href="#Downing">§</a>Downing</h2><p>When operating a Lagom service cluster you must consider how to handle network partitions (a.k.a. split brain scenarios) and machine crashes (including JVM and hardware failures). This is crucial for correct behavior when using <a href="PersistentEntity.html">Persistent Entities</a>. Persistent entities must be single-writers, i.e. there must only be one active entity with a given entity identity. If the cluster is split in two halves and the wrong downing strategy is used there will be active entities with the the same identifiers in both clusters, writing to the same database. That will result in corrupt data.</p><p>The naïve approach is to remove an unreachable node from the cluster membership after a timeout. This works great for crashes and short transient network partitions, but not for long network partitions. Both sides of the network partition will see the other side as unreachable and after a while remove it from its cluster membership. Since this happens on both sides the result is that two separate disconnected clusters have been created. This approach is provided by the opt-in (off by default) auto-down feature in the OSS version of Akka Cluster.</p><p><strong>We strongly recommend against using the auto-down feature of Akka Cluster.</strong></p><p>A pre-packaged solution for the downing problem is provided by <a href="http://doc.akka.io/docs/akka/rp-16s01p02/scala/split-brain-resolver.html">Split Brain Resolver</a>, which is part of the <a href="http://www.lightbend.com/products/lightbend-reactive-platform">Lightbend Reactive Platform</a>. The <code>keep-majority</code> strategy is configured to be enabled by default if you use Lagom with the Reactive Platform.</p><p>If you don&rsquo;t use RP, you should anyway carefully read the documentation of the <a href="http://doc.akka.io/docs/akka/rp-16s01p02/scala/split-brain-resolver.html">Split Brain Resolver</a> and make sure that the solution you are using handles the concerns described there.</p><h2 id="Leaving"><a class="section-marker" href="#Leaving">§</a>Leaving</h2><p>When using <a href="PersistentEntity.html">Persistent Entities</a> you can use <a href="api/java/com/lightbend/lagom/javadsl/persistence/PersistentEntityRegistry.html#gracefulShutdown">PersistentEntityRegistry.gracefulShutdown</a> to stop the persistent entities and leave the cluster in a graceful way. This is not mandatory but it can be good when you are doing a controlled shutdown of a service node. It will reduce the number of lost in-flight messages during the failover to another node.</p><h2 id="Dependency"><a class="section-marker" href="#Dependency">§</a>Dependency</h2><p>The clustering feature is already included if you are using the <a href="PersistentEntity.html#Dependency">persistence</a> or <a href="PubSub.html#Dependency">pubsub</a> modules.</p><p>If you want to enable it without those modules, add the following to your project&rsquo;s build:</p>
</code></pre><p>The node that is configured first in the list of <code>seed-nodes</code> is special. Only that node that will join itself. It is used for bootstrapping the cluster.</p><p>The reason for the special first seed node is to avoid forming separated islands when starting from an empty cluster. If the first seed node is restarted and there is an existing cluster it will try to join the other seed nodes, i.e. it will join the existing cluster.</p><p>You can read more about cluster joining in the <a href="http://doc.akka.io/docs/akka/2.4.2/java/cluster-usage.html#Joining_to_Seed_Nodes">Akka documentation</a>.</p><h2 id="Downing"><a class="section-marker" href="#Downing">§</a>Downing</h2><p>When operating a Lagom service cluster you must consider how to handle network partitions (a.k.a. split brain scenarios) and machine crashes (including JVM and hardware failures). This is crucial for correct behavior when using <a href="PersistentEntity.html">Persistent Entities</a>. Persistent entities must be single-writers, i.e. there must only be one active entity with a given entity identity. If the cluster is split in two halves and the wrong downing strategy is used there will be active entities with the the same identifiers in both clusters, writing to the same database. That will result in corrupt data.</p><p>The naïve approach is to remove an unreachable node from the cluster membership after a timeout. This works great for crashes and short transient network partitions, but not for long network partitions. Both sides of the network partition will see the other side as unreachable and after a while remove it from its cluster membership. Since this happens on both sides the result is that two separate disconnected clusters have been created. This approach is provided by the opt-in (off by default) auto-down feature in the OSS version of Akka Cluster.</p><p><strong>We strongly recommend against using the auto-down feature of Akka Cluster.</strong></p><p>A pre-packaged solution for the downing problem is provided by <a href="http://doc.akka.io/docs/akka/rp-16s01p02/scala/split-brain-resolver.html">Split Brain Resolver</a>, which is part of the <a href="http://www.lightbend.com/products/lightbend-reactive-platform">Lightbend Reactive Platform</a>. The <code>keep-majority</code> strategy is configured to be enabled by default if you use Lagom with the Reactive Platform.</p><p>See <a href="ReactivePlatform.html">Reactive Platform instructions</a> for how to enable Reactive Platform in the build of your project.</p><p>If you don&rsquo;t use RP, you should anyway carefully read the documentation of the <a href="http://doc.akka.io/docs/akka/rp-16s01p02/scala/split-brain-resolver.html">Split Brain Resolver</a> and make sure that the solution you are using handles the concerns described there.</p><h2 id="Leaving"><a class="section-marker" href="#Leaving">§</a>Leaving</h2><p>When using <a href="PersistentEntity.html">Persistent Entities</a> you can use <a href="api/java/com/lightbend/lagom/javadsl/persistence/PersistentEntityRegistry.html#gracefulShutdown">PersistentEntityRegistry.gracefulShutdown</a> to stop the persistent entities and leave the cluster in a graceful way. This is not mandatory but it can be good when you are doing a controlled shutdown of a service node. It will reduce the number of lost in-flight messages during the failover to another node.</p><h2 id="Dependency"><a class="section-marker" href="#Dependency">§</a>Dependency</h2><p>The clustering feature is already included if you are using the <a href="PersistentEntity.html#Dependency">persistence</a> or <a href="PubSub.html#Dependency">pubsub</a> modules.</p><p>If you want to enable it without those modules, add the following to your project&rsquo;s build:</p>
<pre class="prettyprint"><code class="language-sbt">libraryDependencies += lagomJavadslCluster</code></pre>
<footer>
<nav>
Expand Down
3 changes: 2 additions & 1 deletion documentation/1.0.x/ConductR.html
Expand Up @@ -42,6 +42,7 @@ <h1 class="title"><a href="Home.html"> Lagom Documentation</a></h1>
<li><label>Running Lagom in production</label></li>
<li><a href="Overview.html">Overview</a></li>
<li><a href="ConductR.html">Lightbend ConductR</a></li>
<li><a href="ReactivePlatform.html">ReactivePlatform</a></li>

<li><label>Lagom reference guide</label></li>
<li><a href="ReferenceGuide.html">Reference Guide</a></li>
Expand Down Expand Up @@ -97,7 +98,7 @@ <h1 id="Lightbend-ConductR"><a class="section-marker" href="#Lightbend-ConductR"
</code></pre><p>Upon loading you then run cassandra at the scale that you require. For convenience we recommend that you start with one Cassandra cluster per root sbt project, which of course can contain many Lagom projects (and therefore services). Bounded contexts are always maintained via separate key-spaces, and so having one Cassandra cluster is viable for supporting many microservices. The actual number of Cassandra clusters required will be the <em>Lagom amount</em> i.e. &ldquo;just the right amount&rdquo; for your system. For more information on configuring Cassandra for ConductR please visit <a href="https://github.com/typesafehub/conductr-cassandra#conductr-cassandra">the bundle&rsquo;s website</a>.</p><h2 id="For-more-information"><a class="section-marker" href="#For-more-information">§</a>For more information</h2><p>For more information on ConductR please visit its <a href="https://conductr.lightbend.com/">documentation site</a>.</p>
<footer>
<nav>
<a href="Logging.html"><strong>Next: </strong> Logging</a>
<a href="ReactivePlatform.html"><strong>Next: </strong> ReactivePlatform</a>
</nav>
</footer>
</article>
Expand Down
3 changes: 3 additions & 0 deletions documentation/1.0.x/Home.html
Expand Up @@ -191,6 +191,9 @@ <h2>Lagom reference guide</h2>
<li>
<a href="ConductR.html">Lightbend ConductR</a>
</li>
<li>
<a href="ReactivePlatform.html">ReactivePlatform</a>
</li>
</ol></li>
<li>
<a href="Logging.html">Logging</a>
Expand Down
1 change: 1 addition & 0 deletions documentation/1.0.x/Overview.html
Expand Up @@ -42,6 +42,7 @@ <h1 class="title"><a href="Home.html"> Lagom Documentation</a></h1>
<li><label>Running Lagom in production</label></li>
<li><a href="Overview.html">Overview</a></li>
<li><a href="ConductR.html">Lightbend ConductR</a></li>
<li><a href="ReactivePlatform.html">ReactivePlatform</a></li>

<li><label>Lagom reference guide</label></li>
<li><a href="ReferenceGuide.html">Reference Guide</a></li>
Expand Down

0 comments on commit 66b4dec

Please sign in to comment.