You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by co...@apache.org on 2016/02/28 07:08:12 UTC
[1/2] bigtop git commit: BIGTOP-2321. Add packaging code for HAWQ
Repository: bigtop
Updated Branches:
refs/heads/BIGTOP-2320 421027ffe -> 560c01805
BIGTOP-2321. Add packaging code for HAWQ
Adding hawq-segment service
Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/751c1137
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/751c1137
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/751c1137
Branch: refs/heads/BIGTOP-2320
Commit: 751c1137588dc9843ae7edfd9e51bb74cddadac5
Parents: 421027f
Author: Konstantin Boudnik <co...@apache.org>
Authored: Sat Feb 27 12:12:45 2016 -0800
Committer: Konstantin Boudnik <co...@apache.org>
Committed: Sat Feb 27 12:12:45 2016 -0800
----------------------------------------------------------------------
bigtop-packages/src/common/hawq/hawq-master.svc | 64 ++++++++++++++++++++
bigtop-packages/src/common/hawq/hawq.svc | 64 --------------------
bigtop-packages/src/deb/hawq/rules | 3 +-
bigtop-packages/src/rpm/hawq/SPECS/hawq.spec | 11 ++--
4 files changed, 73 insertions(+), 69 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/bigtop/blob/751c1137/bigtop-packages/src/common/hawq/hawq-master.svc
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hawq/hawq-master.svc b/bigtop-packages/src/common/hawq/hawq-master.svc
new file mode 100644
index 0000000..bd60980
--- /dev/null
+++ b/bigtop-packages/src/common/hawq/hawq-master.svc
@@ -0,0 +1,64 @@
+# 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="hawq master"
+DESC="hawq master daemon"
+EXEC_PATH="\${HAWQ_HOME}/bin/hawq"
+SVC_USER="hawq"
+PIDFILE="\${HAWQ_PID_DIR}/${DAEMON}.pid"
+SVC_OPTS="-l \${HAWQ_LOG_DIR}"
+
+generate_start() {
+
+cat <<'__EOT__'
+start() {
+ [ -x $EXEC_PATH ] || 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
+
+ su -s /bin/bash ${SVC_USER} -c "${EXEC_PATH} start master $SVC_OPTS"
+
+ checkstatusofproc
+ RETVAL=$?
+ [ $RETVAL -eq $STATUS_RUNNING ] && touch $LOCKFILE
+ return $RETVAL
+}
+__EOT__
+
+}
+
+generate_stop() {
+
+cat <<'__EOT__'
+stop() {
+ log_success_msg "Stopping $DESC (${DAEMON}): "
+
+ su -s /bin/bash ${SVC_USER} -c "${EXEC_PATH} stop master $SVC_OPTS"
+
+ sleep 3
+ RETVAL=$?
+
+ [ $RETVAL -eq $RETVAL_SUCCESS ] && rm -f $LOCKFILE $PIDFILE
+ return $RETVAL
+}
+__EOT__
+
+}
http://git-wip-us.apache.org/repos/asf/bigtop/blob/751c1137/bigtop-packages/src/common/hawq/hawq.svc
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hawq/hawq.svc b/bigtop-packages/src/common/hawq/hawq.svc
deleted file mode 100644
index 735c82e..0000000
--- a/bigtop-packages/src/common/hawq/hawq.svc
+++ /dev/null
@@ -1,64 +0,0 @@
-# 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="hawq"
-DESC="hawq daemon"
-EXEC_PATH="\${HAWQ_HOME}/bin/hawq"
-SVC_USER="hawq"
-PIDFILE="\${HAWQ_PID_DIR}/${DAEMON}.pid"
-SVC_OPTS="-l \${HAWQ_LOG_DIR}"
-
-generate_start() {
-
-cat <<'__EOT__'
-start() {
- [ -x $EXEC_PATH ] || 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
-
- su -s /bin/bash ${SVC_USER} -c "${EXEC_PATH} start master $SVC_OPTS"
-
- checkstatusofproc
- RETVAL=$?
- [ $RETVAL -eq $STATUS_RUNNING ] && touch $LOCKFILE
- return $RETVAL
-}
-__EOT__
-
-}
-
-generate_stop() {
-
-cat <<'__EOT__'
-stop() {
- log_success_msg "Stopping $DESC (${DAEMON}): "
-
- su -s /bin/bash ${SVC_USER} -c "${EXEC_PATH} stop master $SVC_OPTS"
-
- sleep 3
- RETVAL=$?
-
- [ $RETVAL -eq $RETVAL_SUCCESS ] && rm -f $LOCKFILE $PIDFILE
- return $RETVAL
-}
-__EOT__
-
-}
http://git-wip-us.apache.org/repos/asf/bigtop/blob/751c1137/bigtop-packages/src/deb/hawq/rules
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hawq/rules b/bigtop-packages/src/deb/hawq/rules
index 7a7640b..1e256a1 100755
--- a/bigtop-packages/src/deb/hawq/rules
+++ b/bigtop-packages/src/deb/hawq/rules
@@ -43,7 +43,8 @@ override_dh_auto_install:
--prefix=debian/tmp
ln -s /var/log/${hawq_pkg_name} debian/tmp/usr/lib/${hawq_pkg_name}/logs
ln -s /var/run/${hawq_pkg_name} debian/tmp/usr/lib/${hawq_pkg_name}/pids
- bash debian/init.d.tmpl debian/hawq.svc deb debian/${hawq_pkg_name}-service.init
+ bash debian/init.d.tmpl debian/hawq-master.svc deb debian/${hawq_pkg_name}-master-service.init
+ bash debian/init.d.tmpl debian/hawq-segment.svc deb debian/${hawq_pkg_name}-segment-service.init
## Let's override the auto_configure and auto_clean to make sure existing
## top-level Makefile doesn't interfere with the package creation
http://git-wip-us.apache.org/repos/asf/bigtop/blob/751c1137/bigtop-packages/src/rpm/hawq/SPECS/hawq.spec
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/rpm/hawq/SPECS/hawq.spec b/bigtop-packages/src/rpm/hawq/SPECS/hawq.spec
index 81f82ef..a966328 100644
--- a/bigtop-packages/src/rpm/hawq/SPECS/hawq.spec
+++ b/bigtop-packages/src/rpm/hawq/SPECS/hawq.spec
@@ -82,9 +82,10 @@ License: APL2
Source0: %{vcs_tag}.tar.gz
Source1: do-component-build
Source2: install_hawq.sh
-Source3: hawq.svc
+Source3: hawq-master.svc
Source4: init.d.tmpl
Source5: hawq.default
+Source6: hawq-segment.svc
Requires: coreutils, /usr/sbin/useradd, /sbin/chkconfig, /sbin/service
Requires: hadoop-hdfs, bigtop-utils >= 1.0
@@ -131,9 +132,11 @@ ln -s %{_localstatedir}/log/%{name} %{buildroot}/%{logs_hawq}
%__install -d -m 0755 %{buildroot}/%{_localstatedir}/run/%{name}
ln -s %{_localstatedir}/run/%{name} %{buildroot}/%{pids_hawq}
-init_file=$RPM_BUILD_ROOT/%{initd_dir}/%{name}
-bash %{SOURCE4} ${RPM_SOURCE_DIR}/hawq.svc rpm $init_file
-chmod 755 $init_file
+master_init_file=$RPM_BUILD_ROOT/%{initd_dir}/%{name}-master
+segment_init_file=$RPM_BUILD_ROOT/%{initd_dir}/%{name}-segment
+bash %{SOURCE4} ${RPM_SOURCE_DIR}/%{SOURCE3} rpm $master_init_file
+bash %{SOURCE4} ${RPM_SOURCE_DIR}/%{SOURCE6} rpm $master_init_file
+chmod 755 $master_init_file $segment_init_file
%__install -d -m 0755 $RPM_BUILD_ROOT/usr/bin
[2/2] bigtop git commit: GTOP-2325. Deployment recipes for HAWQ
Posted by co...@apache.org.
GTOP-2325. Deployment recipes for HAWQ
Fixing permissions on hawq-site.xml
Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/560c0180
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/560c0180
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/560c0180
Branch: refs/heads/BIGTOP-2320
Commit: 560c01805b9a587d3de6de4712d6366225ed4cc1
Parents: 751c113
Author: Konstantin Boudnik <co...@apache.org>
Authored: Sat Feb 27 17:43:42 2016 -0800
Committer: Konstantin Boudnik <co...@apache.org>
Committed: Sat Feb 27 17:43:42 2016 -0800
----------------------------------------------------------------------
.../puppet/modules/hawq/manifests/init.pp | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/bigtop/blob/560c0180/bigtop-deploy/puppet/modules/hawq/manifests/init.pp
----------------------------------------------------------------------
diff --git a/bigtop-deploy/puppet/modules/hawq/manifests/init.pp b/bigtop-deploy/puppet/modules/hawq/manifests/init.pp
index 8ba6adb..b932632 100644
--- a/bigtop-deploy/puppet/modules/hawq/manifests/init.pp
+++ b/bigtop-deploy/puppet/modules/hawq/manifests/init.pp
@@ -49,6 +49,9 @@ class hawq {
file { "/etc/hawq/conf/hawq-site.xml":
content => template('hawq/hawq-site.xml'),
require => [File["/etc/hawq/conf"]],
+ owner => 'hawq',
+ group => 'hawq',
+ mode => '0755',
}
file { "/etc/hawq/conf/gpcheck.cnf":
content => template('hawq/gpcheck.cnf'),
@@ -95,18 +98,18 @@ class hawq {
}
### TODO init require hdfs to be running. Need to test this
- exec { "hawk init":
+ exec { "hawk init master":
path => ['/usr/bin'],
# Silly init will ask if I am really sure I want to init the cluster
- command => 'echo y | bash -x /usr/bin/hawq init cluster',
+ command => 'echo y | bash -x /usr/bin/hawq init master',
require => [ Package['hawq'], Exec ['install pygresql modules2'] ],
}
-### TODO The expectation is that init will start the service. I don't think so...
-# service { "hawq":
-# ensure => running,
-# require => [ Package["hawq"], File["/etc/default/hawq"], Exec["hawk init"] ],
-# subscribe => [ Package["hawq"], File["/etc/default/hawq", "/etc/hawq/conf/hawq-site.xml"] ]
-# }
+## TODO The expectation is that init will start the service. I don't think so...
+ service { "hawq":
+ ensure => running,
+ require => [ Package["hawq"], File["/etc/default/hawq"], Exec["hawk init"] ],
+ subscribe => [ Package["hawq"], File["/etc/default/hawq", "/etc/hawq/conf/hawq-site.xml"] ]
+ }
}
}