Skip to main content

HDFS

Before creating a catalog or running a load or export job, ensure that the warehouse can reach the service endpoint and that its credentials have the required metadata and data permissions. For private endpoints or service-side credential files, coordinate connectivity and provisioning with VeloDB Cloud support.

This document describes the parameters required for accessing HDFS. These parameters apply to:

  • Catalog properties
  • Table Valued Function properties
  • Broker Load properties
  • Export properties
  • Outfile properties

Parameters​

Property NameLegacy NameDescriptionDefault ValueRequired
hdfs.authentication.typehadoop.security.authenticationSpecifies the authentication type. Optional values are kerberos or simple. If kerberos is selected, the system will use Kerberos authentication to interact with HDFS; if simple is used, it means no authentication is used, suitable for open HDFS clusters. Selecting kerberos requires configuring the corresponding principal and keytab.simpleNo
hdfs.authentication.kerberos.principalhadoop.kerberos.principalWhen the authentication type is kerberos, specify the Kerberos principal. A Kerberos principal is a unique identity string that typically includes service name, hostname, and domain name.-No
hdfs.authentication.kerberos.keytabhadoop.kerberos.keytabThis parameter specifies the keytab file path for Kerberos authentication. The keytab file stores encrypted credentials, allowing the system to authenticate automatically without requiring users to manually enter passwords.-No
hdfs.impersonation.enabled-If true, enables HDFS impersonation functionality. Would use the proxy user configured in core-site.xml for HDFS operationsNot supported yet-
hadoop.username-When the authentication type is simple, this user will be used to access HDFS. By default, the Linux system user running the VeloDB Cloud process will be used for access--
hadoop.config.resources-Specifies the HDFS configuration file directory (must include hdfs-site.xml and core-site.xml), using relative paths. Provisioning these files and the service setting hadoop_config_dir requires VeloDB Cloud support. Example: hadoop/conf/core-site.xml,hadoop/conf/hdfs-site.xml--
dfs.nameservices-Manually configure HDFS high availability cluster parameters. If using hadoop.config.resources configuration, parameters will be automatically read from hdfs-site.xml. Need to be used with the following parameters: dfs.ha.namenodes.your-nameservice, dfs.namenode.rpc-address.your-nameservice.nn1, dfs.client.failover.proxy.provider, etc.--

For compatibility with Apache Doris before 3.1, please use the legacy names.

Configure authentication​

HDFS supports two authentication methods:

  • Simple
  • Kerberos

Simple authentication​

Simple authentication is suitable for HDFS clusters that have not enabled Kerberos.

Using Simple authentication, you can set the following parameters or use the default values directly:

"hdfs.authentication.type" = "simple"

In Simple authentication mode, you can use the hadoop.username parameter to specify the username. If not specified, it defaults to the username of the current process.

Examples:

Using lakers username to access HDFS

"hdfs.authentication.type" = "simple",
"hadoop.username" = "lakers"

Using default system user to access HDFS

"hdfs.authentication.type" = "simple"

Configure Kerberos authentication​

Kerberos authentication is suitable for HDFS clusters with Kerberos enabled.

Using Kerberos authentication, you need to set the following parameters:

"hdfs.authentication.type" = "kerberos",
"hdfs.authentication.kerberos.principal" = "<your_principal>",
"hdfs.authentication.kerberos.keytab" = "<your_keytab>"

In Kerberos authentication mode, you need to set the Kerberos principal and keytab file path.

VeloDB Cloud will access HDFS with the identity specified by the hdfs.authentication.kerberos.principal property, using the keytab specified by keytab to authenticate the Principal.

Note:

The keytab and Kerberos configuration must be provisioned at consistent service-side paths. Ask VeloDB Cloud support to arrange this for the warehouse; a path on your workstation is not accessible to the query engine.

Example:

"hdfs.authentication.type" = "kerberos",
"hdfs.authentication.kerberos.principal" = "hdfs/hadoop@HADOOP.COM",
"hdfs.authentication.kerberos.keytab" = "/etc/security/keytabs/hdfs.keytab",

For troubleshooting common Kerberos configuration issues, see Kerberos FAQ.

Configure HDFS high availability​

If HDFS HA mode is enabled, need to configure dfs.nameservices related parameters:

'dfs.nameservices' = '<your-nameservice>',
'dfs.ha.namenodes.<your-nameservice>' = '<nn1>,<nn2>',
'dfs.namenode.rpc-address.<your-nameservice>.<nn1>' = '<nn1_host:port>',
'dfs.namenode.rpc-address.<your-nameservice>.<nn2>' = '<nn2_host:port>',
'dfs.client.failover.proxy.provider.<your-nameservice>' = 'org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider',

Example:

