bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [bookkeeper] branch asf-site updated: Updated site at revision 51c660e
Date Thu, 24 Aug 2017 10:03:15 GMT
This is an automated email from the ASF dual-hosted git repository.

git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new b5c59e3  Updated site at revision 51c660e
b5c59e3 is described below

commit b5c59e35e3297835c56d8f21f92bb4c785dfaebd
Author: jenkins <builds@apache.org>
AuthorDate: Thu Aug 24 10:03:14 2017 +0000

    Updated site at revision 51c660e
---
 .../docs/latest/deployment/kubernetes/index.html   | 171 ++++++++++++++++++++-
 1 file changed, 167 insertions(+), 4 deletions(-)

diff --git a/content/docs/latest/deployment/kubernetes/index.html b/content/docs/latest/deployment/kubernetes/index.html
index 10cc048..bbc463e 100644
--- a/content/docs/latest/deployment/kubernetes/index.html
+++ b/content/docs/latest/deployment/kubernetes/index.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <title>Apache BookKeeper - Deploying BookKeeper on Kubernetes</title>
+    <title>Apache BookKeeper - Deploying Apache BookKeeper on Kubernetes</title>
 
 <meta charset="utf-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -426,7 +426,7 @@
         <nav class="level bk-level">
           <div class="level-left">
             <div class="level-item">
-              <h1 class="title">Deploying BookKeeper on Kubernetes</h1>
+              <h1 class="title">Deploying Apache BookKeeper on Kubernetes</h1>
             </div>
           </div>
           
@@ -445,7 +445,163 @@
 
       <div class="content">
         <section class="bk-main-content">
