![](media/image1.wmf)

Fermilab

ILC doc-414

November 14, 2023

**Epics ILCTA Archiving**

Vladimir Sirotenkov

Abstract

This document contains implementation details of Epics Channel Archiver
for ILCTA control system at Fermilab.

# Introduction

> We are using [Channel
> Archiver](http://ics-web1.sns.ornl.gov/~kasemir/archiver/index.html)
> toolset to archive any variable which is a part of [Experimental
> Physics and Industrial Control System
> (EPICS)](http://www.aps.anl.gov/epics/) widely used in ICLTA facility.
> Variables are accessed via [channel access network protocol
> (CA)](http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6TJM-472CGTH-D8&_user=864464&_coverDate=08%2F01%2F1990&_rdoc=1&_fmt=&_orig=search&_sort=d&view=c&_acct=C000046560&_version=1&_urlVersion=0&_userid=864464&md5=be3f8922b70222478b64910072700aaa).
> The toolset includes the following components: (i) the Archive Engine
> which collects data from a given list of channels; (ii) data which are
> stored in binary index and data files; (iii) retrieval tools which
> provides generic way for browsing the available channels and values;
> (iv) tools for archive maintenance and manipulation.

# Configuration

The current version of the Channel Archiver is 2.9.2 and it was build
under epics 3.14.7 on Fermi Scientific Linux 3.0.4. To use
[ArchiveViewer 1.0.4](http://ics-web1.sns.ornl.gov/archive/viewer/) one
need JDK 1.4 or later and to use ArchiveViewer as Java Server pages, one
need to install Apache's Tomcat 5.5 or higher on a web server. The
Channel Archiver toolset is organized as a package *chan_archiver* in
the local ups database on the Mesan Detector Building (MDB) Linux
cluster.

There are currently 5 archive engines running: MDB (cryogenics), CTF
(cryogenics), NML (cryogenics), A0 coupler and Proton Driver with total
of more than a 1000 archived channels with average scan rate 10 seconds.
All engines run on smtfs2.fnal.gov and store data into the local disk
/mnt/smtfs2 with 216 Gb capacity.

The following directory structure is used:

/mnt/smtf2/archive/current - for current archives

/daemon

/a0coupler

/ctf

/mdb

/nml

/protondriver

/mnt/smtf2/archive/history - for previous, saved archives

The engine configuration is kept in the files *engineconfig.xml* which
reside in the archivers subdirectories like /nml, /mdb and so on. The
daemon configuration file has a name *ArchiveDaemon.xml* and can be
found in the /daemon subdirectory.

# Running the Archiver

The epics archiver is configured to start in one of two ways: through a
daemon or through the command line.

## Daemon

From the command line:

> *\> setup chan_archiver*
>
> *\> cd \$ARCHIVER_DAEMON*
>
> *\> ArchiveDaemon.pl -f ArchiveDaemon.xml*

Configuration file ArchiveDaemon.xml describes all ArchiveEngines
controlled by the ArchiveDaemon, so if new archive has to be added, one
has to edit this configuration file and restart daemon. After being
started ArchiveDaemon will be detached from the terminal and can be
connected through the any web browser pointed to the following URL:

[*http://smtfs2.fnal.gov:4610*](http://smtfs2.fnal.gov:4610/)

Here 4610 is the default daemon port which can be changed in
configuration file. All ArchiveEngines controlled by this daemon can be
accessed from that web site and can be enabled \[disabled\].
ArchiverDaemon can be stopped via web by setting

[*http://smtfs2.fnal.gov:4610/stop*](http://smtfs2.fnal.gov:4610/stop)

## Command line

Each archive engine can be started from command line:

> *\> setup chan_archiver*
>
> *\> cd \$ARCHIVE_CURRENT/\<your archive directory\>*
>
> *\> ArchiveEngine \[-port \<port\>\] \<config file\> \<index file\>*

Default port is 4812, but you can use any other port number.

After that you can monitor/control archive engine from the web site

[*http://localhost:4812*](http://localhost:4812/)

To stop archiver, use

[*http://localhost:4812/stop*](http://localhost:4812/stop)

# Viewing the Data

The Archiver Data Server is hosted by the web server, read data from
many archives and serves them using XML-RPC protocol to various archive
data viewer clients. The Data Server URL is defined as \$URL
environmental variable and its configuration file as \$SERVERCONFIG
(defined after command 'setup chan_archiver')

In out case

*SERVERCONFIG=\$CHAN_ARCHIVER_DIR/cgi/serverconfig.xml*

*URL=http://smtfs1.fnal.gov/cgi-bin/archive/ArchiveDataServer.cgi*

To add or remove archive which will be served by Data Server, one has to
edit server configuration file.

Two basic approaches are used to view data from the different archives
through Data Server: running Archive Viewer as apps using JSNP/WebStart
and running Archive Viewer as Java Server Pages (JSP) .

## Archive Viewer as apps

On MDB Linux cluster after 'setup chan_archiver' just do

*\$CHAN_ARCHIVER_DIR/archiveviewer*

On Windows machines we recommend to follow steps below to solve the
problem of accessing Data Server which is behind the BD firewall and
speed up X response

1.  Copy folder
    *[\\\\d0server6\\projects\\onl_apps\\smtf\\SmtfArchiverAccess](../../../../../../../../projects/onl_apps/smtf/SmtfArchiverAccess)*
    to your local disk and go to that folder

2.  Create shortcut for ArchiveViewerFnal.jnlp to your desktop, rename
    it to \"ArchiveViewer\"

3.  Create shortcut to SMTFS1-Run-SSH.CMD to your desktop, right click
    on it, choose Properties and in Target field after last \" add the
    following: outback.fnal.gov \<your user name\>

So Target field should look like that (example of my case):

\"C:\\SmtfArchiveAccess\\SMTFS1-Run-SSH.CMD\" outback.fnal.gov sirotenk

Look at the properties of the \"Example of Shortcut to
SMTFS1-RUN-SSH.CMD\"

Rename shortcut to \"smtf-access\"

4.  Double click on that shortcut \"smtf-access\" and in command window
    type your kerberos password. You will be logged in to outback Linux
    node. Keep that command window during your following session, you
    can minimize it.

5.  Double click on shortcut \"ArchiveViewer\", archiveviewer will
    start.

> After the installation only steps 4 and 5 are necessary.

## Archive Viewer as JSP

If web browser is running on the MDB Linux cluster, the following URL
will access Archive Data Server:

[*http://smtfs1.fnal.gov:8080/archiveviewer*](http://smtfs1.fnal.gov:8080/archiveviewer)

Again for Windows machines outside the BD firewall you should use steps
1-3 from the section 4.1 and after clicking on "smtf-access" and keeping
that running, point your web browser to the following URL:

[*http://localhost:8080/archiveviewer*](http://localhost:8080/archiveviewer)

and then click "Connect" to access Data Server.