This topic describes how to configure shares in the local gateway console.

Prerequisites

  1. You have registered an Alibaba Cloud account and passed the real-name verification. For more information, see Sign up with Alibaba Cloud.
    Note We recommend that you log on to the CSG console as a RAM user. For more information, see Use RAM to implement account-based access control.
  2. You have activated the CSG service.

    When you log on to the for the first time, you can follow the instructions on the page to activate the CSG service.

  3. You have deployed the local file gateway console. For more information, see Deploy the local file gateway console.
  4. You have created an Object Storage Service (OSS) bucket. For more information, see Create a bucket.
    Note
    • File gateways support OSS buckets of Standard, Infrequent Access (IA), and Archive storage classes.
    • If you do not enable a share to support the Archive storage class when you create the share, to read archives from the buckets, you must restore the archives from these buckets.
  5. You have added a disk on the deployment platform. For more information, see Add disks.

Step 1: Create a cache

Each shared directory of Cloud Storage Gateway (CSG) corresponds to a unique cache disk. To create multiple shared directories, you must create multiple cache disks. You can use a cache disk to transmit data in a shared directory to Object Storage Service (OSS) or synchronize data in OSS to a local computer.

  1. Open your browser, and in the address bar, enter https://<IP address of the target file gateway> to connect to the local file gateway console.
  2. In the dialog box that appears, enter the username and password, and click OK.
  3. Go to the Caches page, and click Create.
  4. On the Create Cache dialog box that appears, set the following parameters:
    • Disk: Click Select, and in the dialog box that appears, select an available disk.

      Disks are available only after you add the disks on the deployment platform. For more information, see Add disks.

    • File System: This parameter is optional. You can select this option to reuse the data in the specified cache disk. If you delete a share by mistake, you can recreate the share and reuse data in the cache disk to restore data.
      Note If no file system exists on the cache, after you enable data reuse, you will fail to create the cache.
  5. Click OK.

Step 2: Bind cloud resources

You can create shares that use OSS buckets as backend storage. One bucket corresponds to one share. You can bind a file gateway to multiple cloud resources.
Note By default, the data that you use a client to write to a gateway is uploaded in real time to an OSS bucket bound to the gateway. You can also specify a delay for the upload operation. The maximum delay is 120 seconds.
  1. In the local file gateway console, go to the Cloud Resources page, and click Bind.
  2. In the Bind Cloud Resource dialog box that appears, set the following parameters.
    Parameter Description
    Resource Name Specifies the name of the cloud resource that you want to bind.
    Cross-region Binding
    • Yes: specifies that you can access the bucket that stays in the different region from the specified gateway.
    • No: specifies that you can access only the bucket that stays in the same region as the specified gateway.
    Note The regions of the local file gateway and the OSS bucket must belong to the same time zone.
    Region The region where the target bucket is located.
    Bucket Name The name of the bucket that you want to bind to the gateway.
    Use SSL Specifies whether to access an OSS bucket over SSL. Valid values: Yes and No.
  3. Click OK.

Step 3: Create a share

