|
Step-by-step checklist for slave server setup / re-sync
The following checklist shows step-by-step instructions for
setting up or re-synchronizing a slave server.
There are three sections in the checklist: section A with initial steps
for setting up a slave server, section B with initial steps for
re-synchronizing a slave server, and section C with steps that are common
to both tasks.
Either perform the steps of section A and C or the steps of section B and C,
depending on your task.
initial steps specific to slave setup
Adjust master server config to enable forward logging and
replication
...
[Replication]
Role = Master
...
[ForwardLog]
FwLog = /example/master/logs/fw-%N.log
EnableAudit=1
...
Note: using EnableAudit=1 is optional, but typically useful.
Restart master server to activate config changes
$ /etc/init.d/eloq8 restart MASTER_ID
Note: the above example is for Linux, on HP-UX use
/sbin/init.d/eloq8.
Create slave server config (typically based on the master
config)
...
[Replication]
Role = Slave
...
[ForwardLog]
FwLog = /example/slave/logs/fw-%N.log
...
Note: using FwLog on the slave is optional, but typically useful.
Important: when running master and slave servers on the same
system, you may also need to adjust the following config options
for the slave to prevent conflicts with the master: Service ,
ServiceHttp , LogFile , StatFile ,
SessionStatFile , as well as the path names in the
[Volumes] section. Additionally, you may also want to use different values
for Title , UID and GID on the slave.
When running master and slave on different systems, you
may need to adjust [db-access] .
(continue with the steps in section C of this checklist)
initial steps specific to slave re-sync
Stop the dbrepl process on the master system, if running
$ fuser -u /opt/eloquence/8.0/bin/dbrepl
/opt/eloquence/8.0/bin/dbrepl: 7619e(eloqdb)
$ kill 7619
Shutdown the slave database server, if running
$ /etc/init.d/eloq8 stop SLAVE_ID
Note: the above example is for Linux, on HP-UX use
/sbin/init.d/eloq8.
(continue with the steps in section C of this checklist)
common steps for both, setup and re-sync
Start online backup mode on the master server
$ dbctl -u dba backup start
Note: this example uses online backup mode, which is less intrusive
than using offline backup
Copy the DATA volumes to backup media, temporary location or
directly to the slave system
$ cd /example/master/db ; tar cvf /dev/tape data*.vol
Note: the above tar just serves as an example, your environment
might use a different method
Stop online backup mode on the master server
$ dbctl -u dba backup stop
Restore the master data volumes on the slave system, unless
copied directly during step C-2
$ cd /example/slave/db ; tar xvf /dev/tape
Note: the above tar just serves as an example, your environment
might use a different method
Create a fresh LOG volume for the slave server (unless
already in place)
$ dbvolextend -c /example/slave/db/eloqdb.cfg -v -R
Start the slave server (and check startup messages in its
LogFile)
$ /etc/init.d/eloq8 start SLAVE_ID
Note: the above example is for Linux, on HP-UX use
/sbin/init.d/eloq8.
Start the dbrepl process on master server to begin catch up
and replication
$ dbrepl -c /example/master/db/eloqdb.cfg -v SLAVE_HOST:SLAVE_PORT
Note: for running the above command in background, you might use nohup, for example:
$ nohup dbrepl ... >>/example/master/logs/repl.log 2>&1 &
Optionally monitor replication status on master and slave
with dbctl
$ dbctl -h MASTER_HOST -s MASTER_PORT replication status
$ dbctl -h SLAVE_HOST -s SLAVE_PORT replication status
Please note that the above checklist focuses on setup or re-sync of the slave
server and thus does not include any housekeeping procedures for the master and slave
servers such as deleting forward logs on the master and or slave systems, once they
are no longer needed by dbrepl, have been stored as part of regular backups, and have
optionally been processed for database auditing.
|
|