You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by mk...@apache.org on 2014/01/20 17:15:32 UTC
svn commit: r1559765 - in /incubator/knox: site/
site/books/knox-incubating-0-4-0/ trunk/books/0.4.0/
Author: mkononenko
Date: Mon Jan 20 16:15:31 2014
New Revision: 1559765
URL: http://svn.apache.org/r1559765
Log:
KNOX-194: Added documentation for Knox HA with Apache HTTP Server + mod_proxy + mod_proxy_balancer
Added:
incubator/knox/trunk/books/0.4.0/config_ha.md
Modified:
incubator/knox/site/books/knox-incubating-0-4-0/knox-incubating-0-4-0.html
incubator/knox/site/index.html
incubator/knox/site/issue-tracking.html
incubator/knox/site/license.html
incubator/knox/site/mail-lists.html
incubator/knox/site/project-info.html
incubator/knox/site/team-list.html
incubator/knox/trunk/books/0.4.0/book.md
incubator/knox/trunk/books/0.4.0/book_gateway-details.md
Modified: incubator/knox/site/books/knox-incubating-0-4-0/knox-incubating-0-4-0.html
URL: http://svn.apache.org/viewvc/incubator/knox/site/books/knox-incubating-0-4-0/knox-incubating-0-4-0.html?rev=1559765&r1=1559764&r2=1559765&view=diff
==============================================================================
--- incubator/knox/site/books/knox-incubating-0-4-0/knox-incubating-0-4-0.html (original)
+++ incubator/knox/site/books/knox-incubating-0-4-0/knox-incubating-0-4-0.html Mon Jan 20 16:15:31 2014
@@ -33,8 +33,8 @@
<li><a href="#LDAPGroupLookup">LDAPGroupLookup</a></li>
<li><a href="#Identity+Assertion">Identity Assertion</a></li>
<li><a href="#Authorization">Authorization</a></li>
- <li><a href="#Configuration">Configuration</a></li>
<li><a href="#Secure+Clusters">Secure Clusters</a></li>
+ <li><a href="#High+Availability">High Availability</a></li>
</ul></li>
<li><a href="#Client+Details">Client Details</a></li>
<li><a href="#Service+Details">Service Details</a>
@@ -955,7 +955,58 @@ exit
</code></pre><p>Copy knox.service.keytab created on KDC host on to your Knox host /etc/knox/conf/knox.service.keytab</p>
<pre><code>chown knox knox.service.keytab
chmod 400 knox.service.keytab
-</code></pre><h4><a id="Update+krb5.conf+at+/etc/knox/conf/krb5.conf+on+Knox+host"></a>Update krb5.conf at /etc/knox/conf/krb5.conf on Knox host</h4><p>You could copy the <code>templates/krb5.conf</code> file provided in the Knox binary download and customize it to suit your cluster.</p><h4><a id="Update+`krb5JAASLogin.conf`+at+`/etc/knox/conf/krb5JAASLogin.conf`+on+Knox+host"></a>Update <code>krb5JAASLogin.conf</code> at <code>/etc/knox/conf/krb5JAASLogin.conf</code> on Knox host</h4><p>You could copy the <code>templates/krb5JAASLogin.conf</code> file provided in the Knox binary download and customize it to suit your cluster.</p><h4><a id="Update+`gateway-site.xml`+on+Knox+host+on+Knox+host"></a>Update <code>gateway-site.xml</code> on Knox host on Knox host</h4><p>Update <code>conf/gateway-site.xml</code> in your Knox installation and set the value of <code>gateway.hadoop.kerberos.secured</code> to true.</p><h4><a id="Restart+Knox"></a>Restart Knox</h4><p>After you do the above con
figurations and restart Knox, Knox would use SPNego to authenticate with Hadoop services and Oozie. There is no change in the way you make calls to Knox whether you use Curl or Knox DSL.</p><h2><a id="Client+Details"></a>Client Details</h2><p>Hadoop requires a client that can be used to interact remotely with the services provided by Hadoop cluster. This will also be true when using the Apache Knox Gateway to provide perimeter security and centralized access for these services. The two primary existing clients for Hadoop are the CLI (i.e. Command Line Interface, hadoop) and HUE (i.e. Hadoop User Environment). For several reasons however, neither of these clients can <em>currently</em> be used to access Hadoop services via the Apache Knox Gateway.</p><p>This led to thinking about a very simple client that could help people use and evaluate the gateway. The list below outlines the general requirements for such a client.</p>
+</code></pre><h4><a id="Update+krb5.conf+at+/etc/knox/conf/krb5.conf+on+Knox+host"></a>Update krb5.conf at /etc/knox/conf/krb5.conf on Knox host</h4><p>You could copy the <code>templates/krb5.conf</code> file provided in the Knox binary download and customize it to suit your cluster.</p><h4><a id="Update+`krb5JAASLogin.conf`+at+`/etc/knox/conf/krb5JAASLogin.conf`+on+Knox+host"></a>Update <code>krb5JAASLogin.conf</code> at <code>/etc/knox/conf/krb5JAASLogin.conf</code> on Knox host</h4><p>You could copy the <code>templates/krb5JAASLogin.conf</code> file provided in the Knox binary download and customize it to suit your cluster.</p><h4><a id="Update+`gateway-site.xml`+on+Knox+host+on+Knox+host"></a>Update <code>gateway-site.xml</code> on Knox host on Knox host</h4><p>Update <code>conf/gateway-site.xml</code> in your Knox installation and set the value of <code>gateway.hadoop.kerberos.secured</code> to true.</p><h4><a id="Restart+Knox"></a>Restart Knox</h4><p>After you do the above con
figurations and restart Knox, Knox would use SPNego to authenticate with Hadoop services and Oozie. There is no change in the way you make calls to Knox whether you use Curl or Knox DSL.</p><h3><a id="High+Availability"></a>High Availability</h3><h4><a id="Configure+Knox+instances"></a>Configure Knox instances</h4><p>All Knox instances must be synced to use the same topologies credentials keystores. These files are located under {GATEWAY_HOME}/conf/security/keystores/{TOPOLOGY_NAME}-credentials.jceks. They are generated after the first topology deployment. Currently these files can be synced just manually. There is no automation tool. Here are the steps to sync topologies credentials keystores:</p>
+<ol>
+ <li>Choose Knox instance that will be the source for topologies credentials keystores. Let’s call it keystores master</li>
+ <li>Replace topologies credentials keystores in the other Knox instance with topologies credentials keystores from keystores master</li>
+ <li>Restart Knox instances</li>
+</ol><h4><a id="High+Availability+with+Apache+HTTP+Server+++mod_proxy+++mod_proxy_balancer"></a>High Availability with Apache HTTP Server + mod_proxy + mod_proxy_balancer</h4><h5><a id="1+-+Requirements"></a>1 - Requirements</h5><h6><a id="openssl-devel"></a>openssl-devel</h6><p>openssl-devel is required for Apache Module mod_ssl.</p>
+<pre><code>sudo yum install openssl-devel
+</code></pre><h6><a id="Apache+HTTP+Server"></a>Apache HTTP Server</h6><p>Apache HTTP Server 2.4.6 or later is required. See this document for installing and setting up Apache HTTP Server: <a href="http://httpd.apache.org/docs/2.4/install.html">http://httpd.apache.org/docs/2.4/install.html</a></p><p>Hint: pass –enable-ssl to ./configure command to enable Apache Module mod_ssl generation.</p><h6><a id="Apache+Module+mod_proxy"></a>Apache Module mod_proxy</h6><p>See this document for setting up Apache Module mod_proxy: <a href="http://httpd.apache.org/docs/2.4/mod/mod_proxy.html">http://httpd.apache.org/docs/2.4/mod/mod_proxy.html</a></p><h6><a id="Apache+Module+mod_proxy_balancer"></a>Apache Module mod_proxy_balancer</h6><p>See this document for setting up Apache Module mod_proxy_balancer: <a href="http://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html">http://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html</a></p><h6><a id="Apache+Module+mod_ssl"></a>Apache Module
mod_ssl</h6><p>See this document for setting up Apache Module mod_ssl: <a href="http://httpd.apache.org/docs/2.4/mod/mod_ssl.html">http://httpd.apache.org/docs/2.4/mod/mod_ssl.html</a></p><h5><a id="2+-+Configuration+example"></a>2 - Configuration example</h5><h6><a id="Generate+certificate+for+Apache+HTTP+Server"></a>Generate certificate for Apache HTTP Server</h6><p>See this document for an example: <a href="http://www.akadia.com/services/ssh_test_certificate.html">http://www.akadia.com/services/ssh_test_certificate.html</a></p><p>By convention, Apache HTTP Server and Knox certificates are put into /etc/apache2/ssl/ folder.</p><h6><a id="Update+Apache+HTTP+Server+configuration+file"></a>Update Apache HTTP Server configuration file</h6><p>This file is located under {APACHE_HOME}/conf/httpd.conf.</p><p>Following directives have to be added or uncommented in the configuration file:</p>
+<ul>
+ <li>LoadModule proxy_module modules/mod_proxy.so</li>
+ <li>LoadModule proxy_http_module modules/mod_proxy_http.so</li>
+ <li>LoadModule proxy_balancer_module modules/mod_proxy_balancer.so</li>
+ <li>LoadModule ssl_module modules/mod_ssl.so</li>
+ <li>LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so</li>
+ <li>LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so</li>
+ <li>LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so</li>
+ <li>LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so</li>
+ <li>LoadModule slotmem_shm_module modules/mod_slotmem_shm.so</li>
+</ul><p>Also following lines have to be added to file. Replace placeholders (${…}) with real data:</p>
+<pre><code>Listen 443
+<VirtualHost *:443>
+ SSLEngine On
+ SSLProxyEngine On
+ SSLCertificateFile ${PATH_TO_CERTICICATE_FILE}
+ SSLCertificateKeyFile ${PATH_TO_CERTICICATE_KEY_FILE}
+ SSLProxyCACertificateFile ${PATH_TO_PROXY_CA_CERTICICATE_FILE}
+
+ ProxyRequests Off
+ ProxyPreserveHost Off
+
+ Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
+ <Proxy balancer://mycluster>
+ BalancerMember ${HOST_#1} route=1
+ BalancerMember ${HOST_#2} route=2
+ ...
+ BalancerMember ${HOST_#N} route=N
+
+ ProxySet failontimeout=On lbmethod=${LB_METHOD} stickysession=ROUTEID
+ </Proxy>
+
+ ProxyPass / balancer://mycluster/
+ ProxyPassReverse / balancer://mycluster/
+</VirtualHost>
+</code></pre><p>Note:</p>
+<ul>
+ <li>SSLProxyEngine enables SSL between Apache HTTP Server and Knox instances;</li>
+ <li>SSLCertificateFile and SSLCertificateKeyFile have to point to certificate data of Apache HTTP Server. User will use this certificate for communications with Apache HTTP Server;</li>
+ <li>SSLProxyCACertificateFile has to point to Knox certificates.</li>
+</ul><h6><a id="Start/stop+Apache+HTTP+Server"></a>Start/stop Apache HTTP Server</h6>
+<pre><code>APACHE_HOME/bin/apachectl -k start
+APACHE_HOME/bin/apachectl -k stop
+</code></pre><h6><a id="Verify"></a>Verify</h6><p>Use Knox samples.</p><h2><a id="Client+Details"></a>Client Details</h2><p>Hadoop requires a client that can be used to interact remotely with the services provided by Hadoop cluster. This will also be true when using the Apache Knox Gateway to provide perimeter security and centralized access for these services. The two primary existing clients for Hadoop are the CLI (i.e. Command Line Interface, hadoop) and HUE (i.e. Hadoop User Environment). For several reasons however, neither of these clients can <em>currently</em> be used to access Hadoop services via the Apache Knox Gateway.</p><p>This led to thinking about a very simple client that could help people use and evaluate the gateway. The list below outlines the general requirements for such a client.</p>
<ul>
<li>Promote the evaluation and adoption of the Apache Knox Gateway</li>
<li>Simple to deploy and use on data worker desktops to access to remote Hadoop clusters</li>
Modified: incubator/knox/site/index.html
URL: http://svn.apache.org/viewvc/incubator/knox/site/index.html?rev=1559765&r1=1559764&r2=1559765&view=diff
==============================================================================
--- incubator/knox/site/index.html (original)
+++ incubator/knox/site/index.html Mon Jan 20 16:15:31 2014
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 9, 2014 -->
+<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 17, 2014 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -10,7 +10,7 @@
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
- <meta name="Date-Revision-yyyymmdd" content="20140109" />
+ <meta name="Date-Revision-yyyymmdd" content="20140117" />
<meta http-equiv="Content-Language" content="en" />
<script type="text/javascript">var _gaq = _gaq || [];
@@ -57,7 +57,7 @@
<a href="https://cwiki.apache.org/confluence/display/KNOX/Index" class="externalLink" title="Wiki">Wiki</a>
- | <span id="publishDate">Last Published: 2014-01-09</span>
+ | <span id="publishDate">Last Published: 2014-01-17</span>
| <span id="projectVersion">Version: 0.0.0-SNAPSHOT</span>
</div>
<div class="clear">
Modified: incubator/knox/site/issue-tracking.html
URL: http://svn.apache.org/viewvc/incubator/knox/site/issue-tracking.html?rev=1559765&r1=1559764&r2=1559765&view=diff
==============================================================================
--- incubator/knox/site/issue-tracking.html (original)
+++ incubator/knox/site/issue-tracking.html Mon Jan 20 16:15:31 2014
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 9, 2014 -->
+<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 17, 2014 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -10,7 +10,7 @@
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
- <meta name="Date-Revision-yyyymmdd" content="20140109" />
+ <meta name="Date-Revision-yyyymmdd" content="20140117" />
<meta http-equiv="Content-Language" content="en" />
<script type="text/javascript">var _gaq = _gaq || [];
@@ -57,7 +57,7 @@
<a href="https://cwiki.apache.org/confluence/display/KNOX/Index" class="externalLink" title="Wiki">Wiki</a>
- | <span id="publishDate">Last Published: 2014-01-09</span>
+ | <span id="publishDate">Last Published: 2014-01-17</span>
| <span id="projectVersion">Version: 0.0.0-SNAPSHOT</span>
</div>
<div class="clear">
Modified: incubator/knox/site/license.html
URL: http://svn.apache.org/viewvc/incubator/knox/site/license.html?rev=1559765&r1=1559764&r2=1559765&view=diff
==============================================================================
--- incubator/knox/site/license.html (original)
+++ incubator/knox/site/license.html Mon Jan 20 16:15:31 2014
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 9, 2014 -->
+<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 17, 2014 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -10,7 +10,7 @@
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
- <meta name="Date-Revision-yyyymmdd" content="20140109" />
+ <meta name="Date-Revision-yyyymmdd" content="20140117" />
<meta http-equiv="Content-Language" content="en" />
<script type="text/javascript">var _gaq = _gaq || [];
@@ -57,7 +57,7 @@
<a href="https://cwiki.apache.org/confluence/display/KNOX/Index" class="externalLink" title="Wiki">Wiki</a>
- | <span id="publishDate">Last Published: 2014-01-09</span>
+ | <span id="publishDate">Last Published: 2014-01-17</span>
| <span id="projectVersion">Version: 0.0.0-SNAPSHOT</span>
</div>
<div class="clear">
Modified: incubator/knox/site/mail-lists.html
URL: http://svn.apache.org/viewvc/incubator/knox/site/mail-lists.html?rev=1559765&r1=1559764&r2=1559765&view=diff
==============================================================================
--- incubator/knox/site/mail-lists.html (original)
+++ incubator/knox/site/mail-lists.html Mon Jan 20 16:15:31 2014
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 9, 2014 -->
+<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 17, 2014 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -10,7 +10,7 @@
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
- <meta name="Date-Revision-yyyymmdd" content="20140109" />
+ <meta name="Date-Revision-yyyymmdd" content="20140117" />
<meta http-equiv="Content-Language" content="en" />
<script type="text/javascript">var _gaq = _gaq || [];
@@ -57,7 +57,7 @@
<a href="https://cwiki.apache.org/confluence/display/KNOX/Index" class="externalLink" title="Wiki">Wiki</a>
- | <span id="publishDate">Last Published: 2014-01-09</span>
+ | <span id="publishDate">Last Published: 2014-01-17</span>
| <span id="projectVersion">Version: 0.0.0-SNAPSHOT</span>
</div>
<div class="clear">
Modified: incubator/knox/site/project-info.html
URL: http://svn.apache.org/viewvc/incubator/knox/site/project-info.html?rev=1559765&r1=1559764&r2=1559765&view=diff
==============================================================================
--- incubator/knox/site/project-info.html (original)
+++ incubator/knox/site/project-info.html Mon Jan 20 16:15:31 2014
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 9, 2014 -->
+<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 17, 2014 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -10,7 +10,7 @@
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
- <meta name="Date-Revision-yyyymmdd" content="20140109" />
+ <meta name="Date-Revision-yyyymmdd" content="20140117" />
<meta http-equiv="Content-Language" content="en" />
<script type="text/javascript">var _gaq = _gaq || [];
@@ -57,7 +57,7 @@
<a href="https://cwiki.apache.org/confluence/display/KNOX/Index" class="externalLink" title="Wiki">Wiki</a>
- | <span id="publishDate">Last Published: 2014-01-09</span>
+ | <span id="publishDate">Last Published: 2014-01-17</span>
| <span id="projectVersion">Version: 0.0.0-SNAPSHOT</span>
</div>
<div class="clear">
Modified: incubator/knox/site/team-list.html
URL: http://svn.apache.org/viewvc/incubator/knox/site/team-list.html?rev=1559765&r1=1559764&r2=1559765&view=diff
==============================================================================
--- incubator/knox/site/team-list.html (original)
+++ incubator/knox/site/team-list.html Mon Jan 20 16:15:31 2014
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 9, 2014 -->
+<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 17, 2014 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -10,7 +10,7 @@
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
- <meta name="Date-Revision-yyyymmdd" content="20140109" />
+ <meta name="Date-Revision-yyyymmdd" content="20140117" />
<meta http-equiv="Content-Language" content="en" />
<script type="text/javascript">var _gaq = _gaq || [];
@@ -57,7 +57,7 @@
<a href="https://cwiki.apache.org/confluence/display/KNOX/Index" class="externalLink" title="Wiki">Wiki</a>
- | <span id="publishDate">Last Published: 2014-01-09</span>
+ | <span id="publishDate">Last Published: 2014-01-17</span>
| <span id="projectVersion">Version: 0.0.0-SNAPSHOT</span>
</div>
<div class="clear">
Modified: incubator/knox/trunk/books/0.4.0/book.md
URL: http://svn.apache.org/viewvc/incubator/knox/trunk/books/0.4.0/book.md?rev=1559765&r1=1559764&r2=1559765&view=diff
==============================================================================
--- incubator/knox/trunk/books/0.4.0/book.md (original)
+++ incubator/knox/trunk/books/0.4.0/book.md Mon Jan 20 16:15:31 2014
@@ -40,8 +40,8 @@
* #[LDAPGroupLookup]
* #[Identity Assertion]
* #[Authorization]
- * #[Configuration]
* #[Secure Clusters]
+ * #[High Availability]
* #[Client Details]
* #[Service Details]
* #[WebHDFS]
Modified: incubator/knox/trunk/books/0.4.0/book_gateway-details.md
URL: http://svn.apache.org/viewvc/incubator/knox/trunk/books/0.4.0/book_gateway-details.md?rev=1559765&r1=1559764&r2=1559765&view=diff
==============================================================================
--- incubator/knox/trunk/books/0.4.0/book_gateway-details.md (original)
+++ incubator/knox/trunk/books/0.4.0/book_gateway-details.md Mon Jan 20 16:15:31 2014
@@ -56,4 +56,5 @@ Their values can also be provided via th
<<config_id_assertion.md>>
<<config_authz.md>>
<<config_kerberos.md>>
+<<config_ha.md>>
Added: incubator/knox/trunk/books/0.4.0/config_ha.md
URL: http://svn.apache.org/viewvc/incubator/knox/trunk/books/0.4.0/config_ha.md?rev=1559765&view=auto
==============================================================================
--- incubator/knox/trunk/books/0.4.0/config_ha.md (added)
+++ incubator/knox/trunk/books/0.4.0/config_ha.md Mon Jan 20 16:15:31 2014
@@ -0,0 +1,124 @@
+<!---
+ 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.
+--->
+
+### High Availability ###
+
+#### Configure Knox instances ####
+
+All Knox instances must be synced to use the same topologies credentials keystores.
+These files are located under {GATEWAY_HOME}/conf/security/keystores/{TOPOLOGY_NAME}-credentials.jceks.
+They are generated after the first topology deployment.
+Currently these files can be synced just manually. There is no automation tool.
+Here are the steps to sync topologies credentials keystores:
+
+1. Choose Knox instance that will be the source for topologies credentials keystores. Let's call it keystores master
+1. Replace topologies credentials keystores in the other Knox instance with topologies credentials keystores from keystores master
+1. Restart Knox instances
+
+#### High Availability with Apache HTTP Server + mod_proxy + mod_proxy_balancer ####
+
+##### 1 - Requirements #####
+
+###### openssl-devel ######
+
+openssl-devel is required for Apache Module mod_ssl.
+
+ sudo yum install openssl-devel
+
+###### Apache HTTP Server ######
+
+Apache HTTP Server 2.4.6 or later is required. See this document for installing and setting up Apache HTTP Server: http://httpd.apache.org/docs/2.4/install.html
+
+Hint: pass --enable-ssl to ./configure command to enable Apache Module mod_ssl generation.
+
+###### Apache Module mod_proxy ######
+
+See this document for setting up Apache Module mod_proxy: http://httpd.apache.org/docs/2.4/mod/mod_proxy.html
+
+###### Apache Module mod_proxy_balancer ######
+
+See this document for setting up Apache Module mod_proxy_balancer: http://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html
+
+###### Apache Module mod_ssl ######
+
+See this document for setting up Apache Module mod_ssl: http://httpd.apache.org/docs/2.4/mod/mod_ssl.html
+
+##### 2 - Configuration example #####
+
+###### Generate certificate for Apache HTTP Server ######
+
+See this document for an example: http://www.akadia.com/services/ssh_test_certificate.html
+
+By convention, Apache HTTP Server and Knox certificates are put into /etc/apache2/ssl/ folder.
+
+###### Update Apache HTTP Server configuration file ######
+
+This file is located under {APACHE_HOME}/conf/httpd.conf.
+
+Following directives have to be added or uncommented in the configuration file:
+
+* LoadModule proxy_module modules/mod_proxy.so
+* LoadModule proxy_http_module modules/mod_proxy_http.so
+* LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
+* LoadModule ssl_module modules/mod_ssl.so
+* LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
+* LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
+* LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
+* LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
+* LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
+
+Also following lines have to be added to file. Replace placeholders (${...}) with real data:
+
+ Listen 443
+ <VirtualHost *:443>
+ SSLEngine On
+ SSLProxyEngine On
+ SSLCertificateFile ${PATH_TO_CERTICICATE_FILE}
+ SSLCertificateKeyFile ${PATH_TO_CERTICICATE_KEY_FILE}
+ SSLProxyCACertificateFile ${PATH_TO_PROXY_CA_CERTICICATE_FILE}
+
+ ProxyRequests Off
+ ProxyPreserveHost Off
+
+ Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED
+ <Proxy balancer://mycluster>
+ BalancerMember ${HOST_#1} route=1
+ BalancerMember ${HOST_#2} route=2
+ ...
+ BalancerMember ${HOST_#N} route=N
+
+ ProxySet failontimeout=On lbmethod=${LB_METHOD} stickysession=ROUTEID
+ </Proxy>
+
+ ProxyPass / balancer://mycluster/
+ ProxyPassReverse / balancer://mycluster/
+ </VirtualHost>
+
+Note:
+
+* SSLProxyEngine enables SSL between Apache HTTP Server and Knox instances;
+* SSLCertificateFile and SSLCertificateKeyFile have to point to certificate data of Apache HTTP Server. User will use this certificate for communications with Apache HTTP Server;
+* SSLProxyCACertificateFile has to point to Knox certificates.
+
+###### Start/stop Apache HTTP Server ######
+
+ APACHE_HOME/bin/apachectl -k start
+ APACHE_HOME/bin/apachectl -k stop
+
+###### Verify ######
+
+Use Knox samples.