Skip to content

Using Flink 1.20.3, starting sql-client.sh throws 'Failed to start th…#61070

Open
Cocoyamsweetsnow wants to merge 1 commit intoapache:masterfrom
Cocoyamsweetsnow:fix-issue-12345
Open

Using Flink 1.20.3, starting sql-client.sh throws 'Failed to start th…#61070
Cocoyamsweetsnow wants to merge 1 commit intoapache:masterfrom
Cocoyamsweetsnow:fix-issue-12345

Conversation

@Cocoyamsweetsnow
Copy link

…e embedded sql-gateway' error

What problem does this PR solve?

Issue Number: close #60983

Related PR: None

Problem Summary:
在 Flink 1.20+ 中,sql-client.sh 的行为发生了重大变更:不再直接连接 JobManager
的 REST 端点,而是在本地启动一个嵌入式 SQL Gateway。该嵌入式网关在未显式配置
sql-gateway.endpoint.rest.port 时,会继承全局的 rest.bind-port(默认 8081)
作为自己的 REST 端口。
由于 JobManager 的 REST 端点已经占用了 8081,嵌入式 SQL Gateway 尝试绑定同一端口时
就会抛出以下异常:
java.net.BindException: Could not start rest endpoint on any port in port range 8081 at org.apache.flink.runtime.rest.RestServerEndpoint.start at org.apache.flink.table.gateway.SqlGateway.start

修复方案:
samples/datalake/iceberg_and_paimon/data/flink-conf/flink-conf.yaml 中新增
sql-gateway.endpoint.rest.port: 9091,为嵌入式 SQL Gateway 指定一个独立端口,
使其与 JobManager REST 端口(8081)隔离,避免端口冲突。

Release note

When using Flink 1.20+ with sql-client.sh, add sql-gateway.endpoint.rest.port
configuration to avoid port conflict with JobManager's REST endpoint.

Check List (For Author)

  • Test
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • No runtime logic changed; only a configuration sample file is updated.
  • Behavior changed:
    • No.
  • Does this need documentation?
    • No.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@morningman
Copy link
Contributor

run buildall

@morningman morningman self-assigned this Mar 5, 2026
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

PR approved by anyone and no changes requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Using Flink 1.20.3, starting sql-client.sh throws "Failed to start the embedded sql-gateway" error

3 participants