Overview
This article explains how to allocate an extra dedicated disk volume for storing ScaleArc log files while only copying the minimal current log file set and linking to existing historical data.
The process involves assigning an additional disk to the ScaleArc system that can be used for storing more logs using LVM (Logical Volume Manager).
Information
The amount of existing historical log data can be substantial on ScaleArc systems that have been in use for a period of time. This in turn requires a considerable amount of time to migrate existing historical data to a new logging disk volume.
The procedure below provides a methodology to minimize the total amount of maintenance time required to perform the ScaleArc logging disk upgrade by leveraging Linux symbolic links to historical data, rather than actually copying them to the new logging disk volume.
This approach requires that the original logging disk volume remain attached to the ScaleArc system after the addition of the new logging disk volume (at least until such time as the historical data stored on the original logging disk volume is no longer needed).
Follow the below steps to achieve this:
Step 1: Verify that a new disk has been allocated onto the machine
$ (logging in to ScaleArc via idb user)
$ sudo su -
# fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b8b0b
Device Boot Start End Blocks Id System
/dev/sda1 * 1 33 262144 83 Linux
Disk /dev/sdb: 500.1 GB, 500107862016 bytes --> a new disk (/dev/sdb) has been allocated
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x02ab2dd2
Step 2: Create a physical volume over the new disk
# pvcreate /dev/sdb
--> please replace "/dev/sdb" with your own disk drive path
Step 3: Create a Volume Group on the physical volume
# vgcreate vg_data /dev/sdb
--> Creates a volume group namely vg_data on /dev/sdb
Step 4: Create a Logical Volume
# lvcreate -l 100%FREE -n lv_data vg_data
--> Create a formattable logical volume namely lv_data with 100% free space of vg_data
Step 5: Format the logical volume with filesystem EXT4
# mkfs.ext4 /dev/vg_data/lv_data
--> Format the logical volume with filesystem ext4
Step 6: Stop ScaleArc
# /etc/init.d/analytics stop
# /etc/init.d/idb_watchdog stop
# /etc/init.d/idblb stop
Step 7: Mount an LVM drive as a temporary directory
# mkdir /tempdata
# mount /dev/vg_data/lv_data /tempdata
Step 8: Copy minimal existing logs onto the new directory
NOTE: Replace <CURRENT_DATE> below with the current day date in the format of YYYYMMDD. For example 20200915
# mkdir /tempdata/logs/
# mkdir /tempdata/cache
# mkdir /tempdata/logs/services
# mkdir /tempdata/logs/currentlogs
# mkdir /tempdata/logs/<CURRENT_DATE> [Example: # mkdir /tempdata/logs/20200915 ]
# cp /data/logs/services/* /tempdata/logs/services
# cp -r /data/logs/currentlogs/* /tempdata/logs/currentlogs
# cp -r /data/logs/<CURRENT_DATE>/* /tempdata/logs/<CURRENT_DATE>/
# cp -r /data/cache/* /tempdata/cache/
# cp /data/logs/* /tempdata/logs
Step 9: Unmount the temporary directory
# umount /tempdata
Step 10: Rename old DATA directory
# mv /data /data.old
Step 11: Update the FSTAB
# vi /etc/fstab
:
:
/dev/vg_data/lv_data /data ext4 defaults 0 0
--> Add this line at the end of /etc/fstab
Step 12: Mount the LVM using the updated FSTAB
# mkdir /data
# mount -a
Step 13: Link the historical data directories to the new logging volume
# for i in `find "/data.old/logs/" -maxdepth 1 -type d -name "2*" -printf "%f\n"`; do if [ ! -d /data/logs/$i ]; then ln -s /data.old/logs/$i /data/logs/$i; fi; done
Step 14: Restart the ScaleArc appliance
# init 6
Comments
0 comments
Please sign in to leave a comment.