Skip to content

[feature][COM][hadoop-common] add keytab principal host auto-resolution switch #1079

Description

@v-kkhuang

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Problem Description

Linkis keytab (Kerberos) authentication assembles the principal with a static host from wds.linkis.keytab.host (default 127.0.0.1). In multi-machine deployments each machine has a different hostname, so this static global value must be configured per machine and cannot adapt to dynamic hostnames. That prevents linking up with the cluster unified auth kinit -kt hadoop.keytab hadoop/${hostname}.

Description

Add a switch wds.linkis.keytab.host.auto (default false). When enabled, the principal host is automatically resolved from the local short hostname via InetAddress.getLocalHost.getHostName, equivalent to the shell hostname. It stays fully backward compatible with the existing static host config and the AES keytab switch.

Use case

After enabling host.auto, ECM and other per-machine services automatically use the local hostname to assemble the principal, so multi-machine deployments need no per-machine host config and adapt to hostname changes automatically.

Solutions

Add KEYTAB_HOST_AUTO switch in HadoopConf; add resolveKeytabHost in HDFSUtils to resolve the local short hostname, wrapped in Utils.tryCatch with fallback to the static host so the auth main path is never broken.

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions