Updated Branches: refs/heads/master 31d510605 -> d00a6bf5e
BIGTOP-964: Bump hive version to 0.11 Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/d00a6bf5 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/d00a6bf5 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/d00a6bf5 Branch: refs/heads/master Commit: d00a6bf5e203f50b29a59d08eb4c0b7ea72c3196 Parents: 31d5106 Author: Mark Grover <[email protected]> Authored: Mon Oct 7 19:30:07 2013 -0700 Committer: Mark Grover <[email protected]> Committed: Mon Oct 7 19:30:07 2013 -0700 ---------------------------------------------------------------------- .../common/hive/hive-hcatalog-server.default | 25 +++ .../src/common/hive/hive-hcatalog-server.svc | 23 +++ bigtop-packages/src/common/hive/hive-hcatalog.1 | 71 ++++++++ .../src/common/hive/hive-server2.default | 20 +++ .../src/common/hive/hive-server2.svc | 71 ++++++++ .../src/common/hive/hive-webhcat-server.default | 23 +++ .../src/common/hive/hive-webhcat-server.svc | 24 +++ bigtop-packages/src/common/hive/install_hive.sh | 136 ++++++++++---- bigtop-packages/src/deb/hive/control | 30 ++++ bigtop-packages/src/deb/hive/hive-hbase.install | 1 + bigtop-packages/src/deb/hive/hive-hcatalog.dirs | 2 + .../src/deb/hive/hive-hcatalog.install | 9 + .../src/deb/hive/hive-hcatalog.postinst | 35 ++++ .../src/deb/hive/hive-hcatalog.prerm | 57 ++++++ bigtop-packages/src/deb/hive/hive-jdbc.install | 10 ++ .../src/deb/hive/hive-webhcat.install | 4 + .../src/deb/hive/hive-webhcat.postinst | 34 ++++ bigtop-packages/src/deb/hive/hive-webhcat.prerm | 57 ++++++ bigtop-packages/src/deb/hive/hive.dirs | 1 + bigtop-packages/src/deb/hive/hive.install | 55 ++++++ bigtop-packages/src/deb/hive/rules | 26 ++- bigtop-packages/src/rpm/hive/SPECS/hive.spec | 176 +++++++++++++++++-- bigtop.mk | 17 +- 23 files changed, 828 insertions(+), 79 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/common/hive/hive-hcatalog-server.default ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hive/hive-hcatalog-server.default b/bigtop-packages/src/common/hive/hive-hcatalog-server.default new file mode 100644 index 0000000..bafcad2 --- /dev/null +++ b/bigtop-packages/src/common/hive/hive-hcatalog-server.default @@ -0,0 +1,25 @@ +# 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. + +export METASTORE_PORT=9083 + +export HADOOP_PREFIX=/usr +export HCAT_LOG_DIR=/var/log/hive-hcatalog +export HCAT_PID_DIR=/var/lib/hive-hcatalog +export HCAT_HOME=/usr/lib/hive-hcatalog +# FIXME: HCATALOG-636 (and also HIVE-2757) +export HADOOP_HOME=${HADOOP_HOME:-/usr/lib/hadoop} +export HIVE_HOME=/usr/lib/hive +export HIVE_CONF_DIR=/etc/hive/conf http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/common/hive/hive-hcatalog-server.svc ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hive/hive-hcatalog-server.svc b/bigtop-packages/src/common/hive/hive-hcatalog-server.svc new file mode 100644 index 0000000..435e626 --- /dev/null +++ b/bigtop-packages/src/common/hive/hive-hcatalog-server.svc @@ -0,0 +1,23 @@ +# 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. +DAEMON="hive-hcatalog-server" +DESC="HCatalog server" +EXEC_PATH="/usr/lib/hive-hcatalog/sbin/hcat_server.sh" +SVC_USER="hive" +DAEMON_FLAGS="" +CONF_DIR="/etc/hive-hcatalog/conf" +# FIXME: HCATALOG-636 +PIDFILE="/var/lib/hive-hcatalog/hcat.pid" +WORKING_DIR="/var/lib/hive-hcatalog" http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/common/hive/hive-hcatalog.1 ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hive/hive-hcatalog.1 b/bigtop-packages/src/common/hive/hive-hcatalog.1 new file mode 100644 index 0000000..12183ae --- /dev/null +++ b/bigtop-packages/src/common/hive/hive-hcatalog.1 @@ -0,0 +1,71 @@ +.\" 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. +.\" +.\" Process this file with +.\" groff -man -Tascii hcatalog.1 +.\" +.TH hcatalog 1 "October 2010 " Linux "User Manuals" + +.SH NAME +Apache Hcatalog \- Data warehouse infrastructure built atop Apache Hadoop. + +.SH SYNOPSIS + +.B hcat +[options] -e[xecute] "<query>" + +.B hcat +[options] [-f[ile]] file : DDL commands it needs to execute + +.SH DESCRIPTION +Apache HCatalog is a table and storage management layer for Apache Hadoop +that enables users with different data processing tools â Apache Pig, +Apache MapReduce, and Apache Hive â to more easily read and write data +on the grid. Apache HCatalogâs table abstraction presents users with a +relational view of data in the Hadoop distributed file system (HDFS) +and ensures that users need not worry about where or in what format their +data is stored â RCFile format, text files, or sequence files. + +Apache HCatalog supports reading and writing files in any format for which +a SerDe can be written. By default, HCatalog supports RCFile, CSV, +JSON, and sequence file formats. To use a custom format, you must +provide the InputFormat, OutputFormat, and SerDe. + +For more information about Apache Hcatalog, see http://incubator.apache.org/hcatalog/ + +.SH OPTIONS + +.IP "-g" +Usage is -g mygroup ...This indicates to Apache HCatalog that table that needs +to be created must have group "mygroup" + +.IP "-p" +Usage is -p rwxr-xr-x ...This indicates to Apache HCatalog that table that needs +to be created must have permissions "rwxr-xr-x" + +.IP "-D" +Usage is -Dkey=value ...The key value pair is passed to Apache HCatalog as a +Java System Property. + +.IP "-e" +Usage is -e 'create table mytable(a int);'...This indicates to Apache HCatalog +to treat the following string as a DDL command and execute it. + +.IP "-f" +Usage is -f myscript.hcatalog ...This indicates to Apache HCatalog that +myscript.hcatalog is a file which contains DDL commands it needs to execute. + +.SH COPYRIGHT +Copyright (C) 2010 The Apache Software Foundation. All rights reserved. http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/common/hive/hive-server2.default ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hive/hive-server2.default b/bigtop-packages/src/common/hive/hive-server2.default new file mode 100644 index 0000000..63bc8d5 --- /dev/null +++ b/bigtop-packages/src/common/hive/hive-server2.default @@ -0,0 +1,20 @@ +# 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 port for Hive server2 daemon to listen to. +# Unfortunatelly, there is no way to specify the interfaces +# to which the daemon binds. +# +#PORT= http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/common/hive/hive-server2.svc ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hive/hive-server2.svc b/bigtop-packages/src/common/hive/hive-server2.svc new file mode 100644 index 0000000..09a7a6e --- /dev/null +++ b/bigtop-packages/src/common/hive/hive-server2.svc @@ -0,0 +1,71 @@ +# 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. + +DAEMON="hive-server2" +DESC="Hive Server2" +EXEC_PATH="/usr/lib/hive/bin/hive" +SVC_USER="hive" +WORKING_DIR="/var/lib/hive" +DAEMON_FLAGS="" +CONF_DIR="/etc/hive/conf" +PIDFILE="/var/run/hive/${DAEMON}.pid" + +generate_start() { + +cat <<'__EOT__' +start() { + [ -x $EXE_FILE ] || exit $ERROR_PROGRAM_NOT_INSTALLED + log_success_msg "Starting $DESC (${DAEMON}): " + + checkstatusofproc + status=$? + if [ "$status" -eq "$STATUS_RUNNING" ]; then + log_success_msg "${DESC} is running" + exit 0 + fi + + LOG_FILE=/var/log/hive/${DAEMON}.out + + exec_env="HADOOP_OPTS=\"-Dhive.log.dir=`dirname $LOG_FILE` -Dhive.log.file=${DAEMON}.log -Dhive.log.threshold=INFO\"" + + su -s /bin/bash $SVC_USER -c "$exec_env nohup nice -n 0 \ + $EXEC_PATH --service hiveserver2 $PORT \ + > $LOG_FILE 2>&1 < /dev/null & "'echo $! '"> $PIDFILE" + sleep 3 + + checkstatusofproc + RETVAL=$? + [ $RETVAL -eq $STATUS_RUNNING ] && touch $LOCKFILE + return $RETVAL +} +__EOT__ + +} + +generate_stop() { + +cat <<'__EOT__' +stop() { + log_success_msg "Stopping $DESC (${DAEMON}): " + killproc -p $PIDFILE java + RETVAL=$? + + [ $RETVAL -eq $RETVAL_SUCCESS ] && rm -f $LOCKFILE $PIDFILE + return $RETVAL +} +__EOT__ + +} + http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/common/hive/hive-webhcat-server.default ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hive/hive-webhcat-server.default b/bigtop-packages/src/common/hive/hive-webhcat-server.default new file mode 100644 index 0000000..f9cd31c --- /dev/null +++ b/bigtop-packages/src/common/hive/hive-webhcat-server.default @@ -0,0 +1,23 @@ +# 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. + +export HCAT_PREFIX=/usr +export HADOOP_PREFIX=/usr +export WEBHCAT_LOG_DIR=/var/log/hive-hcatalog +export WEBHCAT_PID_DIR=/var/lib/hive-hcatalog +# FIXME: HCATALOG-636 +export HIVE_HOME=/usr/lib/hive +export HIVE_CONF_DIR=/etc/hive/conf +export HCAT_HOME=/usr/lib/hive-hcatalog http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/common/hive/hive-webhcat-server.svc ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hive/hive-webhcat-server.svc b/bigtop-packages/src/common/hive/hive-webhcat-server.svc new file mode 100644 index 0000000..b8bb725 --- /dev/null +++ b/bigtop-packages/src/common/hive/hive-webhcat-server.svc @@ -0,0 +1,24 @@ +# 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. +DAEMON="hive-webhcat-server" +DESC="WEBHCat server" +EXEC_PATH="/usr/lib/hive-hcatalog/sbin/webhcat_server.sh" +SVC_USER="hive" +DAEMON_FLAGS="" +CONF_DIR="/etc/hive-webhcat/conf" +# FIXME: HCATALOG-636 +PIDFILE="/var/lib/hive-hcatalog/webhcat.pid" +WORKING_DIR="/var/lib/hive-hcatalog" + http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/common/hive/install_hive.sh ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hive/install_hive.sh b/bigtop-packages/src/common/hive/install_hive.sh index 123645d..fbd4a7a 100755 --- a/bigtop-packages/src/common/hive/install_hive.sh +++ b/bigtop-packages/src/common/hive/install_hive.sh @@ -24,10 +24,12 @@ usage: $0 <options> Optional options: --doc-dir=DIR path to install docs into [/usr/share/doc/hive] - --lib-dir=DIR path to install hive home [/usr/lib/hive] - --installed-lib-dir=DIR path where lib-dir will end up on target system + --hive-dir=DIR path to install hive home [/usr/lib/hive] + --installed-hive-dir=DIR path where hive-dir will end up on target system --bin-dir=DIR path to install bins [/usr/bin] --examples-dir=DIR path to install examples [doc-dir/examples] + --hcatalog-dir=DIR path to install hcatalog [/usr/lib/hcatalog] + --installed-hcatalog-dir=DIR path where hcatalog-dir will end up on target system ... [ see source for more similar options ] " exit 1 @@ -38,11 +40,13 @@ OPTS=$(getopt \ -o '' \ -l 'prefix:' \ -l 'doc-dir:' \ - -l 'lib-dir:' \ - -l 'installed-lib-dir:' \ + -l 'hive-dir:' \ + -l 'installed-hive-dir:' \ -l 'bin-dir:' \ -l 'examples-dir:' \ -l 'python-dir:' \ + -l 'hcatalog-dir:' \ + -l 'installed-hcatalog-dir:' \ -l 'build-dir:' -- "$@") if [ $? != 0 ] ; then @@ -61,11 +65,11 @@ while true ; do --doc-dir) DOC_DIR=$2 ; shift 2 ;; - --lib-dir) - LIB_DIR=$2 ; shift 2 + --hive-dir) + HIVE_DIR=$2 ; shift 2 ;; - --installed-lib-dir) - INSTALLED_LIB_DIR=$2 ; shift 2 + --installed-hive-dir) + INSTALLED_HIVE_DIR=$2 ; shift 2 ;; --bin-dir) BIN_DIR=$2 ; shift 2 @@ -76,6 +80,12 @@ while true ; do --python-dir) PYTHON_DIR=$2 ; shift 2 ;; + --hcatalog-dir) + HCATALOG__DIR=$2 ; shift 2 + ;; + --installed-hcatalog-dir) + INSTALLED_HCATALOG__DIR=$2 ; shift 2 + ;; --) shift ; break ;; @@ -94,29 +104,37 @@ for var in PREFIX BUILD_DIR ; do fi done -MAN_DIR=/usr/share/man/man1 -DOC_DIR=${DOC_DIR:-/usr/share/doc/hive} -LIB_DIR=${LIB_DIR:-/usr/lib/hive} -INSTALLED_LIB_DIR=${INSTALLED_LIB_DIR:-/usr/lib/hive} +MAN_DIR=$PREFIX/usr/share/man/man1 +DOC_DIR=${DOC_DIR:-$PREFIX/usr/share/doc/hive} +HIVE_DIR=${HIVE_DIR:-$PREFIX/usr/lib/hive} +INSTALLED_HIVE_DIR=${INSTALLED_HIVE_DIR:-/usr/lib/hive} EXAMPLES_DIR=${EXAMPLES_DIR:-$DOC_DIR/examples} -BIN_DIR=${BIN_DIR:-/usr/bin} -PYTHON_DIR=${PYTHON_DIR:-$LIB_DIR/lib/py} +BIN_DIR=${BIN_DIR:-$PREFIX/usr/bin} +PYTHON_DIR=${PYTHON_DIR:-$HIVE_DIR/lib/py} +HCATALOG_DIR=${HCATALOG_DIR:-$PREFIX/usr/lib/hive-hcatalog} +HCATALOG_SHARE_DIR=${HCATALOG_DIR}/share/hcatalog +INSTALLED_HCATALOG_DIR=${INSTALLED_HCATALOG_DIR:-/usr/lib/hive-hcatalog} CONF_DIR=/etc/hive CONF_DIST_DIR=/etc/hive/conf.dist # First we'll move everything into lib -install -d -m 0755 ${PREFIX}/${LIB_DIR} -(cd ${BUILD_DIR} && tar -cf - .)|(cd ${PREFIX}/${LIB_DIR} && tar -xf -) +install -d -m 0755 ${HIVE_DIR} +(cd ${BUILD_DIR} && tar -cf - .)|(cd ${HIVE_DIR} && tar -xf -) + +for jar in `ls ${HIVE_DIR}/lib/hive-*.jar`; do + base=`basename $jar` + (cd ${HIVE_DIR}/lib && ln -s $base ${base/-[0-9].*/.jar}) +done for thing in conf README.txt examples lib/py; do - rm -rf ${PREFIX}/${LIB_DIR}/$thing + rm -rf ${HIVE_DIR}/$thing done -install -d -m 0755 ${PREFIX}/${BIN_DIR} -for file in hive +install -d -m 0755 ${BIN_DIR} +for file in hive beeline hiveserver2 do - wrapper=${PREFIX}/$BIN_DIR/$file + wrapper=$BIN_DIR/$file cat >>$wrapper <<EOF #!/bin/bash @@ -126,8 +144,8 @@ do BIGTOP_DEFAULTS_DIR=\${BIGTOP_DEFAULTS_DIR-/etc/default} [ -n "\${BIGTOP_DEFAULTS_DIR}" -a -r \${BIGTOP_DEFAULTS_DIR}/hbase ] && . \${BIGTOP_DEFAULTS_DIR}/hbase -export HIVE_HOME=$INSTALLED_LIB_DIR -exec $INSTALLED_LIB_DIR/bin/$file "\$@" +export HIVE_HOME=$INSTALLED_HIVE_DIR +exec $INSTALLED_HIVE_DIR/bin/$file "\$@" EOF chmod 755 $wrapper done @@ -142,30 +160,76 @@ done cp hive-site.xml ${PREFIX}${CONF_DIST_DIR} sed -i -e "s|@VERSION@|${HIVE_VERSION}|" ${PREFIX}${CONF_DIST_DIR}/hive-site.xml -ln -s ${CONF_DIR}/conf $PREFIX/$LIB_DIR/conf +ln -s ${CONF_DIR}/conf $HIVE_DIR/conf -install -d -m 0755 $PREFIX/$MAN_DIR -gzip -c hive.1 > $PREFIX/$MAN_DIR/hive.1.gz +install -d -m 0755 $MAN_DIR +gzip -c hive.1 > $MAN_DIR/hive.1.gz # Docs -install -d -m 0755 ${PREFIX}/${DOC_DIR} -cp ${BUILD_DIR}/README.txt ${PREFIX}/${DOC_DIR} -mv ${PREFIX}/${LIB_DIR}/NOTICE ${PREFIX}/${DOC_DIR} -mv ${PREFIX}/${LIB_DIR}/LICENSE ${PREFIX}/${DOC_DIR} -mv ${PREFIX}/${LIB_DIR}/RELEASE_NOTES.txt ${PREFIX}/${DOC_DIR} +install -d -m 0755 ${DOC_DIR} +cp ${BUILD_DIR}/README.txt ${DOC_DIR} +mv ${HIVE_DIR}/NOTICE ${DOC_DIR} +mv ${HIVE_DIR}/LICENSE ${DOC_DIR} +mv ${HIVE_DIR}/RELEASE_NOTES.txt ${DOC_DIR} # Examples -install -d -m 0755 ${PREFIX}/${EXAMPLES_DIR} -cp -a ${BUILD_DIR}/examples/* ${PREFIX}/${EXAMPLES_DIR} +install -d -m 0755 ${EXAMPLES_DIR} +cp -a ${BUILD_DIR}/examples/* ${EXAMPLES_DIR} # Python libs -install -d -m 0755 ${PREFIX}/${PYTHON_DIR} -(cd $BUILD_DIR/lib/py && tar cf - .) | (cd ${PREFIX}/${PYTHON_DIR} && tar xf -) -chmod 755 ${PREFIX}/${PYTHON_DIR}/hive_metastore/*-remote +install -d -m 0755 ${PYTHON_DIR} +(cd $BUILD_DIR/lib/py && tar cf - .) | (cd ${PYTHON_DIR} && tar xf -) +chmod 755 ${PYTHON_DIR}/hive_metastore/*-remote # Dir for Metastore DB install -d -m 1777 $PREFIX/var/lib/hive/metastore/ +# We need to remove the .war files. No longer supported. +rm -f ${HIVE_DIR}/lib/hive-hwi*.war + # Remove some source which gets installed -rm -rf ${PREFIX}/${LIB_DIR}/lib/php/ext +rm -rf ${HIVE_DIR}/lib/php/ext + +install -d -m 0755 ${HCATALOG_DIR} +mv ${HIVE_DIR}/hcatalog/* ${HCATALOG_DIR} +install -d -m 0755 ${PREFIX}/etc/default +for conf in `cd ${HCATALOG_DIR}/etc ; ls -d *` ; do + install -d -m 0755 ${PREFIX}/etc/hive-$conf + mv ${HCATALOG_DIR}/etc/$conf ${PREFIX}/etc/hive-$conf/conf.dist + ln -s /etc/hive-$conf/conf ${HCATALOG_DIR}/etc/$conf + touch ${PREFIX}/etc/default/hive-$conf-server +done + +wrapper=$BIN_DIR/hcat +cat >>$wrapper <<EOF +#!/bin/sh +. /etc/default/hadoop + +# Autodetect JAVA_HOME if not defined +. /usr/lib/bigtop-utils/bigtop-detect-javahome + +# FIXME: HCATALOG-636 (and also HIVE-2757) +export HIVE_HOME=/usr/lib/hive +export HIVE_CONF_DIR=/etc/hive/conf +export HCAT_HOME=$INSTALLED_HCATALOG_DIR + +export HCATALOG_HOME=$INSTALLED_HCATALOG_DIR +exec $INSTALLED_HCATALOG_DIR/bin/hcat "\$@" +EOF +chmod 755 $wrapper + +# Install the docs +install -d -m 0755 ${DOC_DIR} +mv $HCATALOG_DIR/share/doc/hcatalog/* ${DOC_DIR} +# Might as delete the directory since it's empty now +rm -rf $HCATALOG_DIR/share/doc +install -d -m 0755 $MAN_DIR +gzip -c hive-hcatalog.1 > $MAN_DIR/hive-hcatalog.1.gz + +# Provide the runtime dirs +install -d -m 0755 $PREFIX/var/lib/hive +install -d -m 0755 $PREFIX/var/log/hive + +install -d -m 0755 $PREFIX/var/lib/hive-hcatalog +install -d -m 0755 $PREFIX/var/log/hive-hcatalog http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/control ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/control b/bigtop-packages/src/deb/hive/control index 66bd4b5..adf2858 100644 --- a/bigtop-packages/src/deb/hive/control +++ b/bigtop-packages/src/deb/hive/control @@ -40,6 +40,12 @@ Depends: hive (= ${source:Version}) Description: Provides a Hive Thrift service. This optional package hosts a Thrift server for Hive clients across a network to use. +Package: hive-server2 +Architecture: all +Depends: hive (= ${source:Version}) +Description: Provides a Hive Thrift service with improved concurrency support. + This optional package hosts a Thrift server for Hive clients across a network to use, with improved concurrency support. + Package: hive-metastore Architecture: all Depends: hive (= ${source:Version}) @@ -57,3 +63,27 @@ Architecture: all Depends: hadoop-client Description: Provides libraries necessary to connect to Apache Hive via JDBC This package provides libraries necessary to connect to Apache Hive via JDBC + +Package: hive-hcatalog +Architecture: all +Depends: hadoop, hive, bigtop-utils (>= 0.6) +Description: Apache HCatalog is a table and storage management service. + Apache HCatalog is a table and storage management service for data created using Apache Hadoop. + +Package: hive-hcatalog-server +Architecture: all +Depends: hive-hcatalog (= ${source:Version}) +Description: Server for HCatalog. + Init scripts for HCatalog server + +Package: hive-webhcat +Architecture: all +Depends: hive-hcatalog (= ${source:Version}) +Description: WebHcat provides a REST-like web API for HCatalog and related Hadoop components. + WebHcat provides a REST-like web API for HCatalog and related Hadoop components. + +Package: hive-webhcat-server +Architecture: all +Depends: hive-webhcat (= ${source:Version}) +Description: Server for WebHcat. + Init scripts for WebHcat server http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/hive-hbase.install ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/hive-hbase.install b/bigtop-packages/src/deb/hive/hive-hbase.install new file mode 100644 index 0000000..c45df07 --- /dev/null +++ b/bigtop-packages/src/deb/hive/hive-hbase.install @@ -0,0 +1 @@ +/usr/lib/hive/lib/hbase.jar http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/hive-hcatalog.dirs ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/hive-hcatalog.dirs b/bigtop-packages/src/deb/hive/hive-hcatalog.dirs new file mode 100644 index 0000000..af6b648 --- /dev/null +++ b/bigtop-packages/src/deb/hive/hive-hcatalog.dirs @@ -0,0 +1,2 @@ +/var/lib/hive-hcatalog +/var/log/hive-hcatalog http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/hive-hcatalog.install ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/hive-hcatalog.install b/bigtop-packages/src/deb/hive/hive-hcatalog.install new file mode 100644 index 0000000..e783347 --- /dev/null +++ b/bigtop-packages/src/deb/hive/hive-hcatalog.install @@ -0,0 +1,9 @@ +/etc/hive-hcatalog +/usr/bin/hcat +/usr/share/man/man1/hive-hcatalog.1.gz +/usr/lib/hive-hcatalog/bin +/usr/lib/hive-hcatalog/etc/hcatalog +/usr/lib/hive-hcatalog/libexec +/usr/lib/hive-hcatalog/sbin/hcat* +/usr/lib/hive-hcatalog/sbin/update-hcatalog-env.sh +/usr/lib/hive-hcatalog/share/hcatalog http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/hive-hcatalog.postinst ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/hive-hcatalog.postinst b/bigtop-packages/src/deb/hive/hive-hcatalog.postinst new file mode 100644 index 0000000..45821e4 --- /dev/null +++ b/bigtop-packages/src/deb/hive/hive-hcatalog.postinst @@ -0,0 +1,35 @@ +#!/bin/sh +# 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. + +set -e + +case "$1" in + configure) + chown hive:hive -R /var/lib/hive-hcatalog /var/log/hive-hcatalog + # Install config alternatives + update-alternatives --install /etc/hive-hcatalog/conf hive-hcatalog-conf /etc/hive-hcatalog/conf.dist 30 + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/hive-hcatalog.prerm ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/hive-hcatalog.prerm b/bigtop-packages/src/deb/hive/hive-hcatalog.prerm new file mode 100644 index 0000000..c20f67d --- /dev/null +++ b/bigtop-packages/src/deb/hive/hive-hcatalog.prerm @@ -0,0 +1,57 @@ +#!/bin/bash +# +# 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. + +# prerm script for hcatalog +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <prerm> `remove' +# * <old-prerm> `upgrade' <new-version> +# * <new-prerm> `failed-upgrade' <old-version> +# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> +# * <deconfigured's-prerm> `deconfigure' `in-favour' +# <package-being-installed> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + update-alternatives --remove hive-hcatalog-conf /etc/hive-hcatalog/conf.dist || : + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/hive-jdbc.install ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/hive-jdbc.install b/bigtop-packages/src/deb/hive/hive-jdbc.install new file mode 100644 index 0000000..f2c7204 --- /dev/null +++ b/bigtop-packages/src/deb/hive/hive-jdbc.install @@ -0,0 +1,10 @@ +/usr/lib/hive/lib/commons-logging-*.jar +/usr/lib/hive/lib/hive-exec*.jar +/usr/lib/hive/lib/hive-jdbc*.jar +/usr/lib/hive/lib/hive-metastore*.jar +/usr/lib/hive/lib/hive-serde*.jar +/usr/lib/hive/lib/hive-service*.jar +/usr/lib/hive/lib/libfb303-*.jar +/usr/lib/hive/lib/libthrift-*.jar +/usr/lib/hive/lib/log4j-*.jar +/usr/lib/hive/lib/slf4j-*.jar http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/hive-webhcat.install ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/hive-webhcat.install b/bigtop-packages/src/deb/hive/hive-webhcat.install new file mode 100644 index 0000000..1689c9d --- /dev/null +++ b/bigtop-packages/src/deb/hive/hive-webhcat.install @@ -0,0 +1,4 @@ +/etc/hive-webhcat +/usr/lib/hive-hcatalog/etc/webhcat +/usr/lib/hive-hcatalog/share/webhcat +/usr/lib/hive-hcatalog/sbin/webhcat* http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/hive-webhcat.postinst ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/hive-webhcat.postinst b/bigtop-packages/src/deb/hive/hive-webhcat.postinst new file mode 100644 index 0000000..451ed41 --- /dev/null +++ b/bigtop-packages/src/deb/hive/hive-webhcat.postinst @@ -0,0 +1,34 @@ +#!/bin/bash +# 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. + +set -e + +case "$1" in + configure) + # Install config alternatives + update-alternatives --install /etc/hive-webhcat/conf hive-webhcat-conf /etc/hive-webhcat/conf.dist 30 + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/hive-webhcat.prerm ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/hive-webhcat.prerm b/bigtop-packages/src/deb/hive/hive-webhcat.prerm new file mode 100644 index 0000000..1308870 --- /dev/null +++ b/bigtop-packages/src/deb/hive/hive-webhcat.prerm @@ -0,0 +1,57 @@ +#!/bin/bash +# +# 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. + +# prerm script for webhcat +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <prerm> `remove' +# * <old-prerm> `upgrade' <new-version> +# * <new-prerm> `failed-upgrade' <old-version> +# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> +# * <deconfigured's-prerm> `deconfigure' `in-favour' +# <package-being-installed> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + update-alternatives --remove hive-webhcat-conf /etc/hive-webhcat/conf.dist || : + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/hive.dirs ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/hive.dirs b/bigtop-packages/src/deb/hive/hive.dirs index 6239b2f..666709b 100644 --- a/bigtop-packages/src/deb/hive/hive.dirs +++ b/bigtop-packages/src/deb/hive/hive.dirs @@ -1,2 +1,3 @@ /var/log/hive /var/run/hive +/var/lib/hive/metastore http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/hive.install ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/hive.install b/bigtop-packages/src/deb/hive/hive.install new file mode 100644 index 0000000..edc2a0d --- /dev/null +++ b/bigtop-packages/src/deb/hive/hive.install @@ -0,0 +1,55 @@ +/etc/hive +/usr/bin/hive +/usr/bin/beeline +/usr/bin/hiveserver2 +/usr/lib/hive/bin +/usr/lib/hive/conf +/usr/lib/hive/scripts +/usr/share/man/man1/hive.1.gz +/usr/share/doc/hive +/usr/lib/hive/lib/antlr-runtime-*.jar +/usr/lib/hive/lib/avro-*.jar +/usr/lib/hive/lib/avro-mapred-*.jar +/usr/lib/hive/lib/commons-cli-*.jar +/usr/lib/hive/lib/commons-codec-*.jar +/usr/lib/hive/lib/commons-collections-*.jar +/usr/lib/hive/lib/commons-compress-*.jar +/usr/lib/hive/lib/commons-configuration-*.jar +/usr/lib/hive/lib/commons-dbcp-*.jar +/usr/lib/hive/lib/commons-io-*.jar +/usr/lib/hive/lib/commons-lang-*.jar +/usr/lib/hive/lib/commons-pool-*.jar +/usr/lib/hive/lib/datanucleus-connectionpool-*.jar +/usr/lib/hive/lib/datanucleus-core-*.jar +/usr/lib/hive/lib/datanucleus-enhancer-*.jar +/usr/lib/hive/lib/datanucleus-rdbms-*.jar +/usr/lib/hive/lib/derby-*.jar +/usr/lib/hive/lib/guava-*.jar +/usr/lib/hive/lib/hive-beeline*.jar +/usr/lib/hive/lib/hive-cli*.jar +/usr/lib/hive/lib/hive-common*.jar +/usr/lib/hive/lib/hive-contrib*.jar +/usr/lib/hive/lib/hive-hbase-handler*.jar +/usr/lib/hive/lib/hive-hwi*.jar +/usr/lib/hive/lib/hive-shims*.jar +/usr/lib/hive/lib/jackson-core-asl-*.jar +/usr/lib/hive/lib/jackson-jaxrs-*.jar +/usr/lib/hive/lib/jackson-mapper-asl-*.jar +/usr/lib/hive/lib/jackson-xc-*.jar +/usr/lib/hive/lib/JavaEWAH-*.jar +/usr/lib/hive/lib/javolution-*.jar +/usr/lib/hive/lib/jdo2-api-*.jar +/usr/lib/hive/lib/jetty-*.jar +/usr/lib/hive/lib/jetty-util-*.jar +/usr/lib/hive/lib/jline-*.jar +/usr/lib/hive/lib/json-*.jar +/usr/lib/hive/lib/maven-ant-tasks-*.jar +/usr/lib/hive/lib/metrics-core-*.jar +/usr/lib/hive/lib/php +/usr/lib/hive/lib/protobuf-java-*.jar +/usr/lib/hive/lib/py +/usr/lib/hive/lib/servlet-api-*.jar +/usr/lib/hive/lib/snappy-*.jar +/usr/lib/hive/lib/ST4-*.jar +/usr/lib/hive/lib/tempus-fugit-*.jar +/usr/lib/hive/lib/xz-*.jar http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/deb/hive/rules ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hive/rules b/bigtop-packages/src/deb/hive/rules index 07975a3..34e46c3 100755 --- a/bigtop-packages/src/deb/hive/rules +++ b/bigtop-packages/src/deb/hive/rules @@ -33,25 +33,21 @@ override_dh_auto_build: bash debian/do-component-build -Divy.home=${HOME}/.ivy2 touch $@ -server metastore: +server server2 metastore hcatalog-server webhcat-server: bash debian/init.d.tmpl debian/[email protected] deb debian/${hive_pkg_name}[email protected] -override_dh_auto_install: metastore server +override_dh_auto_install: metastore server server2 hcatalog-server webhcat-server cp debian/hive-site.xml . cp debian/hive.1 . - sh debian/install_hive.sh \ - --prefix=debian/${hive_pkg_name} \ + cp debian/hive-hcatalog.1 . + bash debian/install_hive.sh \ + --prefix=debian/tmp \ --build-dir=src/build/dist \ - --doc-dir=/usr/share/doc/${hive_pkg_name} - # We need to get rid of jars that happen to be shipped in other packages - rm -f debian/${hive_pkg_name}/usr/lib/hive/lib/hbase-*.jar debian/${hive_pkg_name}/usr/lib/hive/lib/zookeeper-*.jar - mkdir -p debian/${hive_pkg_name}-hbase/usr/lib/hive/lib - mkdir -p debian/${hive_pkg_name}-jdbc/usr/lib/hive/lib - for lib in hive-jdbc hive-metastore hive-serde hive-exec libthrift hive-service libfb303 slf4j log4j commons-logging; do \ - mv debian/${hive_pkg_name}/usr/lib/hive/lib/$${lib}-*.jar debian/${hive_pkg_name}-jdbc/usr/lib/hive/lib/; \ - done - ln -s /usr/lib/hbase/hbase.jar debian/${hive_pkg_name}-hbase/usr/lib/hive/lib - ln -s /usr/lib/zookeeper/zookeeper.jar debian/${hive_pkg_name}/usr/lib/hive/lib + --doc-dir=debian/tmp/usr/share/doc/${hive_pkg_name} + # We need to get rid of jars that happen to be shipped in other CDH packages + rm -f debian/tmp/usr/lib/hive/lib/hbase-*.jar debian/tmp/usr/lib/hive/lib/zookeeper-*.jar + ln -s /usr/lib/hbase/hbase.jar debian/tmp/usr/lib/hive/lib + ln -s /usr/lib/zookeeper/zookeeper.jar debian/tmp/usr/lib/hive/lib # Workaround for BIGTOP-583 - rm -f debian/${hive_pkg_name}/usr/lib/hive/lib/slf4j-log4j12-*.jar + rm -f debian/tmp/usr/lib/hive/lib/slf4j-log4j12-*.jar http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop-packages/src/rpm/hive/SPECS/hive.spec ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/rpm/hive/SPECS/hive.spec b/bigtop-packages/src/rpm/hive/SPECS/hive.spec index d3a964b..19e9dfc 100644 --- a/bigtop-packages/src/rpm/hive/SPECS/hive.spec +++ b/bigtop-packages/src/rpm/hive/SPECS/hive.spec @@ -15,12 +15,17 @@ %define hadoop_username hadoop %define etc_hive /etc/%{name} %define config_hive %{etc_hive}/conf +%define conf_hcatalog %{_sysconfdir}/hive-hcatalog/conf +%define conf_webhcat %{_sysconfdir}/hive-webhcat/conf %define usr_lib_hive /usr/lib/%{name} +%define usr_lib_hcatalog /usr/lib/hive-hcatalog %define var_lib_hive /var/lib/%{name} -%define bin_hive /usr/bin +%define var_lib_hcatalog /var/lib/%{name}-hcatalog +%define var_log_hcatalog /var/log/%{name}-hcatalog +%define usr_bin /usr/bin %define hive_config_virtual hive_active_configuration %define man_dir %{_mandir} -%define hive_services server metastore +%define hive_services hive-server hive-metastore hive-server2 hive-hcatalog-server hive-webhcat-server # After we run "ant package" we'll find the distribution here %define hive_dist src/build/dist @@ -71,7 +76,15 @@ Source7: hive.1 Source8: hive-site.xml Source9: hive-server.svc Source10: hive-metastore.svc -Requires: hadoop-client, bigtop-utils >= 0.7, hbase, zookeeper, hive-jdbc = %{version}-%{release} +Source11: hive-server2.default +Source12: hive-server2.svc +Source13: hive-hcatalog.1 +Source14: hive-hcatalog-server.svc +Source15: hive-webhcat-server.svc +Source16: hive-hcatalog-server.default +Source17: hive-webhcat-server.default +Requires: hadoop-client, bigtop-utils >= 0.7, zookeeper, hive-jdbc = %{version}-%{release} +Conflicts: hadoop-hive Obsoletes: %{name}-webinterface %description @@ -91,10 +104,26 @@ Requires: insserv Requires: redhat-lsb %endif +%package server2 +Summary: Provides a Hive Thrift service with improved concurrency support. +Group: System/Daemons +Requires: %{name} = %{version}-%{release} +Requires(pre): %{name} = %{version}-%{release} + +%if %{?suse_version:1}0 +# Required for init scripts +Requires: insserv +%else +# Required for init scripts +Requires: redhat-lsb +%endif + %description server This optional package hosts a Thrift server for Hive clients across a network to use. +%description server2 +This optional package hosts a Thrift server for Hive clients across a network to use with improved concurrency support. %package metastore Summary: Shared metadata repository for Hive. Group: System/Daemons @@ -131,6 +160,79 @@ Requires: hadoop-client %description jdbc This package provides libraries necessary to connect to Apache Hive via JDBC +%package hcatalog +Summary: Apache Hcatalog is a data warehouse infrastructure built on top of Hadoop +Group: Development/Libraries +Requires: hadoop, hive, bigtop-utils >= 0.6 + +%description hcatalog +Apache HCatalog is a table and storage management service for data created using Apache Hadoop. +This includes: + * Providing a shared schema and data type mechanism. + * Providing a table abstraction so that users need not be concerned with where or how their data is stored. + * Providing interoperability across data processing tools such as Pig, Map Reduce, Streaming, and Hive. + + +%package webhcat +Summary: WebHcat provides a REST-like web API for HCatalog and related Hadoop components. +Group: Development/Libraries +Requires: %{name}-hcatalog = %{version}-%{release} + +%description webhcat +WebHcat provides a REST-like web API for HCatalog and related Hadoop components. + + +%package hcatalog-server +Summary: Init scripts for HCatalog server +Group: System/Daemons +Requires: %{name}-hcatalog = %{version}-%{release} + +%if %{?suse_version:1}0 +# Required for init scripts +Requires: insserv +%endif + +%if 0%{?mgaversion} +# Required for init scripts +Requires: initscripts +%endif + +# CentOS 5 does not have any dist macro +# So I will suppose anything that is not Mageia or a SUSE will be a RHEL/CentOS/Fedora +%if %{!?suse_version:1}0 && %{!?mgaversion:1}0 +# Required for init scripts +Requires: redhat-lsb +%endif + +%description hcatalog-server +Init scripts for HCatalog server + + +%package webhcat-server +Summary: Init scripts for WebHcat server +Group: System/Daemons +Requires: %{name}-webhcat = %{version}-%{release} + +%if %{?suse_version:1}0 +# Required for init scripts +Requires: insserv +%endif + +%if 0%{?mgaversion} +# Required for init scripts +Requires: initscripts +%endif + +# CentOS 5 does not have any dist macro +# So I will suppose anything that is not Mageia or a SUSE will be a RHEL/CentOS/Fedora +%if %{!?suse_version:1}0 && %{!?mgaversion:1}0 +# Required for init scripts +Requires: redhat-lsb +%endif + +%description webhcat-server +Init scripts for WebHcat server. + %prep %setup -n %{name}-%{hive_base_version} @@ -144,31 +246,36 @@ bash %{SOURCE1} %__rm -rf $RPM_BUILD_ROOT cp $RPM_SOURCE_DIR/hive.1 . +cp $RPM_SOURCE_DIR/hive-hcatalog.1 . cp $RPM_SOURCE_DIR/hive-site.xml . /bin/bash %{SOURCE2} \ --prefix=$RPM_BUILD_ROOT \ --build-dir=%{hive_dist} \ - --doc-dir=%{doc_hive} + --doc-dir=$RPM_BUILD_ROOT/%{doc_hive} +%__install -d -m 0755 $RPM_BUILD_ROOT/%{initd_dir}/ %__install -d -m 0755 $RPM_BUILD_ROOT/etc/default/ -%__install -m 0644 %{SOURCE6} $RPM_BUILD_ROOT/etc/default/%{name}-metastore -%__install -m 0644 %{SOURCE5} $RPM_BUILD_ROOT/etc/default/%{name}-server +%__install -m 0644 $RPM_SOURCE_DIR/hive-metastore.default $RPM_BUILD_ROOT/etc/default/%{name}-metastore +%__install -m 0644 $RPM_SOURCE_DIR/hive-server.default $RPM_BUILD_ROOT/etc/default/%{name}-server +%__install -m 0644 $RPM_SOURCE_DIR/hive-server2.default $RPM_BUILD_ROOT/etc/default/%{name}-server2 +%__install -m 0644 $RPM_SOURCE_DIR/hive-hcatalog-server.default $RPM_BUILD_ROOT/etc/default/%{name}-hcatalog-server +%__install -m 0644 $RPM_SOURCE_DIR/hive-webhcat-server.default $RPM_BUILD_ROOT/etc/default/%{name}-webhcat-server %__install -d -m 0755 $RPM_BUILD_ROOT/%{_localstatedir}/log/%{name} %__install -d -m 0755 $RPM_BUILD_ROOT/%{_localstatedir}/run/%{name} -# Workaround for BIGTOP-583 -%__rm -f $RPM_BUILD_ROOT/%{usr_lib_hive}/lib/slf4j-log4j12-*.jar - # We need to get rid of jars that happen to be shipped in other Bigtop packages %__rm -f $RPM_BUILD_ROOT/%{usr_lib_hive}/lib/hbase-*.jar $RPM_BUILD_ROOT/%{usr_lib_hive}/lib/zookeeper-*.jar %__ln_s /usr/lib/hbase/hbase.jar /usr/lib/zookeeper/zookeeper.jar $RPM_BUILD_ROOT/%{usr_lib_hive}/lib/ +# Workaround for BIGTOP-583 +%__rm -f $RPM_BUILD_ROOT/%{usr_lib_hive}/lib/slf4j-log4j12-*.jar + for service in %{hive_services} do # Install init script - init_file=$RPM_BUILD_ROOT/%{initd_dir}/%{name}-${service} - bash $RPM_SOURCE_DIR/init.d.tmpl $RPM_SOURCE_DIR/hive-${service}.svc rpm $init_file + init_file=$RPM_BUILD_ROOT/%{initd_dir}/${service} + bash $RPM_SOURCE_DIR/init.d.tmpl $RPM_SOURCE_DIR/${service}.svc rpm $init_file done %pre @@ -196,6 +303,23 @@ if [ "$1" = 0 ]; then %{alternatives_cmd} --remove %{name}-conf %{etc_hive}/conf.dist || : fi + +%post hcatalog +%{alternatives_cmd} --install %{conf_hcatalog} hive-hcatalog-conf %{conf_hcatalog}.dist 30 + +%preun hcatalog +if [ "$1" = 0 ]; then + %{alternatives_cmd} --remove hive-hcatalog-conf %{conf_hcatalog}.dist || : +fi + +%post webhcat +%{alternatives_cmd} --install %{conf_webhcat} hive-webhcat-conf %{conf_webhcat}.dist 30 + +%preun webhcat +if [ "$1" = 0 ]; then + %{alternatives_cmd} --remove hive-webhcat-conf %{conf_webhcat}.dist || : +fi + ####################### #### FILES SECTION #### ####################### @@ -204,7 +328,9 @@ fi %defattr(-,root,root,755) %config(noreplace) %{etc_hive}/conf.dist %{usr_lib_hive} -%{bin_hive}/hive +%{usr_bin}/hive +%{usr_bin}/beeline +%{usr_bin}/hiveserver2 %attr(0755,hive,hive) %dir %{var_lib_hive} %attr(0755,hive,hive) %dir %{_localstatedir}/log/%{name} %attr(0755,hive,hive) %dir %{_localstatedir}/run/%{name} @@ -243,6 +369,29 @@ fi %{usr_lib_hive}/lib/log4j-*.jar %{usr_lib_hive}/lib/commons-logging-*.jar +%files hcatalog +%defattr(-,root,root,755) +%config(noreplace) %attr(755,root,root) %{conf_hcatalog}.dist +%attr(0775,hive,hive) %{var_lib_hcatalog} +%attr(0775,hive,hive) %{var_log_hcatalog} +%{usr_lib_hcatalog} +%{usr_lib_hcatalog}/bin +%{usr_lib_hcatalog}/etc/hcatalog +%{usr_lib_hcatalog}/libexec +%{usr_lib_hcatalog}/share/hcatalog +%{usr_lib_hcatalog}/sbin/hcat_server.sh +%{usr_lib_hcatalog}/sbin/update-hcatalog-env.sh +%{usr_bin}/hcat +%{man_dir}/man1/hive-hcatalog.1.* + +%files webhcat +%defattr(-,root,root,755) +%config(noreplace) %attr(755,root,root) %{conf_webhcat}.dist +%{usr_lib_hcatalog}/share/webhcat +%{usr_lib_hcatalog}/etc/webhcat +%{usr_lib_hcatalog}/sbin/webhcat_config.sh +%{usr_lib_hcatalog}/sbin/webhcat_server.sh + %define service_macro() \ %files %1 \ %attr(0755,root,root)/%{initd_dir}/%{name}-%1 \ @@ -260,4 +409,7 @@ if [ $1 -ge 1 ]; then \ service %{name}-%1 condrestart >/dev/null 2>&1 || : \ fi %service_macro server +%service_macro server2 %service_macro metastore +%service_macro hcatalog-server +%service_macro webhcat-server http://git-wip-us.apache.org/repos/asf/bigtop/blob/d00a6bf5/bigtop.mk ---------------------------------------------------------------------- diff --git a/bigtop.mk b/bigtop.mk index 502573d..cbd0288 100644 --- a/bigtop.mk +++ b/bigtop.mk @@ -74,7 +74,7 @@ $(eval $(call PACKAGE,pig,PIG)) HIVE_NAME=hive HIVE_RELNOTES_NAME=Apache Hive HIVE_PKG_NAME=hive -HIVE_BASE_VERSION=0.10.0 +HIVE_BASE_VERSION=0.11.0 HIVE_PKG_VERSION=$(HIVE_BASE_VERSION) HIVE_RELEASE_VERSION=1 HIVE_TARBALL_DST=hive-$(HIVE_BASE_VERSION).tar.gz @@ -84,21 +84,6 @@ HIVE_SITE=$(APACHE_MIRROR)$(HIVE_DOWNLOAD_PATH) HIVE_ARCHIVE=$(APACHE_ARCHIVE)$(HIVE_DOWNLOAD_PATH) $(eval $(call PACKAGE,hive,HIVE)) -# HCatalog -HCATALOG_NAME=hcatalog -HCATALOG_RELNOTES_NAME=Apache HCatalog (incubating) -HCATALOG_PKG_NAME=hcatalog -HCATALOG_BASE_VERSION=0.5.0-incubating -HCATALOG_PKG_VERSION=0.5.0 -HCATALOG_RELEASE_VERSION=1 -HCATALOG_TARBALL_DST=$(HCATALOG_NAME)-$(HCATALOG_BASE_VERSION).tar.gz -HCATALOG_TARBALL_SRC=$(HCATALOG_NAME)-src-$(HCATALOG_BASE_VERSION).tar.gz -HCATALOG_DOWNLOAD_PATH=/incubator/hcatalog/hcatalog-$(HCATALOG_BASE_VERSION)/ -HCATALOG_SITE=$(APACHE_MIRROR)$(HCATALOG_DOWNLOAD_PATH) -HCATALOG_ARCHIVE=$(APACHE_ARCHIVE)$(HCATALOG_DOWNLOAD_PATH) -HCATALOG_SITE=$(APACHE_ARCHIVE) -$(eval $(call PACKAGE,hcatalog,HCATALOG)) - # Sqoop SQOOP_NAME=sqoop SQOOP_RELNOTES_NAME=Sqoop
