User Tools

Site Tools


tsm:tsm_jbb

Journal Based Backup

http://www-01.ibm.com/support/docview.wss?uid=swg21681523

Journal Based Backup is a daemon which create a DB file to store all changes in a directory, to prevent from scanning all subdirectories to do a backup. It's currently supported on AIX, Windows, and Linux (min TSM client 6.3)

To use Journal based backup on Linux, or AIX, you have to install filepath and jbb packages:

CFS-CLU01-H:/media/nss/DATA/tsm # rpm -qa | grep TIV
TIVsm-filepath-6.3.0-0
TIVsm-BA-6.3.0-0
TIVsm-API64-6.3.0-0
TIVsm-msg.FR_FR-6.3.0-0
TIVsm-JBB-6.3.0-0

Journal Based Backup module must match de kernel version :

CFS-CLU01-R:/opt/filepath # ls -l
total 480
-rwx------ 1 root root    998 Nov 18 09:07 filepath
-rw------- 1 root root 481997 Nov 18 09:07 filepath.ko
CFS-CLU01-R:/opt/filepath # modinfo filepath.ko
filename:       filepath.ko
license:        GPL
srcversion:     A3571F12B3F2003E63EA799
depends:
vermagic:       2.6.16.60-0.83.2-smp SMP gcc-4.1
CFS-CLU01-R:/opt/filepath # uname -a
Linux CFS-CLU01-R 2.6.16.60-0.83.2-smp #1 SMP Fri Sep 2 13:49:16 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

If the versions do not match, it must be recompiled from sources:

CFS-CLU01-H:~/tsm/jbb_gpl # make
Make Module:filepath Version:6.3.0.0
make -C /lib/modules/2.6.16.60-0.83.2-smp/build M=/root/tsm/jbb_gpl modules
make[1]: Entering directory `/usr/src/linux-2.6.16.60-0.83.2-obj/x86_64/smp'
make -C ../../../linux-2.6.16.60-0.83.2 O=../linux-2.6.16.60-0.83.2-obj/x86_64/smp modules
  CC [M]  /root/tsm/jbb_gpl/audit.o
  CC [M]  /root/tsm/jbb_gpl/error.o
  CC [M]  /root/tsm/jbb_gpl/hook.o
  CC [M]  /root/tsm/jbb_gpl/hash.o
  CC [M]  /root/tsm/jbb_gpl/ir.o
  CC [M]  /root/tsm/jbb_gpl/jbb.o
  CC [M]  /root/tsm/jbb_gpl/log.o
  CC [M]  /root/tsm/jbb_gpl/mem.o
  CC [M]  /root/tsm/jbb_gpl/pf.o
  CC [M]  /root/tsm/jbb_gpl/str.o
  CC [M]  /root/tsm/jbb_gpl/str_supp.o
  CC [M]  /root/tsm/jbb_gpl/trace.o
  CC [M]  /root/tsm/jbb_gpl/watch.o
  CC [M]  /root/tsm/jbb_gpl/xml.o
  LD [M]  /root/tsm/jbb_gpl/filepath.o
  Building modules, stage 2.
  MODPOST
  CC      /root/tsm/jbb_gpl/filepath.mod.o
  LD [M]  /root/tsm/jbb_gpl/filepath.ko
make[1]: Leaving directory `/usr/src/linux-2.6.16.60-0.83.2-obj/x86_64/smp'
TIVsm-filepath-6.3.0-0.x86_64.rpm created

Create a tsmjbbd.ini file (samples avalaible in /opt/tivoli/tsm/client/ba/bin/tsmjbbd.ini.smp)

CFS-CLU01-H:/media/nss/DATA/tsm # cat tsmjbbd.ini

[JournalSettings]
Errorlog=/media/nss/DATA/tsm/myJbberror.log
Journaldir=/media/nss/DATA/tsm/journaldbs


[JournalExcludeList]
;   Note that this list contains the journal database files.                  
*.jdb.jbbdb
*.jdbInc.jbbdb


[JournaledFileSystemSettings]
JournaledFileSystems=/media/nss/DATA
JournalDBSize=0x00000000
NotifyFilter=0x00000117
NotifyBufferSize=0x00400000
DirNotifyBufferSize=0x00200000


; Override stanza for /media/nss/DATA file system
[JournaledFileSystemSettings./media/nss/DATA]
PreserveDBOnExit=1
DeferFsMonStart=1
DeferRetryInterval=120
logFsErrors=0

Journaldir: directory for journal DB PreserveDBOnExit: set it to 1 to prevent to rescan all the directory to populate the DB, else you loose the DB at process restart

