webhcat的安裝
前提:1、hadoop的已經安裝。此處使用的hadoop-1.0.4版本。
2、hive以及hcatalog已經安裝。由於我這使用的是hive-0.11.0版本,它本身自帶了hcatalog。故我這就無需安裝這些。
3、zookeeper的安裝。我這裏使用的版本是 zookeeper-3.3.6
3、環境變量的設置。HADOOP_HOME,HIVE_HOME,TEMPLETON_HOME(/home/hadoop/hive-0.11/hcatalog)
使用相應的版本下的jar包替換$TEMPLETON_HOME/share/webhcat/svr/lib下的一些jar包。
如:hadoop-core-1.0.4.jar hadoop-tools-1.0.4.jar,zookeeper-3.3.6
複製 webhcat-0.11.0.jar到$TEMPLETON_HOME/share/webhcat/svr。若存在則替換,否則添加
修改 Hadoop Distributed Cache
hadoop fs -put /tmp/hive-0.11.0.tar.gz
/apps/templeton/hive-0.11.0.tar.gz
hadoop fs -put <hadoop streaming jar> \
<templeton.streaming.jar>/hadoop-streaming-*.jar
hadoop fs -put ugi.jar /apps/templeton/ugi.jar
直接修改配置文件webhcat-site.xml文件。注意這個文件的位置是在$HADOOP_HOME/conf/目錄下。
注意關於裏面的路徑最好採用絕對路徑
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<!-- The default settings for Templeton. -->
<!-- Edit templeton-site.xml to change settings for your local -->
<!-- install. -->
<configuration>
<property>
<name>templeton.hadoop.conf.dir</name>
<value>/home/hadoop-1.0.4/conf</value>
<description>The path to the Hadoop configuration.</description>
</property>
<property>
<name>templeton.jar</name>
<value>/home/hadoop/hive-0.11/hcatalog/share/webhcat/svr/webhcat-0.11.0.jar</value>
<description>The path to the Templeton jar file.</description>
</property>
<property>
<name>templeton.libjars</name>
<value>/home/hadoop/hive-0.11/hcatalog/share/webhcat/svr/lib/zookeeper-3.3.6.jar</value>
<description>Jars to add to the classpath.</description>
</property>
<property>
<name>templeton.streaming.jar</name>
<value>hdfs://192.168.32.203:9000/apps/webhcat/hadoop-streaming-1.0.4.jar</value>
<description>The hdfs path to the Hadoop streaming jar file.</description>
</property>
<property>
<name>templeton.hadoop</name>
<value>/home/hadoop/hadoop-1.0.4/bin/hadoop</value>
<description>The path to the Hadoop executable.</description>
</property>
<property>
<name>templeton.hcat</name>
<value>/home/hadoop/hive-0.11/hcatalog/bin/hcat</value>
<description>The HTTP port for the main server.</description>
</property>
<property>
<name>templeton.hive.archive</name>
<value>hdfs://192.168.32.203:9000/apps/webhcat/hive-0.11.0.tar.gz</value>
<description>The path to the Hive archive.</description>
</property>
<property>
<name>templeton.hive.path</name>
<value>hive-0.11.0.tar.gz/hive-0.11.0/bin/hive</value>
<description>The path to the Hive executable.</description>
</property>
<property>
<name>templeton.hive.properties</name>
<value>hive.metastore.local=false,hive.metastore.uris=thrift://localhost:9933,hive.metastore.sasl.enabled=false</value>
<description>Properties to set when running hive.</description>
</property>
<property>
<name>templeton.exec.encoding</name>
<value>UTF-8</value>
<description>The encoding of the stdout and stderr data.</description>
</property>
<property>
<name>templeton.exec.timeout</name>
<value>10000</value>
<description>
How long in milliseconds a program is allowed to run on the
Templeton box.
</description>
</property>
<property>
<name>templeton.exec.max-procs</name>
<value>16</value>
<description>The maximum number of processes allowed to run at once.</description>
</property>
<property>
<name>templeton.exec.max-output-bytes</name>
<value>1048576</value>
<description>
The maximum number of bytes from stdout or stderr stored in ram.
</description>
</property>
<property>
<name>templeton.controller.mr.child.opts</name>
<value>-server -Xmx1024m -Djava.net.preferIPv4Stack=true</value>
<description>Java options to be passed to templeton controller map task.
The default value of mapreduce child "-Xmx" (heap memory limit)
might be close to what is allowed for a map task.
Even if templeton controller map task does not need much
memory, the jvm (with -server option?)
allocates the max memory when it starts. This along with the
memory used by pig/hive client it starts can end up exceeding
the max memory configured to be allowed for a map task
Use this option to set -Xmx to lower value
</description>
</property>
<property>
<name>templeton.exec.envs</name>
<value>HADOOP_HOME,JAVA_HOME,HIVE_HOME</value>
<description>The environment variables passed through to exec.</description>
</property>
<property>
<name>templeton.zookeeper.hosts</name>
<value>192.168.32.203:2181,192.168.32.93:2181,192.168.32.206:2181</value>
<description>ZooKeeper servers, as comma separated host:port pairs</description>
</property>
<property>
<name>webhcat.proxyuser.hadoop.groups</name>
<value>hadoop</value>
</property>
<property>
<name>webhcat.proxyuser.hadoop.hosts</name>
<value>zhaocw.host,192.168.32.203</value>
</property>
<property>
<name>templeton.port</name>
<value>50222</value>
</property>
<property>
<name>templeton.hive.properties</name>
<value>hive.metastore.local=false,hive.metastore.sasl.enabled=false</value>
<description>Properties to set when running hive.</description>
</property>
<property>
<name>templeton.override.jars</name>
<value>hdfs://192.168.32.203:9000/apps/webhcat/ugi.jar</value>
</property>
<property>
<name>templeton.override.enabled</name>
<value>false</value>
</property>
</configuration>
在core-site.xml裏增加如下內容
<property>
<name>hadoop.security.authorization</name>
<value>false</value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.hosts</name>
<value>zhaocw.host,192.168.32.203</value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.groups</name>
<value>hadoop,supergroup</value>
</property>
配置的內容差不多就這麼多了。
直接啓動webhcat.進入$TEMPLETON_HOME/sbin
運行:./webhcat_server.sh start 啓動
./webhcat_server.sh start 停止
webhcat 安裝及配置
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.