存储配置
腾讯云
登录后可跨设备保存划线和私人笔记登录
本页介绍如何让你的 Hudi Spark 作业将数据写入腾讯云 COS。
腾讯云 COS 配置
Hudi 与 COS 兼容需要两项配置:
- 为 Hudi 添加腾讯云 COS 凭证
- 将所需的 Jar 包加入 classpath
腾讯云 COS 凭证
在 Hudi 可读取的 core-site.xml 中添加所需配置。将 fs.defaultFS 替换为你的 COS 存储桶名称,将 fs.cosn.userinfo.secretId 替换为你的 COS SecretId,将 fs.cosn.userinfo.secretKey 替换为你的 COS 密钥。配置完成后,Hudi 应能正常读写该存储桶。
<property>
<name>fs.defaultFS</name>
<value>cosn://bucketname</value>
<description>COS bucket name</description>
</property>
<property>
<name>fs.cosn.userinfo.secretId</name>
<value>cos-secretId</value>
<description>Tencent Cloud Secret Id</description>
</property>
<property>
<name>fs.cosn.userinfo.secretKey</name>
<value>cos-secretkey</value>
<description>Tencent Cloud Secret Key</description>
</property>
<property>
<name>fs.cosn.bucket.region</name>
<value>ap-region</value>
<description>The region where the bucket is located.</description>
</property>
<property>
<name>fs.cosn.bucket.endpoint_suffix</name>
<value>cos.endpoint.suffix</value>
<description>
COS endpoint to connect to.
For public cloud users, it is recommended not to set this option, and only the correct area field is required.
</description>
</property>
<property>
<name>fs.cosn.impl</name>
<value>org.apache.hadoop.fs.CosFileSystem</value>
<description>The implementation class of the CosN Filesystem.</description>
</property>
<property>
<name>fs.AbstractFileSystem.cosn.impl</name>
<value>org.apache.hadoop.fs.CosN</value>
<description>The implementation class of the CosN AbstractFileSystem.</description>
</property>腾讯云 COS 库
需要添加到 classpath 的 COS Hadoop 库:
- org.apache.hadoop2.8.5
评论
登录后参与评论
正在加载评论…
KnowForge