All Products
Search
Document Center

How to upload and download to DSW

Last Updated: Jul 21, 2019

DSW storage configuration

By default, Data Science Workshop (DSW) provides 5 GB of free storage space. You can also mount an NAS file system to your DSW instance to expand the storage space. Network Attached Storage (NAS) is an Alibaba Cloud storage service that provides SSD resources on the cloud. For more information about mounting NAS file systems, see https://help.aliyun.com/document_detail/95535.html

After you mount an NAS file system to the instance, you can run the following command in the DSW terminal to view the NAS file system:

  1. df -h

If the NAS file system is mounted, the /nas directory is displayed.

We recommend that you store large files in the /nas directory.

Download small files

If the file size is smaller than 300 MB, we recommend that you click the DSW instance to log on to the DSW console, right-click the file, and click Download to download the file.

Upload small files

If the file size is smaller than 300 MB, we recommend that you click the DSW instance to log on to the DSW console and then upload the file.

Download and upload large files

If the file size is larger than 300 MB, we recommend that you use FTP to download the file. Currently, you can only use FTP to download files stored in the mounted NAS file system. If the files are stored in the 5 GB storage space, then you must first copy the files to the mounted NAS file system. Follow these steps to download and upload a file:

1. Check the type of the NAS file system that is mounted to the instance.


Log on to the NAS console, and switch to the region where the NAS file system is created. In this example, the NAS file system is created in the China (Shanghai) region. Verify that the storage type of the NAS file system is SSD performance-type and the protocol is NFS, as shown in the following dsw_nas_demo file system: For more information about mounting NAS file systems to DSW instances, see Mount NAS file systems.

2. Create an ECS instance


Purchase an ECS instance

Log on to the ECS console, and purchase a CentOS ECS instance in the same region as the NAD file system. Click here to go to the buy page.

Follow these guidelines when you create an ECS instance:

  • Image: select a CentOS image. The image version is not limited.
  • Network: set the network to VPC. By default, the system selects a VPC network for you. You can also create a VPC network.
  • Use the default setting for other parameters, confirm the terms of service, and create the instance.

Reset the ECS instance password

Click Manage in the Actions column for the ECS instance to open the instance information page, and then select More -> Reset Password to reset the password. Click Connect to log on to the ECS instance. Make sure that you keep the ECS instance password because you must enter the password every time you connect to the ECS instance.

3. Add a mount point for the NAS file system


Log on to the NAS console, locate the NAS file system that is mounted to the DSW instance, and click Add Mount Point.

In the Add Mount Point dialog box, set the mount point type to VPC, and then select the same VPC network as the ECS instance. If you cannot determine which VPC network the ECS instance is connected to, go to the ECS instance information page to confirm it.

After you add a mount point, click the NAS file system name. If the details page shows the mount address, this means that the mount point is added. This mount point is the key to connecting to the ECS instance. Click the mount point to view the command for mounting the file system to an instance. Record this command.

4. Mount the NAS file system to the ECS instance


Log on to the ECS instance, install the nfs-utils package, and enter the mount command.

  1. #Install the nfs-utils package
  2. yum install nfs-utils
  3. #V4 Mount:
  4. sudo mount -t nfs -o vers=4.0,noresvport 31ce14ad85-jol17.cn-shanghai.nas.aliyuncs.com:/ /mnt
  5. #Check whether the NAS file system is mounted to the instance.
  6. mount -l

4. Upload files


Run the SFTP commands on your local host or use a client such as FileZilla to connect to the ECS instance. You can check the Internet IP address of the ECS instance in the ECS console. The root directory for storing the uploaded files is /mnt.

This example shows how to use FileZilla to upload files to the ECS instance.After you upload the files, log on to the ECS instance to confirm that the files are stored in the /mnt directory.

Log on to the DSW terminal and check the mounted NAS file system. You can then find the uploaded files.

5. Download files


Log on to the DSW terminal, move the files that you want to download to the /nas directory. You can then use the SFTP commands or a client such as FileZilla to download the files.

For more information, see Use SFTP to upload files to and download files from an NAS file system