Commit 68e267a7 authored by Steven Murray's avatar Steven Murray
Browse files

Renamed the TAPESERVERD castor.conf parameters

parent 5215b1fe
......@@ -505,23 +505,27 @@
## Tapeserverd #################################################################
#TAPESERVERD NB_BUFS 300 # Number of rtcopy buffers for a 2G machine (1G machine? put 160)
#TAPESERVERD BUFSZ 5242880 # Size of a buffer (5M is the default)
# Number of memory buffers in the data-transfer cache.
#TapeServer NbBufs 300
# The number of disk I/O threads.
#TAPESERVERD THREAD_POOL 10
# Size of a memory buffer in the data-transfer cache in bytes (default is 5
# Mebibytes)
#TapeServer BufSize 5242880
# The number of disk I/O threads
#TapeServer NbDiskThreads 10
# The maximum time in seconds that the data-transfer session can take to get the
# transfer job from the client.
#TAPESERVERD WAITJOBTIMEOUT 60
#TapeServer WaitJobTimeout 60
# The maximum time in seconds that the data-transfer session can take to mount a
# tape.
#TAPESERVERD MOUNTTIMEOUT 900
#TapeServer MountTimeout 900
# The maximum time in seconds the data-transfer session of tapeserverd can
# cease to move data blocks
#TAPESERVERD BLKMOVETIMEOUT 300
#TapeServer BlkMoveTimeout 300
# When the tapeserverd daemon requests the tapegatewayd daemon for a set of
# files to migrate to tape, this parameter defines the maximum number of bytes
......@@ -532,7 +536,7 @@
# in order for any change in the value of this parameter to be taken into
# account.
#
#TAPESERVERD BULKREQUESTMIGRATIONMAXBYTES 80000000000
#TapeServer BulkRequestMigrationMaxBytes 80000000000
# When the tapeserverd daemon requests the tapegatewayd daemon for a set of
# files to migrate to tape, this parameter defines the maximum number of files
......@@ -543,9 +547,9 @@
# in order for any change in the value of this parameter to be taken into
# account.
#
#TAPESERVERD BULKREQUESTMIGRATIONMAXFILES 500
#TapeServer BulkRequestMigrationMaxFiles 500
# When the tapebridged daemon requests the tapegatewayd daemon for a set of
# When the tapeserverd daemon requests the tapegatewayd daemon for a set of
# files to recall from tape, this parameter defines the maximum number of bytes
# the set of files should represent.
#
......@@ -554,7 +558,7 @@
# in order for any change in the value of this parameter to be taken into
# account.
#
#TAPESERVERD BULKREQUESTRECALLMAXBYTES 80000000000
#TapeServer BulkRequestRecallMaxBytes 80000000000
# When the tapeserverd daemon requests the tapegatewayd daemon for a set of
# files to recall from tape, this parameter defines the maximum number of files
......@@ -565,7 +569,7 @@
# in order for any change in the value of this parameter to be taken into
# account.
#
#TAPESERVERD BULKREQUESTRECALLMAXFILES 500
#TapeServer BulkRequestRecallMaxFiles 500
# The value of this parameter defines the maximum number of bytes to be written
# to tape before a flush to tape (synchronised tape-mark). Please note that a
......@@ -577,7 +581,7 @@
# in order for any change in the value of this parameter to be taken into
# account.
#
#TAPESERVERD MAXBYTESBEFOREFLUSH 32000000000
#TapeServer MaxBytesBeforeFlush 32000000000
# The value of this parameter defines the maximum number of files to be written
# to tape before a flush to tape (synchronised or non-immediate tape-mark).
......@@ -587,7 +591,7 @@
# in order for any change in the value of this parameter to be taken into
# account.
#
#TAPESERVERD MAXFILESBEFOREFLUSH 200
#TapeServer MaxFilesBeforeFlush 200
## Tape Bridge Clients: dumptp, readtp and writetp #############################
......
......@@ -53,35 +53,33 @@ castor::tape::tapeserver::daemon::DataTransferConfig
DataTransferConfig config;
config.bufsz = castorConf.getConfEntInt(
"TAPESERVERD", "BUFSZ",
"TapeServer", "BufSize",
castor::tape::tapeserver::daemon::TAPESERVER_BUFSZ_DEFAULT, log);
config.nbBufs = castorConf.getConfEntInt<uint32_t>(
"TAPESERVERD", "NB_BUFS", log);
config.tapeBadMIRHandlingRepair = castorConf.getConfEntString(
"TAPESERVERD", "BADMIR_HANDLING", "CANCEL", log);
"TapeServer", "NbBufs", log);
config.bulkRequestMigrationMaxBytes = castorConf.getConfEntInt(
"TAPESERVERD", "BULKREQUESTMIGRATIONMAXBYTES",
"TapeServer", "BulkRequestMigrationMaxBytes",
(uint64_t)TAPEBRIDGE_BULKREQUESTMIGRATIONMAXBYTES, log);
config.bulkRequestMigrationMaxFiles = castorConf.getConfEntInt(
"TAPESERVERD", "BULKREQUESTMIGRATIONMAXFILES",
"TapeServer", "BulkRequestMigrationMaxFiles",
(uint64_t)TAPEBRIDGE_BULKREQUESTMIGRATIONMAXFILES, log);
config.bulkRequestRecallMaxBytes = castorConf.getConfEntInt(
"TAPESERVERD", "BULKREQUESTRECALLMAXBYTES",
"TapeServer", "BulkRequestRecallMaxBytes",
(uint64_t)TAPEBRIDGE_BULKREQUESTRECALLMAXBYTES, log);
config.bulkRequestRecallMaxFiles = castorConf.getConfEntInt(
"TAPESERVERD", "BULKREQUESTRECALLMAXFILES",
"TapeServer", "BulkRequestRecallMaxFiles",
(uint64_t)TAPEBRIDGE_BULKREQUESTRECALLMAXFILES, log);
config.maxBytesBeforeFlush = castorConf.getConfEntInt(
"TAPESERVERD", "MAXBYTESBEFOREFLUSH",
"TapeServer", "MaxBytesBeforeFlush",
(uint64_t)TAPEBRIDGE_MAXBYTESBEFOREFLUSH, log);
config.maxFilesBeforeFlush = castorConf.getConfEntInt(
"TAPESERVERD", "MAXFILESBEFOREFLUSH",
"TapeServer", "MaxFilesBeforeFlush",
(uint64_t)TAPEBRIDGE_MAXFILESBEFOREFLUSH, log);
config.nbDiskThreads = castorConf.getConfEntInt(
"TAPESERVERD", "THREAD_POOL",
"TapeServer", "NbDiskThreads",
castor::tape::tapeserver::daemon::TAPESERVER_NB_DISK_THREAD_DEFAULT, log);
config.remoteFileProtocol = castorConf.getConfEntString(
"TAPESERVERD", "REMOTEFILEPROTOCOL", "RFIO", log);
"TapeServer", "RemoteFileProtocol", "RFIO", log);
config.xrootPrivateKey = castorConf.getConfEntString(
"XROOT", "PrivateKey", "/opt/xrootd/keys/key.pem", log);
......
......@@ -74,7 +74,8 @@ castor::tape::tapeserver::daemon::TapeDaemon::TapeDaemon(
legacymsg::VdqmProxy &vdqm,
legacymsg::VmgrProxy &vmgr,
reactor::ZMQReactor &reactor,
castor::server::ProcessCap &capUtils):
castor::server::ProcessCap &capUtils,
const TapeDaemonConfig &tapeDaemonConfig):
castor::server::Daemon(stdOut, stdErr, log),
m_state(TAPEDAEMON_STATE_RUNNING),
m_startOfShutdown(0),
......@@ -87,6 +88,7 @@ castor::tape::tapeserver::daemon::TapeDaemon::TapeDaemon(
m_vmgr(vmgr),
m_reactor(reactor),
m_capUtils(capUtils),
m_tapeDaemonConfig(tapeDaemonConfig),
m_programName("tapeserverd"),
m_hostName(getHostName()),
m_processForker(NULL),
......@@ -191,9 +193,6 @@ void castor::tape::tapeserver::daemon::TapeDaemon::exceptionThrowingMain(
logStartOfDaemon(argc, argv);
parseCommandLine(argc, argv);
const TapeDaemonConfig config =
TapeDaemonConfig::createFromCastorConf(&m_log);
// Process must be able to change user now and should be permitted to perform
// raw IO in the future
setProcessCapabilities("cap_setgid,cap_setuid+ep cap_sys_rawio+p");
......@@ -208,8 +207,6 @@ void castor::tape::tapeserver::daemon::TapeDaemon::exceptionThrowingMain(
m_processForkerPid = forkProcessForker(cmdPair, reaperPair);
const ProcessForkerConfig processForkerConfig =
ProcessForkerConfig::createFromCastorConf(&m_log);
m_processForker = new ProcessForkerProxySocket(m_log, cmdPair.tapeDaemon);
m_catalogue = new Catalogue(
m_netTimeout,
......@@ -219,9 +216,9 @@ void castor::tape::tapeserver::daemon::TapeDaemon::exceptionThrowingMain(
m_vdqm,
m_vmgr,
m_hostName,
config.waitJobTimeoutInSecs,
config.mountTimeoutInSecs,
config.blockMoveTimeoutInSec);
m_tapeDaemonConfig.waitJobTimeoutInSecs,
m_tapeDaemonConfig.mountTimeoutInSecs,
m_tapeDaemonConfig.blockMoveTimeoutInSec);
m_catalogue->populate(m_driveConfigs);
......@@ -542,10 +539,8 @@ void castor::tape::tapeserver::daemon::TapeDaemon::
int castor::tape::tapeserver::daemon::TapeDaemon::runProcessForker(
const int cmdReceiverSocket, const int reaperSenderSocket) throw() {
try {
const ProcessForkerConfig processForkerConfig =
ProcessForkerConfig::createFromCastorConf();
ProcessForker processForker(m_log, cmdReceiverSocket, reaperSenderSocket,
m_hostName, m_argv[0], processForkerConfig);
m_hostName, m_argv[0], m_tapeDaemonConfig.processForkerConfig);
processForker.execute();
return 0;
} catch(castor::exception::Exception &ex) {
......
......@@ -33,7 +33,9 @@
#include "castor/server/ProcessCap.hpp"
#include "castor/tape/reactor/ZMQReactor.hpp"
#include "castor/tape/tapeserver/daemon/Catalogue.hpp"
#include "castor/tape/tapeserver/daemon/ProcessForkerConfig.hpp"
#include "castor/tape/tapeserver/daemon/ProcessForkerProxy.hpp"
#include "castor/tape/tapeserver/daemon/TapeDaemonConfig.hpp"
#include "castor/tape/utils/DriveConfigMap.hpp"
#include "castor/tape/utils/utils.hpp"
#include "castor/utils/utils.hpp"
......@@ -75,6 +77,8 @@ public:
* @param reactor The reactor responsible for dispatching the I/O events of
* the parent process of the tape server daemon.
* @param capUtils Object providing utilities for working UNIX capabilities.
* @param tapeDaemonConfig The CASTOR configuration parameters to be used by
* the tape daemon.
*/
TapeDaemon(
const int argc,
......@@ -88,7 +92,8 @@ public:
legacymsg::VdqmProxy &vdqm,
legacymsg::VmgrProxy &vmgr,
reactor::ZMQReactor &reactor,
castor::server::ProcessCap &capUtils);
castor::server::ProcessCap &capUtils,
const TapeDaemonConfig &tapeDaemonConfig);
/**
* Destructor.
......@@ -268,6 +273,7 @@ protected:
* @param reaperPair Socket pair used by the ProcessForker to notify the
* TapeDaemon parent process of the termination of ProcessForker child
* processes.
* by the ProcessForker.
* @return The process identifier of the ProcessForker.
*/
pid_t forkProcessForker(const ForkerCmdPair &cmdPair,
......@@ -334,7 +340,8 @@ protected:
* reports to the TapeDaemon parent process.
* @return the exit code to be used for the process running the ProcessForker.
*/
int runProcessForker(const int cmdReceiverSocket,
int runProcessForker(
const int cmdReceiverSocket,
const int reaperSenderSocket) throw();
/**
......@@ -569,6 +576,11 @@ protected:
*/
castor::server::ProcessCap &m_capUtils;
/**
* The CASTOR configuration parameters to be used by the tape daemon.
*/
const TapeDaemonConfig m_tapeDaemonConfig;
/**
* The program name of the daemon.
*/
......
......@@ -47,13 +47,15 @@ castor::tape::tapeserver::daemon::TapeDaemonConfig
TapeDaemonConfig config;
config.processForkerConfig = ProcessForkerConfig::createFromCastorConf(log);
config.waitJobTimeoutInSecs = castorConf.getConfEntInt("TAPESERVERD",
"WAITJOBTIMEOUT", (time_t)TAPESERVER_WAITJOBTIMEOUT_DEFAULT, log);
config.mountTimeoutInSecs = castorConf.getConfEntInt("TAPESERVERD",
"MOUNTTIMEOUT", (time_t)TAPESERVER_MOUNTTIMEOUT_DEFAULT, log);
config.blockMoveTimeoutInSec = castorConf.getConfEntInt("TAPESERVERD",
"BLKMOVETIMEOUT", (time_t)TAPESERVER_BLKMOVETIMEOUT_DEFAULT, log);
config.cupvHost = castorConf.getConfEntString("UPV" , "HOST", log);
config.vdqmHost = castorConf.getConfEntString("VDQM", "HOST", log);
config.vmgrHost = castorConf.getConfEntString("VMGR", "HOST", log);
config.waitJobTimeoutInSecs = castorConf.getConfEntInt("TapeServer",
"WaitJobTimeout", (time_t)TAPESERVER_WAITJOBTIMEOUT_DEFAULT, log);
config.mountTimeoutInSecs = castorConf.getConfEntInt("TapeServer",
"MountTimeout", (time_t)TAPESERVER_MOUNTTIMEOUT_DEFAULT, log);
config.blockMoveTimeoutInSec = castorConf.getConfEntInt("TapeServer",
"BlkMoveTimeout", (time_t)TAPESERVER_BLKMOVETIMEOUT_DEFAULT, log);
return config;
}
......@@ -44,6 +44,21 @@ struct TapeDaemonConfig {
*/
ProcessForkerConfig processForkerConfig;
/**
* The network name of the host on which the cupv daemon is running.
*/
std::string cupvHost;
/**
* The network name of the host on which the vdqm daemon is running.
*/
std::string vdqmHost;
/**
* The network name of the host on which the vmgr host is running.
*/
std::string vmgrHost;
/**
* The maximum time in seconds that the data-transfer session can take to get
* the transfer job from the client.
......
......@@ -110,13 +110,10 @@ static void logTpconfigLine(castor::log::Logger &log,
static int exceptionThrowingMain(const int argc, char **const argv,
castor::log::Logger &log) {
using namespace castor;
common::CastorConfiguration &config =
common::CastorConfiguration::getConfig();
const std::string cupvHost = config.getConfEntString("UPV" , "HOST", &log);
const std::string vdqmHost = config.getConfEntString("VDQM", "HOST", &log);
const std::string vmgrHost = config.getConfEntString("VMGR", "HOST", &log);
// Parse /etc/castor/castor.conf
const tape::tapeserver::daemon::TapeDaemonConfig tapeDaemonConfig =
tape::tapeserver::daemon::TapeDaemonConfig::createFromCastorConf(&log);
// Parse /etc/castor/TPCONFIG
const tape::utils::TpconfigLines tpconfigLines =
......@@ -127,9 +124,12 @@ static int exceptionThrowingMain(const int argc, char **const argv,
// Create proxy objects for the vdqm, vmgr and rmc daemons
const int netTimeout = 10; // Timeout in seconds
legacymsg::CupvProxyTcpIp cupv(log, cupvHost, CUPV_PORT, netTimeout);
legacymsg::VdqmProxyTcpIp vdqm(log, vdqmHost, VDQM_PORT, netTimeout);
legacymsg::VmgrProxyTcpIp vmgr(vmgrHost, VMGR_PORT, netTimeout);
legacymsg::CupvProxyTcpIp cupv(log, tapeDaemonConfig.cupvHost, CUPV_PORT,
netTimeout);
legacymsg::VdqmProxyTcpIp vdqm(log, tapeDaemonConfig.vdqmHost, VDQM_PORT,
netTimeout);
legacymsg::VmgrProxyTcpIp vmgr(tapeDaemonConfig.vmgrHost, VMGR_PORT,
netTimeout);
tape::reactor::ZMQReactor reactor(log);
......@@ -149,7 +149,8 @@ static int exceptionThrowingMain(const int argc, char **const argv,
vdqm,
vmgr,
reactor,
capUtils);
capUtils,
tapeDaemonConfig);
// Run the tapeserverd daemon
return daemon.main();
......
......@@ -91,9 +91,11 @@ TEST_F(castor_tape_tapeserver_daemon_TapeDaemonTest, constructor) {
castor::legacymsg::VmgrProxyDummy vmgr;
castor::tape::reactor::ZMQReactor reactor(log);
castor::server::ProcessCapDummy capUtils;
TapeDaemonConfig tapeDaemonConfig;
std::auto_ptr<TapeDaemon> daemon;
ASSERT_NO_THROW(daemon.reset(new TapeDaemon(argc, argv, stdOut, stdErr, log,
netTimeout, driveConfigs, cupv, vdqm, vmgr, reactor, capUtils)));
netTimeout, driveConfigs, cupv, vdqm, vmgr, reactor, capUtils,
tapeDaemonConfig)));
}
} // namespace unitTests
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment