Page MenuHomec4science

ServerSetup.html
No OneTemporary

File Metadata

Created
Tue, Feb 25, 18:36

ServerSetup.html

<!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 at 2014-02-11 -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HttpFS - Hadoop HDFS over HTTP 2.3.0 - Server Setup</title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20140211" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body class="composite">
<div id="banner">
<a href="http://hadoop.apache.org/" id="bannerLeft">
<img src="http://hadoop.apache.org/images/hadoop-logo.jpg" alt="" />
</a>
<a href="http://www.apache.org/" id="bannerRight">
<img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<a href="http://www.apache.org/" class="externalLink">Apache</a>
&gt;
<a href="http://hadoop.apache.org/" class="externalLink">Hadoop</a>
&gt;
HttpFS
</div>
<div class="xright"> <a href="http://wiki.apache.org/hadoop" class="externalLink">Wiki</a>
|
<a href="https://svn.apache.org/repos/asf/hadoop/" class="externalLink">SVN</a>
|
<a href="http://hadoop.apache.org/" class="externalLink">Apache Hadoop</a>
&nbsp;| Last Published: 2014-02-11
&nbsp;| Version: 2.3.0
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>General</h5>
<ul>
<li class="none">
<a href="../index.html">Overview</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/SingleCluster.html">Single Node Setup</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/ClusterSetup.html">Cluster Setup</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/CommandsManual.html">Hadoop Commands Reference</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/FileSystemShell.html">File System Shell</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/Compatibility.html">Hadoop Compatibility</a>
</li>
</ul>
<h5>Common</h5>
<ul>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/CLIMiniCluster.html">CLI Mini Cluster</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/NativeLibraries.html">Native Libraries</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/Superusers.html">Superusers</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/SecureMode.html">Secure Mode</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/ServiceLevelAuth.html">Service Level Authorization</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/HttpAuthentication.html">HTTP Authentication</a>
</li>
</ul>
<h5>HDFS</h5>
<ul>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html">HDFS User Guide</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/HDFSHighAvailabilityWithQJM.html">High Availability With QJM</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/HDFSHighAvailabilityWithNFS.html">High Availability With NFS</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/Federation.html">Federation</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsSnapshots.html">HDFS Snapshots</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsDesign.html">HDFS Architecture</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsEditsViewer.html">Edits Viewer</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsImageViewer.html">Image Viewer</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html">Permissions and HDFS</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsQuotaAdminGuide.html">Quotas and HDFS</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/Hftp.html">HFTP</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/LibHdfs.html">C API libhdfs</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/WebHDFS.html">WebHDFS REST API</a>
</li>
<li class="none">
<a href="../hadoop-hdfs-httpfs/index.html">HttpFS Gateway</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/ShortCircuitLocalReads.html">Short Circuit Local Reads</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/CentralizedCacheManagement.html">Centralized Cache Management</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsNfsGateway.html">HDFS NFS Gateway</a>
</li>
</ul>
<h5>MapReduce</h5>
<ul>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduce_Compatibility_Hadoop1_Hadoop2.html">Compatibilty between Hadoop 1.x and Hadoop 2.x</a>
</li>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/EncryptedShuffle.html">Encrypted Shuffle</a>
</li>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/PluggableShuffleAndPluggableSort.html">Pluggable Shuffle/Sort</a>
</li>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/DistributedCacheDeploy.html">Distributed Cache Deploy</a>
</li>
</ul>
<h5>YARN</h5>
<ul>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/YARN.html">YARN Architecture</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/WritingYarnApplications.html">Writing YARN Applications</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/CapacityScheduler.html">Capacity Scheduler</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/FairScheduler.html">Fair Scheduler</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/WebApplicationProxy.html">Web Application Proxy</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/YarnCommands.html">YARN Commands</a>
</li>
<li class="none">
<a href="../hadoop-sls/SchedulerLoadSimulator.html">Scheduler Load Simulator</a>
</li>
</ul>
<h5>YARN REST APIs</h5>
<ul>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/WebServicesIntro.html">Introduction</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html">Resource Manager</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/NodeManagerRest.html">Node Manager</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/MapredAppMasterRest.html">MR Application Master</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/HistoryServerRest.html">History Server</a>
</li>
</ul>
<h5>Auth</h5>
<ul>
<li class="none">
<a href="../hadoop-auth/index.html">Overview</a>
</li>
<li class="none">
<a href="../hadoop-auth/Examples.html">Examples</a>
</li>
<li class="none">
<a href="../hadoop-auth/Configuration.html">Configuration</a>
</li>
<li class="none">
<a href="../hadoop-auth/BuildingIt.html">Building</a>
</li>
</ul>
<h5>Reference</h5>
<ul>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/releasenotes.html">Release Notes</a>
</li>
<li class="none">
<a href="../api/index.html">API docs</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/CHANGES.txt">Common CHANGES.txt</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/CHANGES.txt">HDFS CHANGES.txt</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-mapreduce/CHANGES.txt">MapReduce CHANGES.txt</a>
</li>
</ul>
<h5>Configuration</h5>
<ul>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/core-default.xml">core-default.xml</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/hdfs-default.xml">hdfs-default.xml</a>
</li>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml">mapred-default.xml</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-common/yarn-default.xml">yarn-default.xml</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/DeprecatedProperties.html">Deprecated Properties</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img alt="Built by Maven" src="./images/logos/maven-feather.png"/>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<!-- Licensed 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="section">
<h2>Hadoop HDFS over HTTP 2.3.0 - Server Setup<a name="Hadoop_HDFS_over_HTTP_2.3.0_-_Server_Setup"></a></h2>
<p>[ <a href="./index.html">Go Back</a> ]</p>
<p>This page explains how to quickly setup HttpFS with Pseudo authentication against a Hadoop cluster with Pseudo authentication.</p>
<div class="section">
<h3>Requirements<a name="Requirements"></a></h3>
<ul>
<li>Java 6+</li>
<li>Maven 3+</li></ul></div>
<div class="section">
<h3>Install HttpFS<a name="Install_HttpFS"></a></h3>
<div class="source">
<pre>~ $ tar xzf httpfs-2.3.0.tar.gz</pre></div></div>
<div class="section">
<h3>Configure HttpFS<a name="Configure_HttpFS"></a></h3>
<p>By default, HttpFS assumes that Hadoop configuration files (<tt>core-site.xml &amp; hdfs-site.xml</tt>) are in the HttpFS configuration directory.</p>
<p>If this is not the case, add to the <tt>httpfs-site.xml</tt> file the <tt>httpfs.hadoop.config.dir</tt> property set to the location of the Hadoop configuration directory.</p></div>
<div class="section">
<h3>Configure Hadoop<a name="Configure_Hadoop"></a></h3>
<p>Edit Hadoop <tt>core-site.xml</tt> and defined the Unix user that will run the HttpFS server as a proxyuser. For example:</p>
<div class="source">
<pre> ...
&lt;property&gt;
&lt;name&gt;hadoop.proxyuser.#HTTPFSUSER#.hosts&lt;/name&gt;
&lt;value&gt;httpfs-host.foo.com&lt;/value&gt;
&lt;/property&gt;
&lt;property&gt;
&lt;name&gt;hadoop.proxyuser.#HTTPFSUSER#.groups&lt;/name&gt;
&lt;value&gt;*&lt;/value&gt;
&lt;/property&gt;
...</pre></div>
<p>IMPORTANT: Replace <tt>#HTTPFSUSER#</tt> with the Unix user that will start the HttpFS server.</p></div>
<div class="section">
<h3>Restart Hadoop<a name="Restart_Hadoop"></a></h3>
<p>You need to restart Hadoop for the proxyuser configuration ot become active.</p></div>
<div class="section">
<h3>Start/Stop HttpFS<a name="StartStop_HttpFS"></a></h3>
<p>To start/stop HttpFS use HttpFS's bin/httpfs.sh script. For example:</p>
<div class="source">
<pre>httpfs-2.3.0 $ bin/httpfs.sh start</pre></div>
<p>NOTE: Invoking the script without any parameters list all possible parameters (start, stop, run, etc.). The <tt>httpfs.sh</tt> script is a wrapper for Tomcat's <tt>catalina.sh</tt> script that sets the environment variables and Java System properties required to run HttpFS server.</p></div>
<div class="section">
<h3>Test HttpFS is working<a name="Test_HttpFS_is_working"></a></h3>
<div class="source">
<pre>~ $ curl -i &quot;http://&lt;HTTPFSHOSTNAME&gt;:14000?user.name=babu&amp;op=homedir&quot;
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{&quot;homeDir&quot;:&quot;http:\/\/&lt;HTTPFS_HOST&gt;:14000\/user\/babu&quot;}</pre></div></div>
<div class="section">
<h3>Embedded Tomcat Configuration<a name="Embedded_Tomcat_Configuration"></a></h3>
<p>To configure the embedded Tomcat go to the <tt>tomcat/conf</tt>.</p>
<p>HttpFS preconfigures the HTTP and Admin ports in Tomcat's <tt>server.xml</tt> to 14000 and 14001.</p>
<p>Tomcat logs are also preconfigured to go to HttpFS's <tt>logs/</tt> directory.</p>
<p>The following environment variables (which can be set in HttpFS's <tt>conf/httpfs-env.sh</tt> script) can be used to alter those values:</p>
<ul>
<li>HTTPFS_HTTP_PORT</li>
<li>HTTPFS_ADMIN_PORT</li>
<li>HTTPFS_LOG</li></ul></div>
<div class="section">
<h3>HttpFS Configuration<a name="HttpFS_Configuration"></a></h3>
<p>HttpFS supports the following <a href="./httpfs-default.html">configuration properties</a> in the HttpFS's <tt>conf/httpfs-site.xml</tt> configuration file.</p></div>
<div class="section">
<h3>HttpFS over HTTPS (SSL)<a name="HttpFS_over_HTTPS_SSL"></a></h3>
<p>To configure HttpFS to work over SSL edit the <a href="#httpfs-env.sh">httpfs-env.sh</a> script in the configuration directory setting the <a href="#HTTPFS_SSL_ENABLED">HTTPFS_SSL_ENABLED</a> to <a href="#true">true</a>.</p>
<p>In addition, the following 2 properties may be defined (shown with default values):</p>
<ul>
<li>HTTPFS_SSL_KEYSTORE_FILE=$<a name="HOME">HOME</a>/.keystore</li>
<li>HTTPFS_SSL_KEYSTORE_PASS=password</li></ul>
<p>In the HttpFS <tt>tomcat/conf</tt> directory, replace the <tt>server.xml</tt> file with the <tt>ssl-server.xml</tt> file.</p>
<p>You need to create an SSL certificate for the HttpFS server. As the <tt>httpfs</tt> Unix user, using the Java <tt>keytool</tt> command to create the SSL certificate:</p>
<div class="source">
<pre>$ keytool -genkey -alias tomcat -keyalg RSA</pre></div>
<p>You will be asked a series of questions in an interactive prompt. It will create the keystore file, which will be named <b>.keystore</b> and located in the <tt>httpfs</tt> user home directory.</p>
<p>The password you enter for &quot;keystore password&quot; must match the value of the <tt>HTTPFS_SSL_KEYSTORE_PASS</tt> environment variable set in the <tt>httpfs-env.sh</tt> script in the configuration directory.</p>
<p>The answer to &quot;What is your first and last name?&quot; (i.e. &quot;CN&quot;) must be the hostname of the machine where the HttpFS Server will be running.</p>
<p>Start HttpFS. It should work over HTTPS.</p>
<p>Using the Hadoop <tt>FileSystem</tt> API or the Hadoop FS shell, use the <tt>swebhdfs://</tt> scheme. Make sure the JVM is picking up the truststore containing the public key of the SSL certificate if using a self-signed certificate.</p>
<p>[ <a href="./index.html">Go Back</a> ]</p></div></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">&#169; 2014
Apache Software Foundation
- <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a></div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>

Event Timeline