Enable OSS-HDFS service

Updated at:

You can enable OSS-HDFS service when you create a bucket, or enable OSS-HDFS service for an existing bucket.

Prerequisites

China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Ulanqab), China (Shenzhen), China (Guangzhou), China (Zhangjiakou), China (Hong Kong), Japan (Tokyo), Singapore, Germany (Frankfurt), US (Silicon Valley), US (Virginia), Indonesia (Jakarta), Thailand (Bangkok), Malaysia (Johor)Buckets in the following regions support OSS-HDFS service.Region-independent buckets do not support OSS-HDFS service.

Billing

  • Metadata management fees

    Not billed for now.

  • Data usage fees

    When you use OSS-HDFS service, data blocks are stored in the same way as OSS. Therefore, the metering and billing methods of OSS apply to data blocks in OSS-HDFS service. For more information, see Billing overview.

Limits

  • OSS-HDFS service cannot be disabled after it is enabled. Proceed with caution.

  • You can access OSS-HDFS service only through a virtual private cloud (VPC). When you create a VPC, make sure that the VPC is in the same region as the bucket for which you want to enable OSS-HDFS service.

  • Buckets of the Archive, Cold Archive, or Deep Cold Archive storage class do not support OSS-HDFS service.

  • Do not perform write operations on the data storage directory .dlsdata/ of OSS-HDFS or any objects in the directory by using methods other than those provided by OSS-HDFS, such as renaming the directory, deleting the directory, or deleting objects. Otherwise, the normal use of OSS-HDFS service may be affected or data loss may occur.

  • Before you delete a bucket for which OSS-HDFS service is enabled, you must first delete the metadata in OSS-HDFS service and then delete the OSS data. Otherwise, the bucket cannot be deleted.

Enable OSS-HDFS service

Warning

When you enable OSS-HDFS service for a bucket, the role AliyunOSSDlsDefaultRole is automatically created by default and associated with the policy AliyunOSSDlsRolePolicy. To ensure that users of OSS-HDFS service can access the data storage directory .dlsdata/ of OSS-HDFS and any objects in the directory, do not disable, modify, or delete the role or its associated policy.

Enable OSS-HDFS service when you create a bucket

When you use an Alibaba Cloud account or a RAM user with administrator permissions to create a bucket for the first time, you must follow the on-screen instructions to complete role authorization before you enable OSS-HDFS. For more information, see Create a bucket.

Enable OSS-HDFS service for an existing bucket

To enable OSS-HDFS service for an existing bucket by using an Alibaba Cloud account or a RAM user with administrator permissions, perform the following steps:

  1. Complete RAM authorization.

    1. Log on to the OSS console.

    2. In the left-side navigation pane, click Buckets, and then click the name of the bucket for which you want to enable OSS-HDFS service.

    3. In the left-side navigation pane, choose Data Lake > OSS-HDFS.

    4. On the OSS-HDFS tab, click Authorize, and then follow the on-screen instructions to complete the authorization. When you use HDFS service for the first time, a prompt appears indicating that you need to complete RAM authorization first, including: creating a role named AliyunOSSDlsDefaultRole, creating a custom policy named AliyunOSSDlsRolePolicy, and granting the policy to the role. Click Go to Authorization to complete the authorization.

  2. Enable HDFS service.

    1. On the OSS-HDFS tab, click Enable OSS HDFS . The page displays the RAM authorization completed status, indicating that the role named AliyunOSSDlsDefaultRole has been created and the custom policy AliyunOSSDlsRolePolicy has been granted to the role. Click Enable HDFS service at the bottom.

    2. In the dialog box that appears, click OK.

      After the service is enabled, you can still use OSS as usual. If you want to use OSS-HDFS service, you need to use the HDFS service endpoint. You can go to the Overview page of the bucket and obtain the HDFS service endpoint in the Port section. Example value: cn-hangzhou.oss-dls.aliyuncs.com.

What to do next

After you enable OSS-HDFS service, if you want to authorize a RAM user to access OSS-HDFS service by using an EMR cluster or a non-EMR cluster, see Grant a RAM user the permissions to access OSS-HDFS.