'dfs.nameservices' = 'nameservice1',
'dfs.ha.namenodes.nameservice1' = 'nn1,nn2',
'dfs.namenode.rpc-address.nameservice1.nn1' = '<namenode-1-host>:8020',
'dfs.namenode.rpc-address.nameservice1.nn2' = '<namenode-2-host>:8020',
'dfs.client.failover.proxy.provider.nameservice1' = 'org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider',

In a future release, the comma-separated XML paths in hadoop.config.resources must not contain a .. parent-directory segment. Both forward-slash and backslash separators are checked. Use normal paths such as conf/core-site.xml,conf/hdfs-site.xml; do not use ../ to access a parent directory.

Use configuration files​

VeloDB Cloud supports specifying the HDFS configuration file directory through the hadoop.config.resources parameter.

The service-side configuration directory must contain the required hdfs-site.xml and core-site.xml files. VeloDB Cloud support provisions the files and provides the relative paths to use in hadoop.config.resources.

If the configuration files contain the above parameters mentioned in this document, user-explicitly configured parameters take priority. Configuration files can specify multiple files, separated by commas, such as hadoop/conf/core-site.xml,hadoop/conf/hdfs-site.xml.

Examples:

-- Multiple configuration files
'hadoop.config.resources'='hdfs-cluster-1/core-site.xml,hdfs-cluster-1/hdfs-site.xml'
-- Single configuration file
'hadoop.config.resources'='hdfs-cluster-2/hdfs-site.xml'

Tune HDFS I/O​

In some cases, high HDFS load may cause reading data replicas on HDFS to take a long time, thereby slowing down overall query efficiency. The following introduces some related optimization configurations.

Hedged reads​

HDFS Client provides Hedged Read functionality. This feature can start another read thread to read the same data when a read request exceeds a certain threshold without returning, using whichever returns first.

Note: This feature may increase the load on the HDFS cluster, please use it judiciously.

You can enable this feature in the following way:

"dfs.client.hedged.read.threadpool.size" = "128",
"dfs.client.hedged.read.threshold.millis" = "500"
  • dfs.client.hedged.read.threadpool.size

    Represents the number of threads used for Hedged Read, which are shared by one HDFS Client. Client reuse depends on the connection configuration; do not interpret these threads as a per-query allocation.

  • dfs.client.hedged.read.threshold.millis

    Read threshold in milliseconds. When a read request exceeds this threshold without returning, it will trigger Hedged Read.

Compare query profiles, HDFS service metrics, and request errors before and after enabling hedged reads. The extra read can increase HDFS load; do not assume that a fixed setting improves every workload.

dfs.client.socket-timeout​

dfs.client.socket-timeout is a client configuration parameter in Hadoop HDFS used to set the socket timeout when the client establishes connections or reads data with DataNode or NameNode, in milliseconds. The default value of this parameter is usually 60,000 milliseconds.

Reducing this parameter value allows the client to timeout faster and retry or switch to other nodes when encountering network delays, slow DataNode responses, or connection exceptions. This helps reduce wait times and improve system response speed. For example, in some tests, setting dfs.client.socket-timeout to a smaller value (such as 5000 milliseconds) can quickly detect DataNode delays or failures, avoiding long waits.

Note:

  • Setting the timeout too small may cause frequent timeout errors during network fluctuations or high node load, affecting task stability.

  • It is recommended to reasonably adjust this parameter value based on actual network environment and system load conditions to balance response speed and system stability.

  • For a service-side configuration-file change, ask VeloDB Cloud support to update the warehouse configuration.

Compare timeout errors and query latency before and after a change; a smaller timeout can also increase retries and failures.

HDFS access ports​

VeloDB Cloud requires the following ports to be open to access HDFS:

ServicePort PurposeDefault PortProtocol
NameNodeRPC (client/metadata access)8020TCP
DataNodeData transfer (block I/O)9866TCP

Notes:

  • Ports may be customized in core-site.xml & hdfs-site.xml. Use actual configs.
  • When Kerberos authentication is enabled, VeloDB Cloud must also be able to reach the Kerberos KDC service. The KDC listens on TCP port 88 by default, but the actual port should follow your KDC configuration.

Troubleshoot HDFS​

Use the Hadoop filesystem shell in your own network to check the external service and credentials. A successful client test does not establish the warehouse's network path or managed identity.

For warehouse failures, provide VeloDB Cloud support with the affected catalog or load statement, the NameNode and DataNode endpoints, the authentication mode, and the error text. Support can inspect service-side client configuration and logs.

Common errors​

For access-denied errors, check the identity and its permissions for both metadata and data. For timeouts, verify the service endpoint and network path from the warehouse. For errors involving a keytab, CA certificate, Hadoop XML file, or JDBC driver, contact VeloDB Cloud support with the error text and the operation that failed.