Hyrax - Sample BES Installations

From OPeNDAP Documentation
Revision as of 21:24, 7 May 2010 by PatrickWest (talk | contribs) (Installing from Source)

This page will show some sample installations and configurations for the BES. All of these will include libdap and the dap modules.

1 Installing from SVN

Here we will show the installation of the BES, including libdap, from the SVN repository. We will use the trunk, which is the latest and greatest development being done on the software. In this example installation, we'll include the netcdf data handler module.

If you'll be working on the code, we recommend that you install the software not in the standard location, but in your own directory. This way you can have multiple installations of the code if you need.

If you're just installing the software from SVN and won't be doing any development, then installing in the standard location is just fine.

We're going to say for this installation that you are a developer, contributing to this open source project. You're developing on a Mac or Linux machine.

Create a directory in your home called opendap. Under this directory you can check out different versions of the code. Let's say /home/bob/opendap/version1. In this directory, I find it useful to create a file that you can source. This way, when you want to work on this version of the code, you can source this file to set up your environment to use this version. For bash or ksh it would look like this.

export OPENDAP_ROOT=/home/bob/opendap/version1
export PATH="${OPENDAP_ROOT}/bin:${PATH}"
export LD_LIBRARY_PATH="${OPENDAP_ROOT}/lib:${LD_LIBRARY_PATH}"

Now, in this terminal, you'll be able to develop and run this version of opendap without impacting the rest of your machine.

Check out the code:

% svn co http://scm.opendap.org/svn/trunk/libdap libdap
% svn co http://scm.opendap.org/svn/trunk/bes bes
% svn co http://scm.opendap.org/svn/trunk/dap-server dap-server
% svn co http://scm.opendap.org/svn/trunk/netcdf_handler netcdf_handler

Now it's time to build the code.

% cd libdap
% autoreconf --force --install
% ./configure --prefix=${OPENDAP_ROOT}
% make
% make check
% make install

That finishes the build of the libdap, runs all of the tests to make sure it all works properly, and installs it into /home/bob/opendap/version1. Now, on to the BES.

% cd ../bes
% autoreconf --force --install
% ./configure --prefix=${OPENDAP_ROOT} --enable-developer
% make
% make check
% make install

In the build of the BES, if you're a developer, then you'll want to enable the developer mode. This way you don't always have to run the BES as root, and it enables so additional requests to help with development.

NOTE: This option should only be used in development. If you are installing the software in a production environment then you should not use this option. Installing this software into a production environment with this option turned on is a security risk.

With the installation of libdap and the bes, we can now run the BES. It won't be able to serve any data, or even run with the OLFS. But it should still run. Let's test it.

% cd ..
% besctl start
BES install directory: /home/bob/opendap/version1
BES configuration file: /home/bob/opendap/version1/etc/bes/bes.conf
Starting the BES
Developer Mode: not testing if BES is run by root
Developer Mode: not testing if BES is run by root
Developer Mode: Not setting group or user ids
OK: Successfully started the BES
PID: xxxx UID: yyy

So, as you can see, starting the BES tells you where it things the installation directory is, which BES configuration file it's going to use, then starts the BES. Note that developer mode is turned on.

% bescmdln -h localhost -p 10002

Type 'exit' to exit the command line client and 'help' or '?' to display the help screen
BESClient>show version;
<?xml version="1.0" encoding="ISO-8859-1"?>
<response reqID="some_unique_value" xmlns="http://xml.opendap.org/ns/bes/1.0#">
   <showVersion>
       <library name="bes">3.7.2</library>
       <library name="libdap">3.10.0</library>
       <serviceVersion name="dap">
           <version>2.0</version>
           <version>3.0</version>
           <version>3.2</version>
       </serviceVersion>
   </showVersion>
</response>
BESClient>show status;
<?xml version="1.0" encoding="ISO-8859-1"?>
<response reqID="some_unique_value" xmlns="http://xml.opendap.org/ns/bes/1.0#">
   <showStatus>
       <status>EDT Wed May  5 02:43:18 2010</status>
   </showStatus>
</response>
BESClient> exit

Running bescmdln will show us that the client is able to connect to the BES. And we run some quick commands to make sure that it's all installed properly and accepting commands.

% besctl stop
BES install directory: /home/bob/opendap/version1
BES configuration file: /home/bob/opendap/version1/etc/bes/bes.conf
Shutting down the BES daemon
Successfully shut down the BES

This stops the BES. Again, it shows us where it things the BES is installed, which configuration file, and then stops the BES process.

Installing the modules is the same process.

% cd dap-server
% autoreconf --force --install
% ./configure --prefix=${OPENDAP_ROOT}
% make
% make check
% make install
% cd ../netcdf_handler
% autoreconf --force --install
% ./configure --prefix=${OPENDAP_ROOT}
% make
% make check
% make install

And now we have everything installed and avaialable. And now you can run commands against the BES to retrieve data. But first, make sure that everything is installed properly. I won't show all the responses to the commands here, but some of it.

% besctl start
% bescmdln -h localhost -p 10002
BESClient> show version;
<?xml version="1.0" encoding="ISO-8859-1"?>
<response reqID="some_unique_value" xmlns="http://xml.opendap.org/ns/bes/1.0#">
   <showVersion>
       <library name="bes">3.7.2</library>
       <module name="dap-server/ascii">3.9.3</module>
       <library name="libdap">3.10.0</library>
       <serviceVersion name="dap">
           <version>2.0</version>
           <version>3.0</version>
           <version>3.2</version>
       </serviceVersion>
       <module name="freeform_handler">3.7.12</module>
       <module name="fits_handler">1.0.3</module>
       <module name="hdf4_handler">3.7.15</module>
       <module name="hdf5_handler">1.3.5</module>
       <module name="netcdf_handler">3.8.3</module>
       <module name="dap-server/usage">3.9.3</module>
       <module name="dap-server/www">3.9.3</module>
   </showVersion>
</response>
BESClient>set container in catalog values c,data/nc/fnoc1.nc;
BESClient>define d as c;
BESClient>get dds for d;
Dataset {
   Structure {
       Int16 u[time_a = 16][lat = 17][lon = 21];
       Int16 v[time_a = 16][lat = 17][lon = 21];
       Float32 lat[lat = 17];
       Float32 lon[lon = 21];
       Float32 time[time = 16];
   } c;
} fnoc1.nc;
BESClient> exit
% besctl stop

And there, you have a successful installation of the BES. And this version can interact with the OLFS as well.

2 Installing from Source

Installing the BES from a source distribution is quite similar to installing from SVN. The only difference is that instead of checking out the code from SVN, you download the source distribution for the components that you want to install, build, test, and install from those source distributions.

The source distributions are downloaded as tar balls. In other words, they have a .tgz extension in them and you need to use tar to unpack them all.

3 Installing from Binary