Local file gateways support Network File System (NFS) shares and Server Message Block (SMB) shares. You can create a share as needed. This section describes how to create an NFS share. You can also create an SMB share.

  1. Install an NFS Client.
  2. Go to the local file gateway console, click NFS in the left-side navigation pane, and then click Create.
  3. In the Create NFS dialog box that appears, set the following parameters, and click OK.
    Parameter Description
    Share Name The virtual mount point of the NFS share that you want to create.

    You can use this share name to directly mount an NFSv4 share. To mount an NFSv3 share, you must run the showmount -e <IP address of the target gateway> command to obtain the mount point.

    Read/Write Client IPs Specifies the IP address or CIDR block of the client that you allow to read from and write to the target NFS gateway, such as 192.168.10.10 or 192.168.0.0/24. You can enter multiple IP addresses or CIDR blocks.
    Read-only Client IPs Specifies the IP address or CIDR block of the client that you allow to only read from the target NFS gateway, such as 192.168.10.10 or 192.168.0.0/24. You can enter multiple IP addresses or CIDR blocks.
    User Mapping

    Maps an NFS client user to an NFS server user. This parameter is required only when you set the Protocol parameter to NFS.

    • none: specifies no mapping relationship between an NFS client user and the NFS server user nobody.
    • root_squash: maps only a root user of an NFS client to the NFS server user nobody.
    • all_squash: maps all NFS client users to the NFS server user nobody.
    • all_anonymous: maps all NFS client users to an anonymous NFS server user.
    Enabled Specifies whether to enable the specified NFS share.

    If you do not want to use the NFS share, you can select No to disable the NFS share.

    Data Access Mode Valid values: Cache Mode and Replication Mode.
    • Replication Mode: specifies that all data is stored with two backups. One backup is stored in a local cache and the other is stored in an OSS bucket.
    • Cache Mode: specifies that all metadata and frequently accessed user data are stored in the local cache. The OSS bucket retains all data.
    Enable Remote Sync Synchronizes metadata stored in an OSS bucket to the local cache. This feature is applicable to such scenarios as disaster recovery, data restoration, and data sharing.
    Note During remote synchronization, the system scans all objects in the bucket. If a large number of objects exist, you have to pay for corresponding OSS API requests. For more information, see Pricing of OSS.
    Encryption Valid values: No Encryption and Server Encryption.

    If you select Server Encryption, you must set the CMK ID parameter. You can log on to the KMS console, and create a key. For more information, see Create a CMK.

    After you enable OSS server encryption, you can provide you own key. The system supports the key imported from Key Management Service (KMS).

    With OSS server encryption enabled, the system automatically uses the imported key to encrypt the files uploaded to OSS through the shared directory. You can call the Get Object API operation to check whether the specified file has been encrypted. In the response header, if the x-oss-server-side-encryption field value is KMS and the x-oss-server-side-encryption-key-id field value is the key ID, this response indicates that the file has been encrypted.

    Note
    • Only the users in a whitelist can use this feature.
    • When you create a key in the KMS console, you must select the same region as the target OSS bucket.
    Bucket Name Specifies an existing bucket.
    Path Prefix Specifies a subdirectory of the target bucket in the Path Prefix field.

    The Path Prefix field supports letters and digits only.

    Note For version 1.0.38 and later, you can map a root directory of the file system to a subdirectory of a bucket to isolate connections and secure data.

    You can specify an existing subdirectory or a subdirectory that does not exist in the bucket. After you create the share, the specified subdirectory works as the root directory, and stores all related files and directories in the follow-up management.

    Cache Use Specifies whether to enable metadata disks. If you use metadata disks, data disks are separated from metadata disks, and metadata disks are used to store metadata of shared directories. Valid values: Yes and No.
    • If you select Yes, you must set the Metadata and Data parameters.
    • If you select No, you must set the Cache Disk parameter.
    Note Only the users in a whitelist can use this feature.
    Ignore Delete Ignores file deletion operations during data synchronization to OSS. The OSS bucket retains all data.
    Sync Delay Specifies a delay before the system uploads the file that you have modified and closed. The Sync Delay feature avoids OSS fragments caused by frequent local modifications. Valid values: 0 to 120. Default value: 5. Unit: seconds.
    Max Write Speed Specifies the maximum speed of writing data. Valid values: 0 to 1280. Default value: 0. Unit: MB/s. The value 0 specifies that the write speed is not limited.
    Max Upload Speed Specifies the maximum speed of uploading data. Valid values: 0 to 1280. Default value: 0. Unit: MB/s. The value 0 specifies that the upload speed is not limited.
    Note The maximum upload speed cannot be lower than the maximum write speed if the speed is limited.
    Optimize Fragments Specifies whether to optimize the performance for some applications that frequently and randomly read and write small amounts of data. You can enable this feature as needed.
    Optimize Upload Releases the cache in real time. You can enable this feature when you only synchronize backups to the cloud.
  4. Click OK.
  5. After you create the share, you can access the shared directory by using an NFS client. For more information, see Access NFS shares.