Basic TDS Configuration


Tomcat Directories

We've already looked in a few of the directories under the ${TOMCAT_HOME} directory:

Another directory under ${TOMCAT_HOME} we'll be looking at soon:

We will go into more detail on the Tomcat directories later.

TDS Directories

All TDS configuration information is stored in a directory that is created the first time the TDS is run. The configuration directory, ${TOMCAT_HOME}/content/thredds, is created and populated with default files the first time a TDS installation is run. It is persistent even when a TDS installation is upgraded or re-deployed. All your configuration, modifications, and additions should be made in this directory. Do not place files containing passwords or anything else with security issues in this directory.Typically you will only be adding and modifying catalogs and configuration files.

We will go into more detail on the TDS directories later. For now, we will be focus on the following subset of the content directory:



TDS Configuration Catalog

The main TDS configuration catalog is at ${TOMCAT_HOME}/content/thredds/catalog.xml. We ship a simple test catalog:

  <?xml version="1.0" encoding="UTF-8"?>
<catalog
name="THREDDS Server Default Catalog : You must change this to fit your server!"
xmlns="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0"
xmlns:xlink="http://www.w3.org/1999/xlink" >

(1) <service name="thisDODS" serviceType="OpenDAP" base="/thredds/dodsC/" />
<datasetRoot path="test" location="content/testdata/" />

(2) <dataset name="Test Single Dataset" ID="testDataset" serviceName="thisDODS"
urlPath="test/testData.nc" />
(3) <datasetScan name="Test all files in a directory" ID="testDatasetScan" 
path="testAll" location="content/testdata">

<metadata inherited="true">
<serviceName>thisDODS</serviceName>
</metadata>

<filter>
(3a) <include wildcard="*.nc" />
</filter>

</datasetScan>

(4) <catalogRef xlink:title="Test Enhanced Catalog" xlink:href="enhancedCatalog.xml" name ="" />
</catalog>

which defines (1) an OPeNDAP server, (2) a single dataset, (3) all the datasets in a directory that match the given wildcard pattern (3a), and (4) a catalog reference. It is provided as a quick test that the TDS is working as it should.

When the TDS starts, this main configuration catalog is read as are all catalogs in the catalog tree defined by catalogRef elements. The TDS gathers configuration information on what datasets it should serve from the datasetRoot and datasetScan elements.

Example: Fix Enhanced Catalog

  1. Drilling down into the "Test Enhanced Catalog" dataset, we can see that there are no datasets cataloged.
  2. If we open the enhanced catalog, we see that there is a datasetScan element with a location of "content/testdata/". This location is a shortcut that corresponds to the directory ${TOMCAT_HOME}/content/thredds/public/testdata/. Let's see what is in that directory and why the datasetScan in enhancedCatalog.xml isn't finding any datasets:

Here are the datasets listed:

2004050300_eta_211.nc
2004050312_eta_211.nc
2004050400_eta_211.nc
2004050412_eta_211.nc
testData2.nc
testData.nc

And here's some of the text from the datasetScan element:

    <datasetScan name="ETA Data" ID="testEnhanced"
path="testEnhanced" location="content/testdata/"
harvest="true">
<metadata inherited="true">
...
</metadata>

<filter>
<include wildcard="*.eta_211.nc" />
</filter>
...
</datasetScan>

Notice the filter wildcard pattern. The filenames contain an underscore ("_") before "eta" but the wildcard contains a dot ("."). Let's change it and see what happens:

  1. Edit the enhanced catalog and change the wildcard pattern.
  2. Browse the catalog
  3. Oh yeah! Restart Tomcat so the TDS is reinitialized
  4. Look at catalogErrors.log file
  5. Browse the catalog again

Note: It is NOT recommended to use the location value shortcut "content/" in a production server. You will probably want to locate your data on a seperate disk partition from your configuration.

Example: Add NCEP GFS model data

Let's modify the main TDS configuration catalog to include some model data.

  1. Edit the main TDS configuration catalog:
  2. Change the datasetScan element location attribute value to /data/ldm/pub/native/grid/NCEP/GFS
  3. Change the name, ID and other items as appropriate. Does the filter pattern need to be changed?
  4. Restart Tomcat so the TDS is reinitialized:
  5. Browse the catalog again

Example: Other Available Datasets

When configuring the TDS to serve your data, it is important to remember that the TDS can only serve data that is readable through the netCDF-Java library. Let's take a look around for some more data that we can serve:

  1. Open the ToolsUI application:
  2. Browse under the /data directory for a collection of datasets
  3. Edit main TDS configuration catalog as above


View catalogs and datasets in ToolsUI and/or IDV

  1. Open ToolsUI or IDV:
  2. In ToolsUI
  3. In IDV

This document is maintained by Unidata and was last updated on July 24, 2007. Send comments to THREDDS support.