Setting up IBM Cloud block storage for IBM® Db2 Warehouse

If you want to deploy Db2® Warehouse in an MPP environment, you must set up a POSIX-compliant cluster file system such as IBM Spectrum Scale and a storage device for that file system. You can use IBM Cloud block storage, which is iSCSI based, to set up the storage device.

Before you begin

Authorize the server to use an IBM Cloud storage device.

About this task

The following instructions apply to CentOS and RedHat operating systems. Instructions for other operating systems might be different.

Procedure

  1. Issue the following command:
    
    yum update -y
    
  2. Install the necessary packages by issuing the following command:
    
    yum -y install iscsi-initiator-utils device-mapper-multipath.x86_64
  3. Issue the following command:
    mkdir -p /mnt/clusterfs
  4. Set up the multipath.conf file.
    An example follows:
    
    # setup multipath.conf 
    cat <<EOF >> /etc/multipath.conf 
    defaults { 
    user_friendly_names no 
    max_fds max
    flush_on_last_del yes 
    queue_without_daemon no 
    dev_loss_tmo infinity
    fast_io_fail_tmo 5 
    } 
    blacklist { 
    wwid "SAdaptec*" 
    devnode "^hd[a-z]" 
    devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" 
    devnode "^cciss.*" 
    } 
    devices { 
    device { 
    vendor "NETAPP" 
    product "LUN" 
    path_grouping_policy group_by_prio 
    features "3 queue_if_no_path pg_init_retries 50" 
    prio "alua" 
    path_checker tur 
    failback immediate
    path_selector "round-robin 0" 
    hardware_handler "1 alua" 
    rr_weight uniform 
    rr_min_io 128 
    getuid_callout "/lib/udev/scsi_id -g -u -d /dev/%n"
    }
    
    EOF
  5. Start the multipathd daemon by issuing the following commands:
    
    modprobe dm-multipath 
    service multipathd start 
    chkconfig multipathd on
  6. Verify the multipath configuration by issuing the following command:
    multipath -l
  7. On each node, configure iSCSI by specifying the following commands and information:
    
    cp /etc/iscsi/iscsid.conf /etc/iscsi/iscsid.conf.backup cat <<EOF >> /etc/iscsi/iscsid.conf
    node.session.auth.authmethod = CHAP 
    node.session.auth.username = iSCSI_username
    node.session.auth.password = iSCSI_password
    discovery.sendtargets.auth.authmethod = CHAP 
    discovery.sendtargets.auth.username = iSCSI_username 
    discovery.sendtargets.auth.password = iSCSI_password
    EOF
    
    cp /etc/iscsi/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi.backup 
    rm -f /etc/iscsi/initiatorname.iscsi 
    cat <<EOF >> /etc/iscsi/initiatorname.iscsi 
    InitiatorName=IQN
    EOF
  8. Discover the iSCSI target by issuing the following command:
    
    iscsiadm -m discovery -t sendtargets -p target_IP_address
  9. Automatically log in to the iSCSI:
    iscsiadm -m node -L automatic
  10. List the iSCSIs that are visible to the system by issuing the following commands:
    
    iscsiadm -m session 
    multipath -l
  11. Check whether the iSCSI storage is visible by issuing the following command:
    fdisk -l | grep /dev/mapper/3
    The output of the command is a list of strings that represent that iSCSIs, in the form dev/mapper/string. You can use this string when you set up IBM Spectrum Scale, which requires the iSCSI device storage to be available but not mounted.
  12. If you plan to deploy Db2 Warehouse in an SMP environment or want to load data from the iSCSI storage, issue the following command. Specify a string value from the output of the previous step. If you plan to load data from the mounted file system, use /mnt/clusterfs/scratch as the mount point. Otherwise, use /mnt/clusterfs.
    mount /dev/mapper/string mount_point