Basic start of JBB process:

# /opt/tivoli/tsm/client/ba/bin/tsmjbbd -f /media/nss/DATA/tsm/tsmjbbd.ini

Steps to initilize the journal

  • Fisrt initialize the JBB database, start the jbb daemon
  • the do the first backup with option -nojournal, next backup will be scheduled without this option:
# dsmc  -optfile=/media/nss/DATA/tsm/dsm.opt incr '/media/nss/DATA' -nojournal

Example of start script for linux (sudo is used in case of use Novell ressource else no process is found), client acceptor is started and JBB:

CFS-CLU01-H:/media/nss/DATA/tsm # cat rc.tsm
#!/bin/bash
### BEGIN INIT INFO
# Provides: dsm
# Required-Start: $network $syslog $remote_fs
# Required-Stop: $network $syslog $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Tivoli Storage Manager client acceptor daemon
### END INIT INFO

# Check for existence of Binaries
DSM_DIR=/opt/tivoli/tsm/client/ba/bin
DSMCAD_BIN=$DSM_DIR/dsmcad
DSMC_BIN=$DSM_DIR/dsmc
DSMJBB_BIN=$DSM_DIR/tsmjbbd

# This directory is specific for each ressource
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
export RES_DIR=/media/nss/DATA/tsm
export DSM_CONFIG=$RES_DIR/dsm.opt
export DSMJBB_CONFIG=$RES_DIR/tsmjbbd.ini

test -x $DSMC_BIN || { echo "$DSMC_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }

prog1="dsmcad"
prog2="dsmc sched"
prog3="tsmjbbd"
cmd1="$DSMCAD_BIN -optfile=$DSM_CONFIG"
cmd2="$DSMC_BIN sched -optfile=$DSM_CONFIG"
cmd3="$DSMJBB_BIN  -f $DSMJBB_CONFIG"
OK="OK"
NOK="Not Running"


case "$1" in
start)
  echo -n $"Starting $prog3: "
  echo
  if [ $(sudo /bin/ps -ef | grep $DSMJBB_CONFIG | grep $DSMJBB_BIN | grep -v grep > /dev/null 2>&1; echo $?) -eq 1 ]
  then
    $cmd3 & > /dev/null 2>&1
  fi
  #echo -n $"Starting $prog2: "
  #echo
  #if [ $(sudo /bin/ps -ef | grep $DSM_CONFIG | grep $DSMC_BIN | grep -v $prog1 | grep -v grep > /dev/null 2>&1; echo $?) -eq 1 ]
  #then
  #  $cmd2 & > /dev/null 2>&1
  #fi
  echo -n $"Starting $prog1: "
  echo
  if [ $(sudo /bin/ps -ef | grep $DSM_CONFIG | grep $DSMCAD_BIN | grep -v grep > /dev/null 2>&1; echo $?) -eq 1 ] 
  then
    $cmd1 > /dev/null 2>&1
  fi
  ;;
stop)
  echo -n $"Stopping $prog1: "
  echo
  #echo -n $"Stopping $prog2: "
  #echo
  echo -n $"Stopping $prog3: "
  echo

  for pid_dsm in $(sudo /bin/ps -ef | egrep "$DSMJBB_CONFIG|$DSM_CONFIG" | grep -v grep | awk '{print $2}')
  do
    kill $pid_dsm
  done
  ;;
restart)
  $0 stop
  sleep 2
  $0 start
  ;;
status)
  echo -n "Checking for $prog1"
  if [ $(ps -ef | grep $DSM_CONFIG | grep $DSMCAD_BIN | grep -v grep > /dev/null 2>&1; echo $?) -eq 0 ] 
  then
    echo "          ${OK}"
  else
    echo "          ${NOK}"
  fi
  #echo -n "Checking for DSMC"
  #if [ $(ps -ef | grep $DSM_CONFIG | grep $DSMC_BIN | grep -v $prog1 | grep -v grep > /dev/null 2>&1; echo $?) -eq 0 ]
  #then
  #  echo "          ${OK}"
  #else
  #  echo "          ${NOK}"
  #fi
  echo -n "Checking for DSMjbb (journal)"
  if [ $(ps -ef | grep $DSMJBB_CONFIG | grep $DSMJBB_BIN | grep -v grep > /dev/null 2>&1; echo $?) -eq 0 ]
  then
    echo "          ${OK}"
  else
    echo "          ${NOK}"
  fi
  ;;
*)
  echo "Usage: $0 {start|stop|restart|status}"
  exit 1
  ;;
esac

Samples configuration files:

- dsm.opt

