All Products
Search
Document Center

Serverless App Engine:Configure NAS storage

Last Updated:Nov 01, 2024

In most cases, data that is stored in a container is lost if the container is destroyed. This causes great damage to production environments. File Storage NAS is suitable for high-performance computing and data sharing scenarios. If you mount NAS file systems to Serverless App Engine (SAE) application instances, data can be persistently stored and distributed across application instances.

Prerequisites

Procedure

Configure NAS storage when you create an application

  1. Log on to the SAE console.

  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click Create Application.

  3. In the Basic Information step, configure the parameters and click Next: Application Deployment Configurations.

  4. In the Deployment Configurations step, configure the Technology Stack Programming Language and Application Deployment Method parameters and the corresponding settings.

  5. In the Persistent Storage section, configure the parameters.

    1. Click the NAS File System tab and turn on Enable NAS Storage.

    2. Select the NAS file system that you want to mount from the NAS File System drop-down list, and configure the Mount Source, Mount Directory, Container Path, and Permission parameters.

      挂载NAS配置

      Note
      • The Mount Directory parameter must be set to the root directory that is indicated by a forward slash (/) or a subdirectory that does not start with a forward slash (/).

      • The value of the Container Path parameter must be unique. If you add multiple mount paths, one path cannot be a parent path or a child path of the other paths. For example, you cannot specify /tmp and /tmp/nas at the same time.

      • Click + Add to add a mount path. You can add up to 10 mount paths.

  6. Click Next: Confirm Specifications.

  7. In the Specification Confirmation step, view the details of the application and the fee for the selected specifications. Then, click Confirm.

    The Creation Completed step appears. You can click Application Details to go to the Basic Information page of the application.

Configure NAS storage when you deploy an application

Warning

After you redeploy an application, the application is restarted. To prevent unpredictable errors such as business interruptions, we recommend that you deploy applications during off-peak hours.

The procedure that can be performed to update an application varies based on the number of instances in the application. This section provides an example on how to configure the required features for an application in which the number of instances is greater than or equal to 1. For information about how to update an application in which the number of instances is 0, see Update an application.

  1. Log on to the SAE console.

  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click the name of an application.

  3. In the upper-right corner of the Basic Information page, click Deploy Application.

  4. In the Persistent Storage section, configure the parameters.

    1. Click the NAS File System tab and turn on Enable NAS Storage.

    2. Select the NAS file system that you want to mount from the NAS File System drop-down list, and configure the Mount Source, Mount Directory, Container Path, and Permission parameters.

      挂载NAS配置

      Note
      • The Mount Directory parameter must be set to the root directory that is indicated by a forward slash (/) or a subdirectory that does not start with a forward slash (/).

      • The value of the Container Path parameter must be unique. If you add multiple mount paths, one path cannot be a parent path or a child path of the other paths. For example, you cannot specify /tmp and /tmp/nas at the same time.

      • Click + Add to add a mount path. You can add up to 10 mount paths.

  5. After you configure the settings, click Confirm.

Unmount the NAS file system

Warning

After you redeploy an application, the application is restarted. To prevent unpredictable errors such as business interruptions, we recommend that you deploy applications during off-peak hours.

If you no longer require NAS storage after you mounted a NAS file system, you can unmount the NAS file system. After you unmount a NAS file system in the SAE console, data that is stored in the NAS file system is retained. For more information, see Configure NAS storage when you deploy an application. Follow Step 4 to turn off Enable NAS Storage and click Confirm.

Verify the mount result

Use one of the following methods to check whether the NAS file system is mounted:

  • Verify the mount result based on change records.

    If no exception occurs on the instances that are generated after you configure NAS storage during application creation or deployment, the NAS file system is mounted.

    sae挂载nas成功

  • Verify the mount result based on containers.

    Run the following command in the webshell of an instance to check whether the mount information of the NAS file system exists in the application:

    cat /proc/mounts | grep nfs

    If the following output is returned, the NAS file system is mounted.

    成功挂载nas存储

  • Verify the mount result based on your business.

    Run commands in the path on which the NAS file system is mounted in a webshell. If the NAS storage path can be found in the NAS file system, the NAS file system is mounted.

FAQ

How do I view the content of a NAS file system?

You cannot view the content of a NAS file system by using console tools. To view the content of a NAS file system, you must mount the NAS file system on an SAE application or an Elastic Compute Service (ECS) instance. For more information, see the following topics:

Can I use NAS to store logs?

We recommend that you do not use NAS as a log persistence tool. If you use NAS and multiple clients write data to the same file at the same time, conflicts may occur during concurrent access and performance bottlenecks may be caused.

We recommend that you use Simple Log Service in log scenarios to ensure log data persistence. For more information, see Configure log collection to Simple Log Service.