tencent cloud

Feedback

Using CHDFS as Druid's Deep Storage

Last updated: 2022-03-30 09:30:26

    Environment Dependencies

    Download and Installation

    Getting CHDFS JAR

    Download CHDFS JAR.

    Installing CHDFS JAR

    Using CHDFS as Druid's deep storage requires Druid-hdfs-extension.
    After downloading the CHDFS JAR, copy chdfs_hadoop_plugin_network-1.7.jar to the Druid installation path extensions/druid-hdfs-storage and hadoop-dependencies/hadoop-client/2.x.x.

    Directions

    Modifying configuration

    1. Modify the conf/druid/_common/common.runtime.properties file at the Druid installation path, add the extension of HDFS to druid.extensions.loadList, specify HDFS as Druid's deep storage, and enter the path of the CHDFS instance:

      properties
      druid.extensions.loadList=["druid-hdfs-storage"]
      druid.storage.type=hdfs
      druid.storage.storageDirectory=ofs://<mountpoint>/<druid-path>
      
    2. In the conf/druid/_common/ directory, create the HDFS configuration file hdfs-site.xml and enter the configuration information of the CHDFS instance:

    <!--?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 at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed 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 and
    limitations 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>
    <!--Temporary directory of the local cache. For data read/write, data will be written to the local disk when the memory cache is insufficient. This path will be created automatically if it does not exist-->
    <property>
    <name>fs.ofs.tmp.cache.dir</name>
    <value>/data/chdfs_tmp_cache</value>
    </property>
    <!--You need to replace `appId` with your own `appid`, which can be obtained at https://console.tencentcloud.com/cam/capi-->
    <property>
    <name>fs.ofs.user.appid</name>
    <value>125000001</value>
    </property>
    </configuration>

    The supported items of the above configuration are completely consistent with those as described at the CHDFS website. For more information, please see Mounting CHDFS Instance.

    Starting to use

    Start the Druid processes in turn, and Druid data can be loaded into CHDFS.

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support