cosn://bucketname-appid/
starting from v8.1.5.hadoop fs ls
to check whether the versions meet the requirements in the directory configured by fs.cosn.trsf.fs.ofs.tmp.cache.dir
.classpath
of each node and make sure that the job can be started and loaded normally, such as $HADOOP_HOME/share/hadoop/common/lib/
.fs.cosn.posix_bucket.fs.impl
configuration item as detailed below.core-site.xml
file by adding the following basic configuration items:<!-- API key information of the account, which can be viewed in the [CAM console](https://console.tencentcloud.com/capi). --><!-- We recommend you use a sub-account key or temporary key for configuration to improve the configuration security. When authorizing a sub-account, follow the [Notes on Principle of Least Privilege](https://www.tencentcloud.com/document/product/436/32972). --><property><name>fs.cosn.userinfo.secretId/secretKey</name><value>AKIDxxxxxxxxxxxxxxxxxxxxx</value></property><!--COSN implementation class--><property><name>fs.AbstractFileSystem.cosn.impl</name><value>org.apache.hadoop.fs.CosN</value></property><!--COSN implementation class--><property><name>fs.cosn.impl</name><value>org.apache.hadoop.fs.CosFileSystem</value></property><!-- Bucket region in the format of `ap-guangzhou` --><property><name>fs.cosn.bucket.region</name><value>ap-guangzhou</value></property><!-- Local temporary directory, which is used to store temporary files generated during execution. -><property><name>fs.cosn.tmp.dir</name><value>/tmp/hadoop_cos</value></property>
core-site.xml
to all Hadoop nodes.hadoop fs -ls cosn://${bucketname-appid}/
command on the hadoop fs
command line, where bucketname-appid
is the mount address, i.e., the bucket name. If the file list is displayed normally, the COS bucket has been successfully mounted.hadoop
or use an mr
job to run data processing jobs in COS metadata acceleration buckets. For an mr
job, you can run -Dfs.defaultFS=ofs://${bucketname-appid}/
to change the default input/output file system of this job to the specified bucket.Configuration Item | Content | Description |
fs.cosn.userinfo.secretId/secretKey | A value in the format of AKIDxxxxxxxxxxxxxxxxxxxx | |
fs.cosn.impl | org.apache.hadoop.fs.CosFileSystem | COSN implementation class for FileSystem , which is fixed at org.apache.hadoop.fs.CosFileSystem . |
fs.AbstractFileSystem.cosn.impl | org.apache.hadoop.fs.CosN | COSN implementation class for AbstractFileSystem , which is fixed at org.apache.hadoop.fs.CosN . |
fs.cosn.bucket.region | A value in the format of ap-beijing | Enter the region information of the bucket to be accessed, such as ap-beijing and ap-guangzhou . For enumerated values, see Regions and Access Endpoints. This parameter is compatible with the legacy parameter fs.cosn.userinfo.region . |
fs.cosn.tmp.dir | /tmp/hadoop_cos by default | Set an existing local directory, where temporary files generated during execution will be placed. Meanwhile, be sure to configure sufficient space and permissions for this directory on each node. |
fs.cosn.trsf.
prefix to other optional items as described in Mounting CHDFS Instance to access metadata acceleration buckets.Configuration Item | Content | Description |
fs.cosn.trsf.fs.AbstractFileSystem.ofs.impl | com.qcloud.chdfs.fs.CHDFSDelegateFSAdapter | Implementation class for metadata acceleration bucket access |
fs.cosn.trsf.fs.ofs.impl | com.qcloud.chdfs.fs.CHDFSHadoopFileSystemAdapter | Implementation class for metadata acceleration bucket access |
fs.cosn.trsf.fs.ofs.tmp.cache.dir | A value in the format of /data/emr/hdfs/tmp/posix-cosn/ | Set an existing local directory such as "/data/emr/hdfs/tmp/posix-cosn/" , where temporary files generated during execution will be placed. Meanwhile, be sure to configure sufficient space and permissions for this directory on each node. |
fs.cosn.trsf.fs.ofs.user.appid | A value in the format of 12500000000 | Your appid , which is required. |
fs.cosn.trsf.fs.ofs.bucket.region | A value in the format of ap-beijing | Your bucket region, which is required. |
Configuration Item | Content | Description |
fs.cosn.posix_bucket.fs.impl | org.apache.hadoop.fs.CosNFileSystem | This parameter is fixed at com.qcloud.chdfs.fs.CHDFSHadoopFileSystemAdapter for the POSIX access mode (default mode) or org.apache.hadoop.fs.CosNFileSystem for the S3 access mode, respectively. |
Apakah halaman ini membantu?