The standard configuration assumes that the database server is
installed on the same machine as the replica
service
— usually the admin node of the dCache instance. If
this is not the case you need to set the property
replica.db.host
.
To create and configure the database
replicas used by the replica
service in the database server do:
[root] #
createdb -U srmdcache replicas
[root] #
psql -U srmdcache -d replicas -f /opt/d-cache/etc/psql_install_replicas.sql
To activate the replica
service you need to
Enable the replica
service in a layout file.
[<someDomain>] ... [<someDomain>/replica]
Configure the service in the
/opt/d-cache/etc/dcache.conf
file on the
node with the dCacheDomain
and on the node on which the
pnfsmanager
is running.
dcache.enable.replica=true
It will not work properly if you defined the
replica
service in one of the layout files and set
this property to no
on the node with
the dCacheDomain
or on the node on which the
pnfsmanager
is running.
Define a pool group for the resilient pools if necessary.
Start the replica
service.
In the default configuration, all pools of the dCache instance
which have been created with the command dcache pool
create will be managed. These pools are in the pool
group named default
which does exist by
default. The replica
service will keep the number of
replicas between 2 and 3 (including). At each restart of the
replica
service the pool configuration in the database will
be recreated.
Example:
This is a simple example to get started with. All your pools
are assumed to be in the pool group
default
.
In your layout file in the directory /opt/d-cache/etc/layouts
define the
replica
service.
[dCacheDomain] ... [replicaDomain] [replicaDomain/replica]
In the file /opt/d-cache/etc/dcache.conf
set the value for the property
replicaManager
to
true
and the
replica.poolgroup
to
default
.
dcache.enable.replica=true replica.poolgroup=default
The pool group default
exists by
default and does not need to be defined.
To start the replica
service restart dCache.
[root] #
dcache restart
For more complex installations of dCache you might want to define a pool group for the resilient pools.
Define the resilient pool group in the
/opt/d-cache/config/PoolManager.conf
file on the host running
the poolmanager
service. Only pools defined in the resilient
pool group will be managed by the replica
service.
Example:
Login to the admin interface and cd to the PoolManager
.
Define a poolgroup for resilient pools and add pools to that
poolgroup.
(local) admin >
cd PoolManager
(PoolManager) admin >
psu create pgroup ResilientPools
(PoolManager) admin >
psu create pool pool3
(PoolManager) admin >
psu create pool pool4
(PoolManager) admin >
psu addto pgroup ResilientPools pool3
(PoolManager) admin >
psu addto pgroup ResilientPools pool4
(PoolManager) admin >
save
By default the pool group named
ResilientPools
is used for replication.
To use another pool group defined in
/opt/d-cache/config/PoolManager.conf
for replication,
please specify the group name in the
etc/dcache.conf
file.
replica.poolgroup=<NameOfResilientPoolGroup>.