Uploading objects

You can upload objects that are in the LU-mode.

Complete the following steps to upload an object:
  1. Create LU-mode objects on a cloud object storage.
    mmafmcosconfig fs1 localupdates --endpoint  http://c1f1u11n07    
     --uid 0 --gid 0  --new-bucket localupdates  --mode lu --cleanup 

    A sample output is as follows:

    Created 3 objects on COS: 
    Name      : obj1
    Date      : 2020-10-23 06:07:29 EDT 
    Size      : 2.2 KiB 
    ETag      : 6fdfdb7af5eb5ad7f610014985951941 
    Type      : file 
    Metadata  :
      Content-Type: application/x-sh 
    
    Name      : obj2
    Date      : 2020-10-23 06:07:31 EDT 
    Size      : 2.2 KiB 
    ETag      : 6fdfdb7af5eb5ad7f610014985951941 
    Type      : file 
    Metadata  :
      Content-Type: application/x-sh 
    
    Name      : obj3
    Date      : 2020-10-23 06:07:33 EDT 
    Size      : 2.2 KiB 
    ETag      : 6fdfdb7af5eb5ad7f610014985951941 
    Type      : file 
    Metadata  :
      Content-Type: application/x-sh 
  2. Download the created objects.
    mmafmcosctl fs1 localupdates /gpfs/fs1/localupdates/ download  --all

    A sample output is as follows:

    Queued         Failed       AlreadyCached          TotalData
                                                    (approx in Bytes)
              3              0                  0                6816 
    Object Download successfully queued at the gateway.
  3. Check the fileset status.
    mmafmctl fs1 getstate

    A sample output is as follows:

    Fileset Name  Fileset Target                     Cache State   Gateway Node Queue Length Queue numExec 
    ------------  --------------                     ------------- ------------ ------------  ------------- 
    localupdates  http://c1f1u11n07:80/localupdates  Active         c7f2n05      0            10           
    
  4. Write data into objects, which will not be synchronized to a cloud object storage.
    echo 11111 >> /gpfs/fs1/localupdates/obj1
    echo 11111 >> /gpfs/fs1/localupdates/obj2
  5. Check the fileset status.
    mmafmctl fs1 getstate

    A sample output is as follows:

    Fileset Name  Fileset Target                     Cache State   Gateway Node Queue Length Queue numExec 
    ------------  --------------                     ------------- ------------ ------------  ------------- 
    localupdates  http://c1f1u11n07:80/localupdates  Active         c7f2n05      0            10           
    

    These changes are local and are not pushed to the cloud object storage because it is in the LU-mode.

  6. Start of changeTo enable AFM to wait until all upload operations for each objects are queued and completed, issue the following command:
    mmafmcosctl  fs1 mu1 /ibm/fs1/mu1/ upload --all --wait
    A sample output is as follows:
    mmafmcosctl  fs1 mu1 /ibm/fs1/mu1/ upload --all --wait
         Queued         Failed                TotalData
                                      (approx in Bytes)
            10               0                104857600
    Object Upload successfully queued at the gateway.
    mmafmcosctl : Waiting for the complete data to upload.
    Fileset Name    Pending         Failed          Total           Total data(Bytes)    Throughput(KB/s)
    ------------    ------------    ------------    ------------    -------------------- ---------------
    mu1               0               0              10            104857600             15905
    
    mmafmcosctl: upload completed successfully for queued objects.

    The –-wait parameter with the mmafmcosctl upload command enables AFM to wait until all upload operations for each objects are queued and completed. AFM marks the operation complete, and then the command ]completes and returns to prompt. During the upload, some objects might take longer. When this parameter is set, commands only complete until all objects are uploaded to the cloud object storage S3 bucket. If you do not specify this option, the command returns immediately after objects are queued, and the upload operation continues in the background.

    End of change
  7. To synchronize objects to a cloud object storage, upload the objects.
    mmafmcosctl fs1 localupdates /gpfs/fs1/localupdates upload --all

    Sample outputs are as follows:

    Queued         Failed                TotalData
                                      (approx in Bytes)
             3               0                     6828 
    Object Upload successfully queued at the gateway.
    Objects are synced to COS:
    Name      : obj1
    Date      : 2020-10-23 06:15:01 EDT 
    Size      : 2.2 KiB 
    ETag      : 5a210361a71c03cb29565c4c2ae613cb 
    Type      : file 
    Metadata  :
      Content-Type: application/octet-stream 
    
    Name      : obj2
    Date      : 2020-10-23 06:15:01 EDT 
    Size      : 2.2 KiB 
    ETag      : 5a210361a71c03cb29565c4c2ae613cb 
    Type      : file 
    Metadata  :
      Content-Type: application/octet-stream