diff --git a/Makefile.am b/Makefile.am index 066859f..736946d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,161 +1,161 @@ # Copyright (c) 2009 Red Hat, Inc. # # Authors: Andrew Beekhof # Steven Dake (sdake@redhat.com) # # This software licensed under BSD license, the text of which follows: # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # - Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # - Neither the name of the MontaVista Software, Inc. nor the names of its # contributors may be used to endorse or promote products derived from this # software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF # THE POSSIBILITY OF SUCH DAMAGE. SPEC = $(PACKAGE_NAME).spec TARFILE = $(PACKAGE_NAME)-$(VERSION).tar.gz EXTRA_DIST = autogen.sh conf/booth.conf.example \ $(bootharbitrator_SCRIPTS) $(boothsite_SCRIPTS) \ $(boothnoarch_SCRIPTS) AUTOMAKE_OPTIONS = foreign MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure depcomp \ config.guess config.sub missing install-sh \ autoheader automake autoconf test_lense.sh -dist_doc_DATA = README COPYING +dist_doc_DATA = README COPYING README.upgrade-from-v0.1 notrans_dist_man8_MANS = docs/boothd.8 boothconfdir = ${BOOTHSYSCONFDIR} boothconf_DATA = conf/booth.conf.example boothsitedir = /usr/lib/ocf/resource.d/pacemaker boothsite_SCRIPTS = script/ocf/booth-site bootharbitratordir = ${INITDDIR} bootharbitrator_SCRIPTS = script/lsb/booth-arbitrator boothnoarchdir = $(datadir)/$(PACKAGE_NAME) boothnoarch_SCRIPTS = script/service-runnable TESTS = test/runtests.py SUBDIRS = src docs coverity: cov-build --dir=cov make cov-analyze --dir cov --concurrency --wait-for-license cov-format-errors --dir cov install-exec-local: $(INSTALL) -d $(DESTDIR)/${boothconfdir} $(INSTALL) -d $(DESTDIR)/${bootharbitratordir} $(INSTALL) -d $(DESTDIR)/${boothsitedir} $(INSTALL) -d $(DESTDIR)/${SOCKETDIR} install-exec-hook: ln -sf ${sbindir}/boothd $(DESTDIR)/${sbindir}/booth uninstall-local: rmdir $(DESTDIR)/${boothconfdir} || :; rmdir $(DESTDIR)/${bootharbitratordir} || :; rmdir $(DESTDIR)/${boothsitedir} || :; rmdir $(DESTDIR)/${SOCKETDIR} || :; test: check lint: for dir in src; do make -C $$dir lint; done dist-clean-local: rm -f autoconf automake autoheader dist-hook: echo $(VERSION) > $(distdir)/.tarball-version ## make rpm/srpm section. $(SPEC): $(SPEC).in rm -f $@-t $@ date="$(shell LC_ALL=C date "+%a %b %d %Y")" && \ if [ -f .tarball-version ]; then \ gitver="$(shell cat .tarball-version)" && \ rpmver=$$gitver && \ alphatag="" && \ dirty="" && \ numcomm="0"; \ else \ gitver="$(shell git describe --tags --abbrev=4 --match='v*' HEAD 2>/dev/null)" && \ rpmver=`echo $$gitver | sed -e "s/^v//" -e "s/-.*//g"` && \ alphatag=`echo $$gitver | sed -e "s/.*-//" -e "s/^g//"` && \ vtag=`echo $$gitver | sed -e "s/-.*//g"` && \ numcomm=`git rev-list $$vtag..HEAD | wc -l` && \ git update-index --refresh > /dev/null 2>&1 || true && \ dirty=`git diff-index --name-only HEAD 2>/dev/null`; \ fi && \ if [ -n "$$dirty" ]; then dirty="dirty"; else dirty=""; fi && \ if [ "$$numcomm" = "0" ]; then \ sed \ -e "s#@version@#$$rpmver#g" \ -e "s#%glo.*alpha.*##g" \ -e "s#%glo.*numcomm.*##g" \ -e "s#@dirty@#$$dirty#g" \ -e "s#@date@#$$date#g" \ $< > $@-t; \ else \ sed \ -e "s#@version@#$$rpmver#g" \ -e "s#@alphatag@#$$alphatag#g" \ -e "s#@numcomm@#$$numcomm#g" \ -e "s#@dirty@#$$dirty#g" \ -e "s#@date@#$$date#g" \ $< > $@-t; \ fi; \ if [ -z "$$dirty" ]; then sed -i -e "s#%glo.*dirty.*##g" $@-t; fi chmod a-w $@-t mv $@-t $@ $(TARFILE): $(MAKE) dist RPMBUILDOPTS = --define "_sourcedir $(abs_builddir)" \ --define "_specdir $(abs_builddir)" \ --define "_builddir $(abs_builddir)" \ --define "_srcrpmdir $(abs_builddir)" \ --define "_rpmdir $(abs_builddir)" srpm: clean autoreconf -if $(MAKE) $(SPEC) $(TARFILE) rpmbuild $(WITH_LIST) $(RPMBUILDOPTS) --nodeps -bs $(SPEC) rpm: clean autoreconf -if $(MAKE) $(SPEC) $(TARFILE) rpmbuild $(WITH_LIST) $(RPMBUILDOPTS) -ba $(SPEC) diff --git a/README.upgrade-from-v0.1 b/README.upgrade-from-v0.1 new file mode 100644 index 0000000..e5ccbfe --- /dev/null +++ b/README.upgrade-from-v0.1 @@ -0,0 +1,57 @@ +Notes on upgrade from PAXOS booth v0.1 +====================== + +Booth v0.1 was a booth version based on the PAXOS algorithm. The +current booth v0.2 is loosely based on raft and incompatible +with the one running v0.1. Therefore, rolling upgrades are not +possible. + +Due to the new multi-tenancy feature, the new arbitrator init +script cannot stop or test status of the paxos v0.1 arbitrator. +On upgrade to v0.2, the arbitrator, if running, will be stopped. + +The OCF resource-agent ocf:pacemaker:booth-site is capable of +stopping and monitoring the booth v0.1 site daemon. + +Update procedure +---------------- + +The recommended procedure for update from the paxos booth to the +new booth version is as follows: + +- convert the configuration file /etc/booth/booth.conf on all + nodes and arbitrators to the new syntax + +- update booth on all arbitrators and start them + +- update booth on all nodes and restart the resource: + + # crm resource restart booth + +Configuration file syntax changes +---------------- + +.Note +If you didn't specify expiry time or weights different from the +defaults, then you can skip this section and use the old +'booth.conf'. + +The new booth configuration has many more options for tickets +and the syntax for 'ticket' got changed. Whereas previously the +optional expiry time and weights could be specified by appending +them to the ticket name with a ';' as a separator, the new syntax +has separate tokens for all ticket options. + +For instance, this ticket specification: + + ticket="tkt-A;600;1,2,2" + +looks in the new syntax like this: + + ticket="tkt-A" + expire="600" + weights="1,2,2" + +See the 'booth(8)' man page for more details. + +# vim: set ft=asciidoc : diff --git a/booth.spec b/booth.spec index b61b2ea..5326f47 100644 --- a/booth.spec +++ b/booth.spec @@ -1,163 +1,164 @@ %if 0%{?suse_version} %global booth_docdir %{_defaultdocdir}/%{name} %else # newer fedora distros have _pkgdocdir, rely on that when # available %{!?_pkgdocdir: %global _pkgdocdir %%{_docdir}/%{name}-%{version}} # Directory where we install documentation %global booth_docdir %{_pkgdocdir} %endif %global test_path %{_datadir}/booth/tests %if 0%{?suse_version} %define _libexecdir %{_libdir} %endif %define with_extra_warnings 0 %define with_debugging 0 %define without_fatal_warnings 1 %if 0%{?fedora} || 0%{?centos} || 0%{?rhel} %define pkg_group System Environment/Daemons %else %define pkg_group Productivity/Clustering/HA %endif Name: booth Summary: Ticket Manager for Multi-site Clusters License: GPL-2.0+ Group: %{pkg_group} Version: 0.2.0 Release: 0 Source: booth.tar.bz2 Source1: %name-rpmlintrc BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: asciidoc BuildRequires: autoconf BuildRequires: automake BuildRequires: glib2-devel %if 0%{?fedora} || 0%{?centos} || 0%{?rhel} BuildRequires: cluster-glue-libs-devel BuildRequires: pacemaker-libs-devel %else BuildRequires: libglue-devel BuildRequires: libpacemaker-devel %endif BuildRequires: libxml2-devel BuildRequires: pkgconfig %if 0%{?fedora} || 0%{?centos} || 0%{?rhel} Requires: pacemaker >= 1.1.8 Requires: cluster-glue-libs >= 1.0.6 %else Requires: pacemaker-ticket-support >= 2.0 %endif %description Booth manages the ticket which authorizes one of the cluster sites located in geographically dispersed distances to run certain resources. It is designed to be an add-on of Pacemaker, which extends Pacemaker to support geographically distributed clustering. %prep %setup -q -n %{name} %build ./autogen.sh %configure \ --with-initddir=%{_initrddir} \ --docdir=%{booth_docdir} make #except check #%check #make check %install make DESTDIR=$RPM_BUILD_ROOT install docdir=%{booth_docdir} mkdir -p %{buildroot}/%{_mandir}/man8/ gzip < docs/boothd.8 > %{buildroot}/%{_mandir}/man8/booth.8.gz ln %{buildroot}/%{_mandir}/man8/booth.8.gz %{buildroot}/%{_mandir}/man8/boothd.8.gz %if %{defined _unitdir} # systemd mkdir -p %{buildroot}/%{_unitdir} cp -a conf/booth@.service %{buildroot}/%{_unitdir}/booth@.service ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcbooth-arbitrator %else # sysV init ln -s ../../%{_initddir}/booth-arbitrator %{buildroot}%{_sbindir}/rcbooth-arbitrator %endif #install test-parts mkdir -p %{buildroot}/%{test_path} cp -a unit-tests/ script/unit-test.py test conf %{buildroot}/%{test_path}/ chmod +x %{buildroot}/%{test_path}/test/booth_path chmod +x %{buildroot}/%{test_path}/test/live_test.sh mkdir -p %{buildroot}/%{test_path}/src/ ln -s %{_sbindir}/boothd %{buildroot}/%{test_path}/src/ rm -f %{buildroot}/%{test_path}/test/*.pyc %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %{_sbindir}/booth %{_sbindir}/boothd %{_mandir}/man8/booth.8.gz %{_mandir}/man8/boothd.8.gz %dir /usr/lib/ocf %dir /usr/lib/ocf/resource.d %dir /usr/lib/ocf/resource.d/pacemaker %dir %{_sysconfdir}/booth %{_sbindir}/rcbooth-arbitrator /usr/lib/ocf/resource.d/pacemaker/booth-site %config %{_sysconfdir}/booth/booth.conf.example %if %{defined _unitdir} %{_unitdir}/booth@.service %exclude %{_initddir}/booth-arbitrator %else %{_initddir}/booth-arbitrator %endif %dir %{_datadir}/booth %{_datadir}/booth/service-runnable %doc README COPYING +%doc README.upgrade-from-v0.1 # this should be preun, but... %pre # stop the arbitrator if it's the previous paxos version 1.0 if [ "`booth version | awk '{print $2}'`" = "1.0" ]; then echo "booth v0.1 found" if grep -qs 'ticket.*;' /etc/booth/booth.conf; then echo "Convert the booth configuration in /etc/booth/booth.conf!" fi if ps -o pid,cmd -e | grep -qs "[b]oothd arbitrator"; then rcbooth-arbitrator stop fi fi exit 0 %package test Summary: Test scripts for Booth Group: %{pkg_group} Requires: booth Requires: python %description test This package contains automated tests for Booth, the Cluster Ticket Manager for Pacemaker. %files test %defattr(-,root,root) %doc README-testing %{test_path} %changelog