Friday, January 28, 2011

Installing Apache Qpid with persistency on Enterprice SUSE Linux

This document describes how to install Apache Qpid C++ broker 0.8 with persistence on Enterprise SUSE Linux.
    1. Checkout the 0.8 source code from here[1] and checkout the separate persistence module for 0.8 release from here[2]. And Download the Qpid C++ broker & client distribution from here[3].
    • Note: You need to checkout the complete source of Qpid because, to configure the persistency module you need some other parts of the Qpid distribution, only C++ source will not be enough.
    1. Assume QPID-DIR is the directory where you have checked out the sources.


Installing Qpid C++ broker
  1. Extract qpid-cpp-0.8.tar.gz and assume Qpid C++ code will be found in $QPID-DIR/qpidc-0.8 directory.

You will see following directories inside QPID-DIR, these directories will be used in below instructions,
QPID-DIR
- qpidc-0.8 - qpid source we are going to build
- qpid - complete qpid source code to be used during building of persistence module
- cpp - persistence module source code
  1. Before start building from the source, please install following required libraries using yast (Put the SUSE DVD in to your drive and install from yast). You need to have an internet connection to install some components, because some of these libraries cannot be found in the SUSE distribution DVD pack. For them please download RPMs with dependencies and install them.
      1. boost (1.35)(*)
      2. e2fsprogs (1.39)
      3. pkgconfig (0.21)
      1. openais (0.80.3)
      2. corosync (1.0.0.rc1)
      3. xqilla (2.0.0)
      4. xerces-c (2.7.0)
      5. nss
      6. nspr
      • Qpid has been built using the GNU C++ compiler:
      1. gcc (3.4.6)
      2. GNU make (3.8.0)
      3. autoconf (2.61)
      4. automake (1.9.6)
      5. help2man (1.36.4)
      6. libtool (1.5.22)
      7. doxygen (1.5.1)
      8. graphviz (2.12)
      9. ruby 1.8 (1.8.4)
      10. ruby-devel
      11. python-devel
      12. swig (1.3.35)

  1. After successfully installing the required packages run the following commands inside $QPID-DIR/qpidc-0.8
    • Note: Please make sure you are not on root during configuring and making the project, you need to be on root only when running make install command.
      • ./configure --without-sasl=no --prefix=$QPID-DIR/qpidc-0.8/build
      • make
      • su
      • make install

    • Note: during the configuring and build process if you get an error telling cannot find a particular library try to find out the required package to install with the use of the error and yum search command, install them and try to build again from the beginning.

  1. After successfullying running above commands you can see a directory "build" inside $QPID-DIR/qpidc-0.8. To start Qpid C++ broker run the script $QPID-DIR/qpidc-0.8/build/sbin/qpidd. (Make sure you switch back to the normal user mode from root login)

  1. If you need any configuration changes, edit the qpidc.conf file inside $QPID-DIR/qpidc-0.8/build/etc.


Installing Qpid persistency module
  1. Now shutdown the started server and install the following packages using yum.
    • libaio-devel
    • libdb-devel
    • With Enterprise SUSE Linux we encountered some issues with version in-compality during installation of libdb-devel so please follow the below steps.
  1. Run yast and search for the text “bdb” (berkley database) and you will see libdb-4.5 packages remove all the 4.5 libdb packages, during this process yast will show you the dependent components for these packages and ignore removing them during the un-installation process.

  1. Remove if there are libraries with the name libdb_cxx-4.3 in /usr/lib/ directory for that you can simply run a find command inside /usr/lib like below
  2. find -name ‘*db_cxx*’ , if there are files (.so files) remove them from /usr/lib/

  1. Now download libdb-4.6-devel and libdb-4.6 rpms and install them.

  1. After installing this required header files will get saved in to /usr/include/db/include/ directory copy two header files in /usr/include/db/include (db_cxx.h and db.h) to /usr/include directory.

  1. Now you are ready to do the configure, make and make install follow the steps below to proceed with building the message store module.
  1. After successfully installing above packages run the following commands to build the persistence module inside QPID-DIR/cpp/ to build the persistency module. (Assume with the first step you have checked out the message store module to QPID-DIR/cpp).

Note: In the very first step we have checked out the complete qpid source from [1] so we are going to use that location ($QPID-DIR/cpp) during the build of the persistence module.

./bootstrap

./configure --with-qpid-checkout=$QPID-DIR/qpid

make

su root

make install

  1. Add the path $QPID-DIR/cpp/lib/.lib/ to you LD_LIBRARY_PATH.



Running Qpid C++ broker with persistency
  1. Now you are ready to start Qpid C++ broker with persistency module. Run the following command to start Qpid C++ broker.


cd $QPID-DIR/qpidc-0.8/build/sbin

./qpidd --load-module msgstore.so

  1. To view the message store module configurations run the qpidd like this.
    • ./qpidd --load-module msgstore.so -h

  1. Finalize your configuration in the broker and start Qpid broker using step 4.1 and start the Listeners first, so broker will create durable queues for all the listeners.


[1]https://svn.apache.org/repos/asf/qpid/tags/0.8/qpid/
[2]http://anonsvn.jboss.org/repos/rhmessaging/store/tags/qpid-0.8-release/cpp/
[3]http://qpid.apache.org/download.cgi

4 comments:

Krishantha said...

Hi Lahiru,

Really helpful post. This one seems to be the only blog with the $subject in web.

BTW, I have came across compilation error when building persistence module. Found that I need to build the src under $QPID-DIR/qpid also. You haven't mentioned that step here. May be it could environment specific issue. I was trying to build Qpid/C on RHEL and Ubuntu.

Thanks again.

Krishantha.

lahiru said...

Thank You Krishantha for pointing this out !

esdee said...

i confirm Krishantha's comment (i use fedora).
apart from that - excellent tutorial! thank you very much!

Anonymous said...

Hi Lahiru,
The comments are quite useful, thanks,
However, I am starting to work with an already installed qpid cpp package (rpm) on Linux VM.
running qpid I receive an error message like
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
Aborted

It would be good if I understand what configurations are missing so that this broker could run.
Any idea, or link to a comprehensive page about this would be appreciated, I have already read many pages!

Regards,
Siamak