The script wrapper requires a script daemon that listens
for script job requests from the script wrapper. The script daemon
must be configured before you register the script wrapper.
Before you begin
The
script daemon has the following prerequisites:
- Has write access to a directory in which the daemon can write
temporary files.
- Runs on a server that you can access through TCP/IP from your
federated system. This server can be the same server that operates
as the federated server or a separate script server.
- Requires a configuration file that must be on the same server
as the script daemon.
- Runs separately from the script wrapper and the federated database.
Procedure
To configure the script daemon:
- Ensure that the executable files for the script daemon
are on the correct server. You might need to copy the script daemon
executable files to another server.
During the installation
of
IBM® InfoSphere™ Federation Server, the script daemon executable files are installed on the federated
server. The name and location of the file is as follows:
- UNIX®
- db2script_daemon is installed in the $DB2PATH/bin directory. $DB2PATH is
the directory in which the federated server is installed.
- Windows®
- db2script_daemon.exe is installed in the %DB2PATH%\bin directory. %DB2PATH% is
the directory in which the federated server is installed, usually
C:\SQLLIB\bin.
If you use a separate script server, copy the
script daemon executable and configuration files from the federated
server to the script server. The script daemon executable files can
run in any directory on the script server that does not contain spaces
in the names in the directory path.
- Ensure that the configuration file for the script daemon
is on the correct server.
During the installation
of the federated system, a sample configuration file for the script
daemon is installed on the federated server. The name of the sample
configuration file is
SCRIPT_DAEMON.config. The
location of the file is as follows:
- UNIX
- The daemon configuration file is installed in the $DB2PATH/bin directory.
- Windows
- The daemon configuration file is installed in the %DB2PATH%\bin directory.
By default, the daemon looks for the configuration
file in the working directory from which the daemon is started. You
can copy the configuration file to another location. If you use a
script server, copy the daemon configuration file from the directory
on the federated server to a directory on the script server. You can
copy the daemon configuration file to any directory on the script
server that the daemon can access.
- Edit the sample configuration file for the script daemon.
- Rename the configuration file so that you can use the
sample file again.
- Ensure that the first line in the configuration file
is an equal sign (=). If the equal sign is missing, the daemon does
not start. An error message will indicate that the DAEMON_PORT was
not specified.
- Ensure that the last line in the configuration file
ends with a new line.
The sample configuration file
that is provided with the federated system ends with a new line character.
If the last line does not end with a new line character, you receive
an error message when you try to run your first script query that
uses the data source that is listed on the last line.
- Ensure that there are no extra spaces after directory
paths or at the end of the configuration file.
- Specify the following options in the configuration file.
For options that require paths, you can specify relative paths. Relative
paths are relative to the directory from which the daemon process
is started.
- DAEMON_PORT=port_number
- The network port on which the daemon listens for script job requests
that are submitted by the wrapper. The default value is 4099.
- MAX_PENDING_REQUESTS=number_of_requests
- The maximum number of script job requests that can be blocking
on the daemon at any one time. This number does not represent the
number of script jobs that are running concurrently, only the number
of job requests that can block at one time. Set this value to a number
greater than five. The script daemon does not restrict the number
of script jobs that can run concurrently.
- DAEMON_LOGFILE_DIR=dir
- The directory in which the daemon creates its log file. This
file contains status and error information that is generated by the
script daemon.
- SCRIPT_OUT_DIR_PATH=path
- The directory in which the daemon creates the temporary file to
store the script output data. The daemon reads data from this file
and passes the data back to the wrapper through the network connection.
After the data is passed to the wrapper, the daemon cleans up the
temporary file
- script specification entry=entry
- A list of entries that specifies the name and location of the
scripts that can be invoked by the script wrapper. The entry has this
format:
script_name=fully-qualified_script_path
The
following examples apply to the designated operating system:- UNIX
- For example, to specify a script that accesses an Oracle data
source, add the following line to the daemon configuration file:
oracle=/dsk/1/data/oracle
- Windows
- For example, to specify a script that accesses an Oracle data
source, add the following line to the daemon configuration file:
oracle=c:\data\oracle.a
The following example shows a SCRIPT_DAEMON.cfg file for
four scripts:
=
DAEMON_PORT=4099
MAX_PENDING_REQUESTS=10
DAEMON_LOGFILE_DIR=./
SCRIPT_OUT_DIR_PATH=./
fee=/home/user_id/fee
fie=/home/user_id/fie
foe=/home/user_id/foe
fum=/home/user_id/fum
The sample configuration file
for the script daemon provides an example of configuring the script
daemon.