PageRenderTime 47ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.2.0-rc0/src/docs/src/documentation/content/xdocs/install.xml

#
XML | 236 lines | 181 code | 39 blank | 16 comment | 0 complexity | 61f251992469f731262fbb60d598f96a MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
  17. <document>
  18. <header>
  19. <title>Installing HCatalog</title>
  20. </header>
  21. <body>
  22. <section>
  23. <title>Server Installation</title>
  24. <p><strong>Prerequisites</strong></p>
  25. <ul>
  26. <li>Machine on which the server can be installed - this should have
  27. access to the hadoop cluster in question, and be accessible from
  28. the machines you launch jobs from</li>
  29. <li>MySQL db</li>
  30. <li>Hadoop cluster</li>
  31. <li>Unix user that the server will run as, and an associated kerberos
  32. service principal and keytabs.</li>
  33. </ul>
  34. <p>Throughout these instructions when you see a word in <em>italics</em> it
  35. indicates a place where you should replace the word with a locally
  36. appropriate value such as a hostname or password.</p>
  37. <p><strong>Database Setup</strong></p>
  38. <p>Select a machine to install the database on. This need not be the same
  39. machine as the Thrift server, which we will set up later. For large
  40. clusters we recommend that they not be the same machine. For the
  41. purposes of these instructions we will refer to this machine as
  42. <em>hcatdb.acme.com</em></p>
  43. <p>Install MySQL server on <em>hcatdb.acme.com</em>. You can obtain
  44. packages for MySQL from <a href="http://www.mysql.com/downloads/">MySQL's
  45. download site</a>. We have developed and tested with versions 5.1.46
  46. and 5.1.48. We suggest you use these versions or later.
  47. Once you have MySQL up and running, use the <code>mysql</code> command line
  48. tool to add the <code>hive</code> user and <code>hivemetastoredb</code>
  49. database. You will need to pick a password for your <code>hive</code>
  50. user, and replace <em>dbpassword</em> in the following commands with it.</p>
  51. <p><code>mysql -u root</code></p>
  52. <p><code>mysql> CREATE USER 'hive'@'</code><em>hcatdb.acme.com</em><code>' IDENTIFIED BY '</code><em>dbpassword</em><code>';</code></p>
  53. <p><code>mysql> CREATE DATABASE hivemetastoredb DEFAULT CHARACTER SET latin1 DEFAULT COLLATE latin1_swedish_ci;</code></p>
  54. <p><code>mysql> GRANT ALL PRIVILEGES ON hivemetastoredb.* TO 'hive'@'</code><em>hcatdb.acme.com</em><code>' WITH GRANT OPTION;</code></p>
  55. <p><code>mysql> flush privileges;</code></p>
  56. <p><code>mysql> quit;</code></p>
  57. <p>In a temporary directory, untar the HCatalog artifact</p>
  58. <p><code>tar xzf hcatalog-</code><em>version</em><code>.tar.gz</code></p>
  59. <p>Use the database installation script found in the package to create the
  60. database</p>
  61. <p><code>mysql -u hive -D hivemetastoredb -h</code><em>hcatdb.acme.com</em><code> -p &lt; scripts/hive-schema-0.7.0.mysql.sql</code></p>
  62. <p><strong>Thrift Server Setup</strong></p>
  63. <p>Select a machine to install your Thrift server on. For smaller and test
  64. installations this can be the same machine as the database. For the
  65. purposes of these instructions we will refer to this machine as
  66. <em>hcatsvr.acme.com</em>.</p>
  67. <p>Install the MySQL Java connector libraries on <em>hcatsvr.acme.com</em>.
  68. You can obtain these from
  69. <a href="http://www.mysql.com/downloads/connector/j/5.1.html">MySQL's
  70. download site</a>.</p>
  71. <p>Select a user to run the Thrift server as. This user should not be a
  72. human user, and must be able to act as a proxy for other users. We suggest
  73. the name "hcat" for the user. Throughout the rest of this documentation
  74. we will refer to this user as "hcat". If necessary, add the user to
  75. <em>hcatsvr.acme.com</em>.</p>
  76. <p>Select a <em>root</em> directory for your installation of HCatalog. This
  77. directory must be owned by the hcat user. We recommend
  78. <code>/usr/local/hcat</code>. If necessary, create the directory.</p>
  79. <p>Download the HCatalog release into a temporary directory, and untar
  80. it. Then change directories into the new distribution and run the HCatalog
  81. server installation script. You will need to know the directory you chose
  82. as <em>root</em> and the
  83. directory you installed the MySQL Java connector libraries into (referred
  84. to in the command below as <em>dbroot</em>).</p>
  85. <p><code>tar zxf hcatalog-</code><em>version</em><code>.tar.gz
  86. cd hcatalog-</code><em>version</em></p>
  87. <p><code>scripts/hcat_server_install.sh -r </code><em>root</em><code> -d </code><em>dbroot</em></p>
  88. <p>Now you need to edit your <em>root</em><code>/conf/hive-site.xml</code> file.
  89. Open this file in your favorite text editor. The following table shows the
  90. values you need to configure.</p>
  91. <table>
  92. <tr>
  93. <th>Parameter</th>
  94. <th>Value to Set it to</th>
  95. </tr>
  96. <tr>
  97. <td>javax.jdo.option.ConnectionURL</td>
  98. <td>In the JDBC connection string, change DBHOSTNAME to the name
  99. of the machine you put the MySQL server on.</td>
  100. </tr>
  101. <tr>
  102. <td>javax.jdo.option.ConnectionPassword</td>
  103. <td><em>dbpassword</em> value you used in setting up the MySQL server
  104. above</td>
  105. </tr>
  106. <tr>
  107. <td>hive.metastore.warehouse.dir</td>
  108. <td>The directory you want to use for the default database in your
  109. installation</td>
  110. </tr>
  111. <tr>
  112. <td>hive.metastore.uris</td>
  113. <td>You need to set the hostname to your Thrift
  114. server. Replace <em>SVRHOST</em> with the name of the
  115. machine you are installing the Thrift server on. You can also
  116. change the port the Thrift server runs on by changing the default
  117. value of 3306.</td>
  118. </tr>
  119. <tr>
  120. <td>hive.metastore.sasl.enabled</td>
  121. <td>Set to true by default. Set to false if you do not wish to
  122. secure the thrift interface. This can be convenient for testing.
  123. We do not recommend turning this off in production.</td>
  124. </tr>
  125. <tr>
  126. <td>hive.metastore.kerberos.keytab.file</td>
  127. <td>The path to the Kerberos keytab file containg the metastore
  128. thrift server's service principal.</td>
  129. </tr>
  130. <tr>
  131. <td>hive.metastore.kerberos.principal</td>
  132. <td>The service principal for the metastore thrift server. You can
  133. reference your host as _HOST and it will be replaced with your
  134. actual hostname</td>
  135. </tr>
  136. </table>
  137. <p>You can now procede to starting the server.</p>
  138. </section>
  139. <section>
  140. <title>Starting the Server</title>
  141. <p>Start the HCatalog server by switching directories to
  142. <em>root</em> and invoking the start script
  143. <code>bin/hcat_server_start.sh</code></p>
  144. </section>
  145. <section>
  146. <title>Logging</title>
  147. <p>Server activity logs and gc logs are located in
  148. <em>root</em><code>/var/log/hcat_server</code>. Logging configuration is located at
  149. <em>root</em><code>/conf/log4j.properties</code>. Server logging uses
  150. <code>DailyRollingFileAppender</code> by default. It will generate a new
  151. file per day and does not expire old log files automatically.</p>
  152. </section>
  153. <section>
  154. <title>Stopping the Server</title>
  155. <p>To stop the HCatalog server, change directories to the <em>root</em>
  156. directory and invoke the stop script
  157. <code>bin/hcat_server_stop.sh</code></p>
  158. </section>
  159. <section>
  160. <title>Client Install</title>
  161. <p>Select a <em>root</em> directory for your installation of HCatalog client.
  162. We recommend <code>/usr/local/hcat</code>. If necessary, create the directory.</p>
  163. <p>Download the HCatalog release into a temporary directory, and untar
  164. it.</p>
  165. <p><code>tar zxf hcatalog-</code><em>version</em><code>.tar.gz</code></p>
  166. <p>Now you need to edit your <em>root</em><code>/conf/hive-site.xml</code> file.
  167. Open this file in your favorite text editor. The following table shows the
  168. values you need to configure. These values should match the values set on
  169. the HCatalog server. Do <strong>NOT</strong> copy the configuration file
  170. from your server installation as that contains the password to your
  171. database, which you should not distribute to your clients.</p>
  172. <table>
  173. <tr>
  174. <th>Parameter</th>
  175. <th>Value to Set it to</th>
  176. </tr>
  177. <tr>
  178. <td>hive.metastore.warehouse.dir</td>
  179. <td>The directory you want to use for the default database in your
  180. installation</td>
  181. </tr>
  182. <tr>
  183. <td>hive.metastore.uris</td>
  184. <td>You need to set the hostname wish your Thrift
  185. server to use by replacing <em>SVRHOST</em> with the name of the
  186. machine you are installing the Thrift server on. You can also
  187. change the port the Thrift server runs on by changing the default
  188. value of 3306.</td>
  189. </tr>
  190. </table>
  191. <p>The HCatalog command line interface (CLI) can now be invoked as
  192. <em>root</em><code>/bin/hcat.sh</code>.</p>
  193. </section>
  194. </body>
  195. </document>