CFS-CLU01-H:/media/nss/DATA/tsm # cat dsm.opt
************************************************************************
* Tivoli Storage Manager                                               *
*                                                                      *
* Sample Client User Options file for AIX and SunOS (dsm.opt.smp)      *
************************************************************************

*  This file contains an option you can use to specify the TSM
*  server to contact if more than one is defined in your client
*  system options file (dsm.sys).  Copy dsm.opt.smp to dsm.opt.
*  If you enter a server name for the option below, remove the
*  leading asterisk (*).

************************************************************************

SErvername       tsmh_bldata01
* SErvername       tsmr * set name to tsmh or tsmr

Subdir  yes

*traceflag service
*traceflag verbinfo
*tracefile /tmp/tsm.trc

DOMAIN /media/nss/DATA

quiet

- dsm.sys

CFS-CLU01-H:/opt/tivoli/tsm/client/ba/bin # cat dsm.sys
************************************************************************
* Tivoli Storage Manager                                               *
*                                                                      *
* Sample Client System Options file for AIX and SunOS (dsm.sys.smp)    *
************************************************************************

*  This file contains the minimum options required to get started
*  using TSM.  Copy dsm.sys.smp to dsm.sys.  In the dsm.sys file,
*  enter the appropriate values for each option listed below and
*  remove the leading asterisk (*) for each one.

*  If your client node communicates with multiple TSM servers, be
*  sure to add a stanza, beginning with the SERVERNAME option, for
*  each additional server.

************************************************************************

SErvername              tsmh_local
COMMMethod              TCPip
TCPServeraddress        tsmh.bl.lu
nodename                CFS-CLU01-H
Compression             no
TCPPort                 1500
httpport                1581
WebPorts                1582 1583
MANAGEDServices         webclient schedule
Schedmode               prompted
Errorlogname            /opt/tivoli/tsm/client/ba/bin/dsmerror.log
Errorlogret             7
SChedlogname            /opt/tivoli/tsm/client/ba/bin/dsmsched.log
Schedlogret             7
INCLexcl                /opt/tivoli/tsm/client/ba/bin/inclexcl.lst
PasswordAccess          generate

SErvername              tsmr_local
COMMMethod              TCPip
TCPServeraddress        tsmr.bl.lu
nodename                CFS-CLU01-R
Compression             no
TCPPort                 1600
httpport                1681
WebPorts                1682 1683
MANAGEDServices         webclient schedule
Schedmode               prompted
Errorlogname            /usr/tivoli/tsm/client/ba/bin/dsmerror.log
Errorlogret             7
SChedlogname            /usr/tivoli/tsm/client/ba/bin/dsmsched.log
Schedlogret             7
INCLexcl                /usr/tivoli/tsm/client/ba/bin/inclexcl.lst
PasswordAccess          generate

*
* Entry for Cluster Resources
*

* Entry for the Backup-Archive Cluster Resources (BLDATA01)

SErvername              tsmh_bldata01
COMMMethod              TCPip
TCPServeraddress        tsmh.bl.lu
TCPPort                 1500
* ClusterNode           Yes
Nodename                bldata01
*TCPClientAddress       172.19.28.203
TCPClientPort           1701
httpport                1781
WebPorts                1782 1783
MANAGEDServices         webclient schedule
Compression             no
Schedmode               prompted
SChedlogname            /media/nss/DATA/tsm/dsmsched.log
Schedlogret             7
Errorlogname            /media/nss/DATA/tsm/dsmerror.log
Errorlogret             7
INCLexcl                /media/nss/DATA/tsm/inclexcl.lst
PasswordAccess          generate
PasswordDir             /media/nss/DATA/tsm
Specific Informations for cluster Novell OES

Start/Stop scripts of the ressource (Please don't edit, update with Novell interface):

CFS-CLU01-H:/var/opt/novell/ncs # ll
-rwxr-xr-x 1 root root   621 Nov  9 11:46 BLDATA_SERVER.load
-rwxr-xr-x 1 root root   221 Nov  9 11:46 BLDATA_SERVER.monitor
-rwxr-xr-x 1 root root   490 Nov  9 11:46 BLDATA_SERVER.unload

Logs for Start/stop scripts for Novell resource:

CFS-CLU01-H:/var/opt/novell/log/ncs # ll
-rw-r--r-- 1 root root 354246 Nov  9 11:12 BLDATA_SERVER.load.out
-rw-r--r-- 1 root root 209144 Nov  9 10:54 BLDATA_SERVER.unload.out
tsm/tsm_jbb.txt · Last modified: 2021/01/01 21:25 (external edit)