Evicting files or objects data
Complete the following steps to evict data from files or objects:
-
To create an AFM to cloud object storage relation, issue the
following command:
mmafmcosconfig fs1 afmtocos1 --endpoint http://IP --uid 0 --gid 0 --new-bucket afmtocos1 --mode sw --object-fs --cleanup afmobjfs=fs1 fileset=afmtocos1 bucket=afmtocos1 newbucket=afmtocos1 objectfs=yes dir= policy= tmpdir= tmpfile= cleanup=yes mode=sw xattr=no ssl=no acls=no gcs=no vhb= bucketName=afmtocos1 serverName=IP Linkpath=/gpfs/fs1/afmtocos1 target=http://IP/afmtocos1 endpoint=--endpoint http://IP XOPT= -p afmObjectSubdir=yes -p afmParallelWriteChunkSize=0 -p afmParallelReadChunkSize=0 rc=0 mmdsh -vN c7f2n05 /usr/lpp/mmfs/bin/mmafmtransfer -v -t -a key -s key -b afmtocos1 -e http://IP bcreate - Create objects or files in the
afmtocos1fileset.for a in `seq 10`; do dd if=/dev/urandom of=/gpfs/fs1/afmtocos1/object$a count=8 bs=256K & done- To get the contents of the fileset, issue the following
command:
A sample output is as follows:ls -lsh /gpfs/fs1/afmtocos1/total 20M 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object1 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object10 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object2 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object3 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object4 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object5 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object6 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object7 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object8 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object9Note: The space consumed is 20M, that is, each object is consuming 2 Mb. - To check the disk usage, issue the following
command:
A sample output is as follows:du -sh /gpfs/fs1/afmtocos1/20M /gpfs/fs1/afmtocos1/
- To get the contents of the fileset, issue the following
command:
- Evict an evict file that contains a list of files for the data eviction.
- To get the list of files an evict file, issue the following
command:
A sample output is as follows:cat /root/evictfile/gpfs/fs1/afmtocos1/object1 /gpfs/fs1/afmtocos1/object2 /gpfs/fs1/afmtocos1/object3 /gpfs/fs1/afmtocos1/object4 /gpfs/fs1/afmtocos1/object5 - To evict files or objects, issue the following
command:
mmafmcosctl fs1 afmtocos1 /gpfs/fs1/afmtocos1/ evict --object-list /root/evictfile
- To get the list of files an evict file, issue the following
command:
- To check evicted data blocks and the disk size, issue the following
command:
A sample output is as follows:ls -lsh /gpfs/fs1/afmtocos1/
The ls command shows that evicted data blocks and the disk size is 0 fortotal 10M 0 -rw-r--r-- 1 root root 2.0M Sep 10 2020 object1 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object10 0 -rw-r--r-- 1 root root 2.0M Sep 10 2020 object2 0 -rw-r--r-- 1 root root 2.0M Sep 10 2020 object3 0 -rw-r--r-- 1 root root 2.0M Sep 10 2020 object4 0 -rw-r--r-- 1 root root 2.0M Sep 10 2020 object5 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object6 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object7 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object8 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object9object1throughobject5. - To check the disk usage, issue the following
command:
A sample output is as follows:du -sh /gpfs/fs1/afmtocos1/
Now the disk space is 10M because other 10M is evicted from five objects.10M /gpfs/fs1/afmtocos1/ - Bring back objects and files from a cloud object storage.
- Issue to the following
command:
cd /gpfs/fs1/afmtocos1/ - To get the contents of the fileset, issue the following
command:
cat object1 object2 object3 object4 object5 > /dev/null - To check the cache state, issue the following
command:
A sample output is as follows:mmafmctl fs1 getstateFileset Name Fileset Target Cache State Gateway Node Queue Length Queue numExec ------------ -------------------------------- ------------- ------------ ------------ ------------- afmtocos1 http://IP:80/afmtocos1 Active c7f2n05 0 36 - To get the contents of the fileset, issue the following
command:
A sample output is as follows:ls -lsh /gpfs/fs1/afmtocos1/total 20M 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object1 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object10 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object2 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object3 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object4 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object5 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object6 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object7 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object8 2.0M -rw-r--r-- 1 root root 2.0M Sep 10 2020 object9 - To check the disk usage, issue the following
command:
A sample output is as follows:du -sh /gpfs/fs1/afmtocos1/20M /gpfs/fs1/afmtocos1/
- Issue to the following
command: