You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by rm...@apache.org on 2013/05/30 06:58:46 UTC
[9/9] git commit: Add short version section to quickstart to document
use of quickstart.sh
Add short version section to quickstart to document use of quickstart.sh
Project: http://git-wip-us.apache.org/repos/asf/incubator-helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-helix/commit/cc4c7f78
Tree: http://git-wip-us.apache.org/repos/asf/incubator-helix/tree/cc4c7f78
Diff: http://git-wip-us.apache.org/repos/asf/incubator-helix/diff/cc4c7f78
Branch: refs/heads/master
Commit: cc4c7f78cc3577535492c7b975174189734f3b54
Parents: 8fe1fa0
Author: Bob Schulman <bs...@linkedin.com>
Authored: Wed May 29 21:57:26 2013 -0700
Committer: Bob Schulman <bs...@linkedin.com>
Committed: Wed May 29 21:57:26 2013 -0700
----------------------------------------------------------------------
src/site/markdown/Quickstart.md | 95 +++++++++++++++++++++++++++++-----
1 files changed, 82 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-helix/blob/cc4c7f78/src/site/markdown/Quickstart.md
----------------------------------------------------------------------
diff --git a/src/site/markdown/Quickstart.md b/src/site/markdown/Quickstart.md
index 65410c3..4e09d24 100644
--- a/src/site/markdown/Quickstart.md
+++ b/src/site/markdown/Quickstart.md
@@ -20,7 +20,7 @@ under the License.
Get Helix
---------
-First, let\'s get Helix, either build or download.
+First, let\'s get Helix, either build it, or download.
### Build
@@ -39,34 +39,104 @@ Overview
In this Quickstart, we\'ll set up a master-slave replicated, partitioned system. Then we\'ll demonstrate how to add a node, rebalance the partitions, and show how Helix manages failover.
-The steps:
-
-* Define a cluster
-* Add two nodes to the cluster
-* Add a 6-partition resource with 1 master and 2 slave replicas per partition
-* Verify that the cluster is healthy and inspect the Helix view
-* Expand the cluster: add a few nodes and rebalance the partitions
-* Failover: stop a node and verify the mastership transfer
Let\'s Do It
------------
Helix provides command line interfaces to set up the cluster and view the cluster state. The best way to understand how Helix views a cluster is to build a cluster.
-#### First, get to the tools directory.
+#### First, get to the tools directory
If you built the code
```
-cd helix/helix-core/target/helix-core-pkg/bin
+cd helix/incubator-helix/helix-core/target/helix-core-pkg/bin
```
If you downloaded the release package, extract it.
+
+Short Version
+-------------
+You can observe the components working together in this demo, which does the following:
+
+* Create a cluster
+* Add 2 nodes (participants) to the cluster
+* Set up a resource with 6 partitions and 2 replicas: 1 Master, and 1 Slave per partition
+* Show the cluster state after Helix balances the partitions
+* Add a third node
+* Show the cluster state. Note that the third node has taken mastership of 2 partitions.
+* Kill the third node (Helix takes care of failover)
+* Show the cluster state. Note that the two surviving nodes take over mastership of the partitions from the failed node
+
+##### Run the demo
+
+```
+cd helix/incubator-helix/helix-core/target/helix-core-pkg/bin
+./quickstart.sh
+```
+
+##### 2 nodes are set up and the partitions rebalanced
+
+The cluster state is as follows:
+
```
-cd helix-core-pkg/bin
+CLUSTER STATE: After starting 2 nodes
+ localhost_12000 localhost_12001
+ MyResource_0 M S
+ MyResource_1 S M
+ MyResource_2 M S
+ MyResource_3 M S
+ MyResource_4 S M
+ MyResource_5 S M
```
+Note there is one master and one slave per partition.
+
+##### A third node is added and the cluster rebalanced
+
+The cluster state changes to:
+
+```
+CLUSTER STATE: After adding a third node
+ localhost_12000 localhost_12001 localhost_12002
+ MyResource_0 S M S
+ MyResource_1 S S M
+ MyResource_2 M S S
+ MyResource_3 S S M
+ MyResource_4 M S S
+ MyResource_5 S M S
+```
+
+Note there is one master and _two_ slaves per partition. This is expected because there are three nodes.
+
+##### Finally, a node is killed to simulate a failure
+
+Helix makes sure each partition has a master. The cluster state changes to:
+
+```
+CLUSTER STATE: After the 3rd node stops/crashes
+ localhost_12000 localhost_12001 localhost_12002
+ MyResource_0 S M -
+ MyResource_1 S M -
+ MyResource_2 M S -
+ MyResource_3 M S -
+ MyResource_4 M S -
+ MyResource_5 S M -
+```
+
+
+Long Version
+------------
+Now you can run the same steps by hand. In the detailed version, we\'ll do the following:
+
+* Define a cluster
+* Add two nodes to the cluster
+* Add a 6-partition resource with 1 master and 2 slave replicas per partition
+* Verify that the cluster is healthy and inspect the Helix view
+* Expand the cluster: add a few nodes and rebalance the partitions
+* Failover: stop a node and verify the mastership transfer
+
### Install/Start zookeeper
Zookeeper can be started in standalone mode or replicated mode.
@@ -82,7 +152,6 @@ In this example, let\'s start zookeeper in local mode.
./start-standalone-zookeeper.sh 2199 &
-
### Define the Cluster
The helix-admin tool is used for cluster administration tasks. In the Quickstart, we\'ll use the command line interface. Helix supports a REST interface as well.