Basic TDS ConfigurationWe've already looked in a few of the directories under the ${TOMCAT_HOME} directory:
bin/ directory contains the Tomcat starup and shutdown scripts:starup.shshutdown.shwebapps/ directory contains the software for each web application installed in Tomcat. For the TDS, we have:thredds.war distribution file; andthredds/ directory where the distribution is unpacked [Note: This directory is overwritten each time a new TDS is deployed.]Another directory under ${TOMCAT_HOME} we'll be looking at soon:
logs/ directory contains the Tomcat log files:catalina.out - standard output from all web applicationsWe will go into more detail on the Tomcat directories later.
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:
content/thredds/.INIT - the presence of this file indicates whether the default files have been copied - it is important not to delete this file.catalog.xml - the main TDS configuration catalog (root catalog for TDS configuration) enhancedCatalog.xml - an example catalog [Note: It is referenced from catalog.xml.]logs/catalogErrors.xml - messages from TDS configuration contains information on the TDS configuration catalogsthreddsServlet.xmlThe 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.
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:cd ${TOMCAT_HOME}/content/threddsls public/testdatavi enhancedCatalog.xmlHere 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:
http://localhost:8080/thredds/enhancedCatalog.htmlcd ${TOMCAT_HOME}/bin./shutdown.sh./startup.shcatalogErrors.log fileNote: 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.
Let's modify the main TDS configuration catalog to include some model data.
cd ${TOMCAT_HOME}/content/threddsvi catalog.xmldatasetScan element location attribute value to /data/ldm/pub/native/grid/NCEP/GFSname, ID and other items as appropriate. Does the filter pattern need to be changed?ls /data/ldm/pub/native/grid/NCEP/GFSls /data/ldm/pub/native/grid/NCEP/GFS/* "GFS*.grib1"cd ${TOMCAT_HOME}/bin./shutdown.sh./startup.shWhen 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:
/data directory for a collection of datasetshttp://www.unidata.ucar.edu/software/netcdf-java/v2.2/webstart/netCDFtools-2.2.jnlphttp://www.unidata.ucar.edu/software/idv/release/stable/webstart/IDV/idv.jnlp
This document is maintained by Unidata and was last updated on July 24, 2007. Send comments to THREDDS support.