Tencent Cloud

In this page, we explain how to get your Hudi spark job to store into Tencent Cloud COS.

Tencent Cloud COS configs

There are two configurations required for Hudi-COS compatibility:

  • Adding Tencent Cloud COS Credentials for Hudi
  • Adding required Jars to classpath

Tencent Cloud COS Credentials

Add the required configs in your core-site.xml from where Hudi can fetch them. Replace the fs.defaultFS with your COS bucket name, replace fs.cosn.userinfo.secretId with your COS secret Id, replace fs.cosn.userinfo.secretKey with your COS key. Hudi should be able to read/write from the bucket.

  1. <property>
  2. <name>fs.defaultFS</name>
  3. <value>cosn://bucketname</value>
  4. <description>COS bucket name</description>
  5. </property>
  6. <property>
  7. <name>fs.cosn.userinfo.secretId</name>
  8. <value>cos-secretId</value>
  9. <description>Tencent Cloud Secret Id</description>
  10. </property>
  11. <property>
  12. <name>fs.cosn.userinfo.secretKey</name>
  13. <value>cos-secretkey</value>
  14. <description>Tencent Cloud Secret Key</description>
  15. </property>
  16. <property>
  17. <name>fs.cosn.bucket.region</name>
  18. <value>ap-region</value>
  19. <description>The region where the bucket is located.</description>
  20. </property>
  21. <property>
  22. <name>fs.cosn.bucket.endpoint_suffix</name>
  23. <value>cos.endpoint.suffix</value>
  24. <description>
  25. COS endpoint to connect to.
  26. For public cloud users, it is recommended not to set this option, and only the correct area field is required.
  27. </description>
  28. </property>
  29. <property>
  30. <name>fs.cosn.impl</name>
  31. <value>org.apache.hadoop.fs.CosFileSystem</value>
  32. <description>The implementation class of the CosN Filesystem.</description>
  33. </property>
  34. <property>
  35. <name>fs.AbstractFileSystem.cosn.impl</name>
  36. <value>org.apache.hadoop.fs.CosN</value>
  37. <description>The implementation class of the CosN AbstractFileSystem.</description>
  38. </property>

Tencent Cloud COS Libs

COS hadoop libraries to add to our classpath

  • org.apache.hadoop:hadoop-cos:2.8.5