创建 CHDFS
创建权限组
创建权限规则
创建挂载点
挂载 CHDFS
使用 CAM 授权访问
通过 Java 代码访问 CHDFS
删除文件系统
chdfs_hadoop_plugin_network-1.7.jar拷贝到 Druid 安装路径extensions/druid-hdfs-storage以及hadoop-dependencies/hadoop-client/2.x.x下。conf/druid/_common/common.runtime.properties文件,将 hdfs 的 extension 加入到druid.extensions.loadList中,同时指定 hdfs 为 Druid 的 deep storage,而路径则填写为 CHDFS 的路径:propertiesdruid.extensions.loadList=["druid-hdfs-storage"]druid.storage.type=hdfsdruid.storage.storageDirectory=ofs://<mountpoint>/<druid-path>
conf/druid/_common/这个目录下,新建一个 hdfs 的配置文件 hdfs-site.xml,填入 CHDFS 的配置信息等:<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><!--Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. See accompanying LICENSE file.--><!-- Put site-specific property overrides in this file. --><configuration><property><name>fs.AbstractFileSystem.ofs.impl</name><value>com.qcloud.chdfs.fs.CHDFSDelegateFSAdapter</value></property><property><name>fs.ofs.impl</name><value>com.qcloud.chdfs.fs.CHDFSHadoopFileSystemAdapter</value></property><!--本地 cache 的临时目录, 对于读写数据, 当内存 cache 不足时会写入本地硬盘, 这个路径若不存在会自动创建--><property><name>fs.ofs.tmp.cache.dir</name><value>/data/chdfs_tmp_cache</value></property><!--appId 用户需要换成自己的 appid,可前往 https://console.tencentcloud.com/cam/capi 获取--><property><name>fs.ofs.user.appid</name><value>125000001</value></property></configuration>
文档反馈