-          
+          <p>Apache BookKeeper can be easily deployed in <a href="https://kubernetes.io/">Kubernetes</a>
clusters. The managed clusters on <a href="https://cloud.google.com/compute/">Google
Container Engine</a> is the most convenient way.</p>
+
+<p>The deployment method shown in this guide relies on <a href="http://yaml.org/">YAML</a>
definitions for Kubernetes <a href="https://kubernetes.io/docs/resources-reference/v1.6/">resources</a>.
The <a href="https://github.com/apache/bookkeeper/tree/master/deploy/kubernetes"><code
class="highlighter-rouge">kubernetes</code></a> subdirectory holds resource
definitions for:</p>
+
+<ul>
+  <li>A three-node ZooKeeper cluster</li>
+  <li>A BookKeeper cluster with a bookie runs on each node.</li>
+</ul>
+
+<h2 id="setup-on-google-container-engine">Setup on Google Container Engine</h2>
+
+<p>To get started, get source code of <a href="https://github.com/apache/bookkeeper/tree/master/deploy/kubernetes"><code
class="highlighter-rouge">kubernetes</code></a> from github by git clone.</p>
+
+<p>If you’d like to change the number of bookies,  or ZooKeeper nodes in your BookKeeper
cluster, modify the <code class="highlighter-rouge">replicas</code> parameter
in the <code class="highlighter-rouge">spec</code> section of the appropriate
<a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/"><code
class="highlighter-rouge">Deployment</code></a> or <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/"><code
class="highlighter-roug [...]
+
+<p><a href="https://cloud.google.com/container-engine">Google Container Engine</a>
(GKE) automates the creation and management of Kubernetes clusters in <a href="https://cloud.google.com/compute/">Google
Compute Engine</a> (GCE).</p>
+
+<h3 id="prerequisites">Prerequisites</h3>
+
+<p>To get started, you’ll need:</p>
+
+<ul>
+  <li>A Google Cloud Platform account, which you can sign up for at <a href="https://cloud.google.com">cloud.google.com</a></li>
+  <li>An existing Cloud Platform project</li>
+  <li>The <a href="https://cloud.google.com/sdk/downloads">Google Cloud SDK</a>
(in particular the <a href="https://cloud.google.com/sdk/gcloud/"><code class="highlighter-rouge">gcloud</code></a>
and <a href=""><code class="highlighter-rouge">kubectl</code></a>
tools).</li>
+</ul>
+
+<h3 id="create-a-new-kubernetes-cluster">Create a new Kubernetes cluster</h3>
+
+<p>You can create a new GKE cluster using the <a href="https://cloud.google.com/sdk/gcloud/reference/container/clusters/create"><code
class="highlighter-rouge">container clusters create</code></a> command for
<code class="highlighter-rouge">gcloud</code>. This command enables you to specify
the number of nodes in the cluster, the machine types of those nodes, and more.</p>
+
+<p>As an example, we’ll create a new GKE cluster for Kubernetes version <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md#v164">1.6.4</a>
in the <a href="https://cloud.google.com/compute/docs/regions-zones/regions-zones#available">us-central1-a</a>
zone. The cluster will be named <code class="highlighter-rouge">bookkeeper-gke-cluster</code>
and will consist of three VMs, each using two locally attached SSDs and running on <a href="https://cloud.google.com/compute
[...]
+
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="gp">$ </span>gcloud config <span class="nb">set </span>compute/zone
us-central1-a
+<span class="gp">$ </span>gcloud config <span class="nb">set </span>project
your-project-name
+<span class="gp">$ </span>gcloud container clusters create bookkeeper-gke-cluster
<span class="se">\</span>
+  --machine-type<span class="o">=</span>n1-standard-8 <span class="se">\</span>
+  --num-nodes<span class="o">=</span>3 <span class="se">\</span>
+  --local-ssd-count<span class="o">=</span>2 <span class="se">\</span>
+  --enable-kubernetes-alpha
+</code></pre>
+</div>
+
+<p>By default, bookies will run on all the machines that have locally attached SSD
disks. In this example, all of those machines will have two SSDs, but you can add different
types of machines to the cluster later. You can control which machines host bookie servers
using <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels">labels</a>.</p>
+
+<h3 id="dashboard">Dashboard</h3>
+
+<p>You can observe your cluster in the <a href="https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/">Kubernetes
Dashboard</a> by downloading the credentials for your Kubernetes cluster and opening
up a proxy to the cluster:</p>
+
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="gp">$ </span>gcloud container clusters get-credentials bookkeeper-gke-cluster
<span class="se">\</span>
+  --zone<span class="o">=</span>us-central1-a <span class="se">\</span>
+  --project<span class="o">=</span>your-project-name
+<span class="gp">$ </span>kubectl proxy
+</code></pre>
+</div>
+
+<p>By default, the proxy will be opened on port 8001. Now you can navigate to <a
href="http://localhost:8001/ui">localhost:8001/ui</a> in your browser to access the
dashboard. At first your GKE cluster will be empty, but that will change as you begin deploying.</p>
+
+<p>When you create a cluster, your <code class="highlighter-rouge">kubectl</code>
config in <code class="highlighter-rouge">~/.kube/config</code> (on MacOS and
Linux) will be updated for you, so you probably won’t need to change your configuration.
Nonetheless, you can ensure that <code class="highlighter-rouge">kubectl</code>
can interact with your cluster by listing the nodes in the cluster:</p>
+
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="gp">$ </span>kubectl get nodes
+</code></pre>
+</div>
+
+<p>If <code class="highlighter-rouge">kubectl</code> is working with your
cluster, you can proceed to deploy ZooKeeper and Bookies.</p>
+
+<h3 id="zookeeper">ZooKeeper</h3>
+
+<p>You <em>must</em> deploy ZooKeeper as the first component, as it is
a dependency for the others.</p>
+
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="gp">$ </span>kubectl apply -f zookeeper.yaml
+</code></pre>
+</div>
+
+<p>Wait until all three ZooKeeper server pods are up and have the status <code class="highlighter-rouge">Running</code>.
You can check on the status of the ZooKeeper pods at any time:</p>
+
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="gp">$ </span>kubectl get pods -l <span class="nv">component</span><span
class="o">=</span>zookeeper
+NAME      READY     STATUS             RESTARTS   AGE
+zk-0      1/1       Running            0          18m
+zk-1      1/1       Running            0          17m
+zk-2      0/1       Running            6          15m
+</code></pre>
+</div>
+
+<p>This step may take several minutes, as Kubernetes needs to download the Docker image
on the VMs.</p>
+
+<p>If you want to connect to one of the remote zookeeper server, you can use<a href="https://github.com/rgs1/zk_shell">zk-shell</a>,
you need to forward a local port to the
+remote zookeeper server:</p>
+
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="gp">$ </span>kubectl port-forward zk-0 2181:2181
+<span class="gp">$ </span>zk-shell localhost 2181
+</code></pre>
+</div>
+
+<h3 id="deploy-bookies">Deploy Bookies</h3>
+
+<p>Once ZooKeeper cluster is Running, you can then deploy the bookies.</p>
+
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="gp">$ </span>kubectl apply -f bookkeeper.yaml
+</code></pre>
+</div>
+
+<p>You can check on the status of the Bookie pods for these components either in the
Kubernetes Dashboard or using <code class="highlighter-rouge">kubectl</code>:</p>
+
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="gp">$ </span>kubectl get pods
+</code></pre>
+</div>
+
+<p>While all BookKeeper pods is Running, by zk-shell you could find all available bookies
under /ledgers/</p>
+
+<p>You could also run a <a href="https://github.com/ivankelly/bookkeeper-tutorial/">bookkeeper
tutorial</a> instance, which named as ‘dice’ here, in this bookkeeper cluster.</p>
+
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="nv">$</span>kubectl run -i --tty --attach dice --image<span class="o">=</span>caiok/bookkeeper-tutorial
--env <span class="nv">ZOOKEEPER_SERVERS</span><span class="o">=</span><span
class="s2">"zk-0.zookeeper"</span>
+</code></pre>
+</div>
+
+<p>An example output of Dice instance is like this:</p>
+<pre><code class="language-aidl">➜ $ kubectl run -i --tty --attach dice --image=caiok/bookkeeper-tutorial
--env ZOOKEEPER_SERVERS="zk-0.zookeeper"          
+If you don't see a command prompt, try pressing enter.
+Value = 1, epoch = 5, leading
+Value = 2, epoch = 5, leading
+Value = 1, epoch = 5, leading
+Value = 4, epoch = 5, leading
+Value = 5, epoch = 5, leading
+Value = 4, epoch = 5, leading
+Value = 3, epoch = 5, leading
+Value = 5, epoch = 5, leading
+Value = 3, epoch = 5, leading
+Value = 2, epoch = 5, leading
+Value = 1, epoch = 5, leading
+Value = 4, epoch = 5, leading
+Value = 2, epoch = 5, leading
+</code></pre>
+
+<h3 id="un-deploy">Un-Deploy</h3>
+
+<p>Delete Demo dice instance</p>
+
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="nv">$</span>kubectl delete deployment dice      
+</code></pre>
+</div>
+
+<p>Delete BookKeeper</p>
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="gp">$ </span>kubectl delete -f bookkeeper.yaml    
+</code></pre>
+</div>
+
+<p>Delete ZooKeeper</p>
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="gp">$ </span>kubectl delete -f zookeeper.yaml    
+</code></pre>
+</div>
+
+<p>Delete cluster</p>
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span
class="gp">$ </span>gcloud container clusters delete bookkeeper-gke-cluster    
+</code></pre>
+</div>
+
 
         </section>
 
@@ -457,8 +613,15 @@
       
       
 <div class="toc">
-  <h2 class="title">Deploying BookKeeper on Kubernetes</h2>
+  <h2 class="title">Deploying Apache BookKeeper on Kubernetes</h2>
   <ul class="section-nav">
+<li class="toc-entry toc-h2"><a href="#setup-on-google-container-engine">Setup
on Google Container Engine</a></li>
+<li class="toc-entry toc-h3"><a href="#prerequisites">Prerequisites</a></li>
+<li class="toc-entry toc-h3"><a href="#create-a-new-kubernetes-cluster">Create
a new Kubernetes cluster</a></li>
+<li class="toc-entry toc-h3"><a href="#dashboard">Dashboard</a></li>
+<li class="toc-entry toc-h3"><a href="#zookeeper">ZooKeeper</a></li>
+<li class="toc-entry toc-h3"><a href="#deploy-bookies">Deploy Bookies</a></li>
+<li class="toc-entry toc-h3"><a href="#un-deploy">Un-Deploy</a></li>
 </ul>
 </div>
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@bookkeeper.apache.org" <commits@bookkeeper.apache.org>'].

Mime
View raw message