Installing the secondary instance of TSLM on Linux

The following example shows the procedure for installing the secondary instance of TSLM on a Linux® system.

  1. Create the section for the secondary instance in /etc/tslm.cfg as TSLM_1 by using manageTSLMClone.pl.
    Syntax:
    manageTSLMClone.pl -C -T target -s srcdir -d destdir -u user -g group -h homedir -a dbadmindir -l sqllibpath -i db2user -j db2group
    -C
    Create a section in the TSLM configuration file.
    target
    The target (destination) instance name. For example, TSLM_1.
    srcdir
    The source directory.
    destdir
    The destination directory.
    user
    The username of the new instance.
    group
    The groupname of the new instance.
    homedir
    The home directory of the new instance.
    dbadmindir
    The admin directory of the Db2® instance.
    sqllipath
    The SQPlus® directory of the Db2 instance.
    db2user
    The user name of the Db2 instance.
    db2group
    The db2 group of the Db2 instance.
    Example:
    [root@ermm3 tslm1]# /opt/IBM/tslm1/install/manageTSLMClone.pl -C -T "TSLM_1" 
    -s "/opt/IBM/tslm1" -d "/opt/IBM/tslm2" -u tslm2 -g tslm2 -h "/home/tslm2" 
    -a "/home/db2inst2" -l "/home/db2inst2/sqllib/bin" -i db2inst2 -j db2grp2
  2. Check /etc/tslm.cfg.
    [root@ermm3 tslm1]# /opt/IBM/tslm1/install/manageTSLMClone.pl -q
    [TSLM_0]
            TSLM_BASEDIR=/opt/IBM/tslm1
            TSLM_USER=tslm1
            TSLM_GROUP=tslm1
            TSLM_NO=TSLM_0
            TSLM_USERDIR=/home/tslm1
            DB_ADM_DIR=/home/db2inst1
            SQLLIB_PATH=/home/db2inst1/sqllib/bin
            DB_ADM_NAME=db2inst1
            DB_ADM_GRP_NAME=db2grp1
    [TSLM_1]
            TSLM_BASEDIR=/opt/IBM/tslm2
            TSLM_USER=tslm2
            TSLM_GROUP=tslm2
            TSLM_NO=TSLM_1
            TSLM_USERDIR=/home/tslm2
            DB_ADM_DIR=/home/db2inst2
            SQLLIB_PATH=/home/db2inst2/sqllib/bin
            DB_ADM_NAME=db2inst2
            DB_ADM_GRP_NAME=db2grp2
            
    [root@ermm3 tslm1]# cat /etc/tslm.cfg
    [TSLM_0]
    TSLM_BASEDIR=/opt/IBM/tslm1
    TSLM_USER=tslm1
    TSLM_GROUP=tslm1
    TSLM_NO=TSLM_0
    TSLM_USERDIR=/home/tslm1
    DB_ADM_DIR=/home/db2inst1
    SQLLIB_PATH=/home/db2inst1/sqllib/bin
    DB_ADM_NAME=db2inst1
    DB_ADM_GRP_NAME=db2grp1
    [TSLM_1]
    TSLM_BASEDIR=/opt/IBM/tslm2
    TSLM_USER=tslm2
    TSLM_GROUP=tslm2
    TSLM_NO=TSLM_1
    TSLM_USERDIR=/home/tslm2
    DB_ADM_DIR=/home/db2inst2
    SQLLIB_PATH=/home/db2inst2/sqllib/bin
    DB_ADM_NAME=db2inst2
    DB_ADM_GRP_NAME=db2grp2
    
  3. Create the clone of TSLM_0 for TSLM_1 (the secondary instance).
    Syntax:
    manageTSLMClone.pl -c -T target
    -c
    Create an instance.
    target
    The target (destination) instance name. For example, TSLM_1.
    [root@ermm3 tslm1]# /opt/IBM/tslm1/install/manageTSLMClone.pl -c -T TSLM_1
    # tslm-system package
      Adding group tslm2...  done.
    Reading /etc/tslm.cfg...
    IBM Tape System Library Manager
    Licensed Materials - Property of IBM
    (C) Copyright IBM Corp. 2004, 2018 All Rights Reserved
    Reading /etc/tslm.cfg...
    IBM Tape System Library Manager
    Licensed Materials - Property of IBM
    (C) Copyright IBM Corp. 2004, 2018 All Rights Reserved
    Creating /home/tslm2/tslmprofile...
    Creating /home/db2inst2/tslmprofile...
    # tslm-mm package
    # tslm-lm package
    Giving user "tslm2" access to SCS log directory "/var/log"...
    The group of /var/log is "root". Adding user "tslm2" to group "root"...
    Done!
    Giving group "root" access permissions to "/var/log"...
    Done!
    # tslm-hdm package
    detected RHEL6
    Creating GHDM_tslm2.conf in /etc/init...initctl: Job is already running: GHDM_tslm2
    done
    # tslm-elm package
    # tslm-3494 package
    the file[/opt/IBM/tslm1/codelvel/3494.lvl] doesn't exist. tslm-3494 is not installed.
    # tslm-cli package
    # tslm-libbal package
    the file[/opt/IBM/tslm1/codelvel/libbal.lvl] doesn't exist. tslm-libbal is not installed.
    # tslm-pwgen package
    Done
    
  4. Finish all of configurations for the secondary TSLM server.
    1. Check /home/tslm2/.bashrc and /home/db2inst2/.bashrc.
      [tslm2@ermm3 ~]$ cat /home/tslm2/.bashrc
      # .bashrc
      
      # Source global definitions
      if [ -f /etc/bashrc ]; then
              . /etc/bashrc
      fi
      
      # User specific aliases and functions
      
      # TSLM binaries search path
      PATH=/opt/IBM/tslm2/bin:$PATH
      
      # TSLM db2 instance access
      if [ -f /home/db2inst2/sqllib/db2profile ]; then
         . /home/db2inst2/sqllib/db2profile
      fi
      
      # TSLM environments
      if [ -f /home/tslm2/tslmprofile ]; then
          while read line
          do
              export $line
          done < /home/tslm2/tslmprofile
      fi
      
      [root@ermm3 home]# cat /home/db2inst2/.bashrc
      # .bashrc
      
      # Source global definitions
      if [ -f /etc/bashrc ]; then
              . /etc/bashrc
      fi
      
      # User specific aliases and functions
      
      # The following three lines have been added by UDB DB2.
      if [ -f /home/db2inst2/sqllib/db2profile ]; then
          . /home/db2inst2/sqllib/db2profile
      fi
      
      
      # TSLM environments
      if [ -f /home/db2inst2/tslmprofile ]; then
          while read line
          do
              export $line
          done < /home/db2inst2/tslmprofile
      fi
      
    2. Check /home/tslm2/tslmprofile and /home/db2inst2/tslmprofile.
      [tslm2@ermm3 ~]$ cat /home/tslm2/tslmprofile
      TSLM_BASEDIR=/opt/IBM/tslm2
      TSLM_USER=tslm2
      TSLM_GROUP=tslm2
      TSLM_NO=TSLM_1
      TSLM_USERDIR=/home/tslm2
      DB_ADM_DIR=/home/db2inst2
      SQLLIB_PATH=/home/db2inst2/sqllib/bin
      DB_ADM_NAME=db2inst2
      DB_ADM_GRP_NAME=db2grp2
      
      [root@ermm3 home]# cat /home/db2inst2/tslmprofile
      TSLM_BASEDIR=/opt/IBM/tslm2
      TSLM_USER=tslm2
      TSLM_GROUP=tslm2
      TSLM_NO=TSLM_1
      TSLM_USERDIR=/home/tslm2
      DB_ADM_DIR=/home/db2inst2
      SQLLIB_PATH=/home/db2inst2/sqllib/bin
      DB_ADM_NAME=db2inst2
      DB_ADM_GRP_NAME=db2grp2
      
    3. Modify /opt/IBM/tslm2/conf/mm.xml.
      mm.xml:    <ServerPort type="integer">6741</ServerPort>
      mm.xml:    <TraceFile type="string">/opt/IBM/tslm2/log/ermmtrace</TraceFile>
      
      Note: The server port must set a different value than the value of the primary.
    4. Modify /opt/IBM/tslm2/conf/lm-lmXXXX.xml.
      lm-lmLTO.xml:   <TraceFile>/opt/IBM/tslm2/log/lm-lmLTO.log</TraceFile>
      lm-lmLTO.xml:   <PidFile>/opt/IBM/tslm2/run/lm-lmLTO.pid</PidFile>
      lm-lmLTO.xml:   <Port>6741</Port>
      
    5. Modify /opt/IBM/tslm2/conf/genhdm.cfg.
      genhdm.cfg:   port = 6741
      genhdm.cfg:   
      logfile = /opt/IBM/tslm2/log/ermmGenHDM.log
      
    6. Modify /opt/IBM/tslm2/conf/dbuserexit.conf.
      dbuserexit.conf:TSLMAUDITERRPATH=/opt/IBM/tslm2/ermmdbarchive/;
      dbuserexit.conf:TSLMDBLOGARCHIVE=/opt/IBM/tslm2/ermmdbarchive/logarchive/;
      dbuserexit.conf:TSLMDBBACKUPDIR=/opt/IBM/tslm2/ermmdbarchive/dbbackup/;
      dbuserexit.conf:TSLMDBLOGMIRRORDIR=/opt/IBM/tslm2/ermmdbarchive/logmirror/;
      
    7. Modify /opt/IBM/tslm2/client/tsm/elm.cfg.
      elm.cfg:LogPath = /opt/IBM/tslm2/log
      elm.cfg:port = 6741
      
    8. Prepare ermmcli.conf under /opt/IBM/tslm2/conf for the root user. The ermmcli.conf file is used by ermmCollectLogs.pl.
      [root@ermm3 conf]# cp /opt/IBM/tslm2/conf/ermmcli.conf.smp /opt/IBM/tslm2/conf/ermmcli.conf
      ermmcli.conf:port=6741
      
    9. Prepare .ermmcli.conf under /home/tslm2. Use /ermmcli.conf.smp as the template. Also, modify the value of the port= to connect to the media manager of the secondary instance.
      .ermmcli.conf:port=6741
  5. Installing and configuring the TSLM database in Db2.

    With the installation of the secondary or tertiary instances, the TSLM database must be created in Db2. Install the TSLM database in Db2 by using the preInstallDatabase and installDatabase scripts that are provided with TSLM. Use the following instructions.

    1. Log in with root user rights. Then, run the following script:
      /opt/IBM/tslm2/install/preInstallDatabase -C TSLM_1
      Reading /etc/tslm.cfg...
      IBM Tape System Library Manager
      Licensed Materials - Property of IBM
      (C) Copyright IBM Corp. 2004, 2017 All Rights Reserved
      
      Add user tslm2 to group db2grp2
      Prepare the log archive for the DB2 instance at /home/db2inst2/sqllib/adm
      
    2. Log in with tslm2 user rights.
      [root@ermm3 ~]# su - tslm2
      [tslm2@ermm3 ~]$
      
    3. Install the TSLM database on a local Db2 instance.
      [tslm2@ermm3 ~]$ /opt/IBM/tslm2/install/installDatabase
      TSLM_USER=tslm2
      IBM Tape System Library Manager
      Licensed Materials - Property of IBM
      (C) Copyright IBM Corp. 2004, 2018 All Rights Reserved
      
      Starting database instance ...
      Creating database ermm. This may take a while ...
      Connect to database ermm ...
      Creating buffer pool for database ermm ...
      Restarting database instance ...
      Creating temporary tablespaces ...
      Setting schema for tslm2 ...
      Creating database content ...
      Updating database content ...
      Verifying the system init record ...
      Configuring database ermm ...
      Disconnect from database ermm ...
      Updating APP_CTL_HEAP_SZ parameter ...
      Updating NUM_IOCLEANERS parameter ...
      Updating NUM_IOSERVERS parameter ...
      Updating LOGPRIMARY parameter ...
      Updating LOGSECONDARY parameter ...
      Successfully created TSLM database.
      
      After successful execution of the installDatabase script, the database is ready to use with the media manager.
    4. Create a new library manager configuration file.
      [root@ermm3 conf]# /opt/IBM/tslm2/bin/ermmLmConfig -library LTO -LM lmLTO -type scsi -mmport 6741 -device /dev/IBMchanger1 -serial 0000078A03810402
      IBM Tape System Library Manager
      Licensed Materials - Property of IBM
      (C) Copyright IBM Corp. 2004, 2018 All Rights Reserved
      
      Creating configuration file:
      
      Media Manager IP Address:           127.0.0.1
      Media Manager TCP Port:             6741
      Media Manager server name:          MediaManager
      Media Manager server password:
      Library Client Name:                LTO
      Library Manager Instance:           lmLTO
      Library Manager Authentication:     none
      Library Manager Password:
      Inventory on switching online:      false
      MaxSlots:                           1000
      Config directory:                   /opt/IBM/tslm2/conf
      Config file:                        lm-lmLTO.xml
      PID file:                           /opt/IBM/tslm2/run/lm-lmLTO.pid
      Medium Changer device file:         /dev/IBMchanger1
      Type of SCSI library:               IBM
      Medium Changer serial number:       0000078A03810402
      Number of device access retrys:     60
      Sleep between device access retrys: 5
      Label length of cartridge PCL:      8
      
    5. Start the media manager as user tslm2.
      [root@ermm3 ~]# su - tslm2
      [tslm2@ermm3 ~]$ ermmStart
      IBM Tape System Library Manager
      Licensed Materials - Property of IBM
      (C) Copyright IBM Corp. 2004, 2018 All Rights Reserved
      
      Spawning IBM Tape System Library Manager daemon
      Using log file: /opt/IBM/tslm2/log/ermmstart.log. Please check this file in case of problems.
      
      [tslm2@ermm3 ~]$ ermmtool
      IBM Tape System Library Manager
      Licensed Materials - Property of IBM
      (C) Copyright IBM Corp. 2004, 2013 All Rights Reserved
          host: localhost
          port: 6741
        client: ERMMSystem
      instance: ERMMAdmin
      
    6. Create the library object and the library manager object.
      ermmtool> addlib LTO
      ermmtool> addlm lmLTO LTO
      ermmtool> chlib -lm lmLTO LTO
      
    7. Start the library manager.
      tslm2@ermm3 ~]$ ermmLmStart
      /opt/IBM/tslm2
      IBM Tape System Library Manager
      Licensed Materials - Property of IBM
      (C) Copyright IBM Corp. 2004, 2018 All Rights Reserved
      
      US Government Users Restricted Rights - Use, duplication or
      disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
      Added lm-lmLTO.xml into proc list.
      Update proccess list: /opt/IBM/tslm2/run/ermmLmProc.lst
      Checking core files in /opt/IBM/tslm2/bin/../run/lm-lmLTO...
      Checking log files in /opt/IBM/tslm2/bin/../log...
      No core dump file to process.
      Starting background daemon.
      ermmLmStart daemon is started.
      [tslm2@ermm3 ~]$ ps -ef | grep Library
      tslm2    20212     1  0 10:44 ?        00:00:00 /opt/IBM/tslm2/bin/LibraryManager -d -nocopyright -s /opt/IBM/tslm2/conf/lm-lmLTO.xml
      tslm2    20224 19847  0 10:45 pts/1    00:00:00 grep Library
      tslm1    22157     1  0 Apr24 ?        00:00:00 /opt/IBM/tslm1/bin/LibraryManager -d -nocopyright -s /opt/IBM/tslm1/conf/lm-lm3592-3.xml