You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flink 1.15.3执行SQL时连接BlobServer失败求助

环境与操作背景

  • Flink版本:1.15.3
  • JDK版本:1.8
  • conf/flink-conf.yaml配置:
jobmanager.rpc.address: test1
jobmanager.rpc.port: 6123
jobmanager.bind-host: test1
taskmanager.bind-host: test1
taskmanager.host: test1
taskmanager.numberOfTaskSlots: 2
parallelism.default: 2
  • 操作步骤:
    1. 通过./bin/start-cluster.sh启动本地集群
    2. 调用./bin/sql-client.sh embedded启动SQL Client CLI
    3. 执行SQL语句:
SET 'sql-client.execution.result-mode' = 'tableau';
SET 'execution.runtime-mode' = 'batch';

SELECT
  name,
  COUNT(*) AS cnt
FROM
  (VALUES ('Bob'), ('Alice'), ('Greg'), ('Bob')) AS NameTable(name)
GROUP BY name;

错误日志核心信息

[ERROR] Could not execute SQL statement. Reason:
org.apache.flink.runtime.rest.util.RestClientException: [org.apache.flink.runtime.rest.handler.RestHandlerException: Could not upload job files.
...
Caused by: java.io.IOException: Could not connect to BlobServer at address localhost/127.0.0.1:35138
...
Caused by: java.net.ConnectException: Connection refused (Connection refused)

报错原因

  1. 地址配置与实际连接不匹配
    配置中jobmanager.bind-host和jobmanager.rpc.address均设置为test1,意味着JobManager及其内置的BlobServer会绑定到test1对应的IP地址。但错误日志显示SQL Client尝试连接的BlobServer地址是localhost/127.0.0.1,两者地址不一致,直接导致连接被拒绝。

  2. test1主机名本地解析异常
    如果本地机器的hosts文件未将test1映射到本机IP(如127.0.0.1),会引发两个问题:

    • JobManager启动时无法正常绑定到test1对应的IP,BlobServer的监听地址不可达;
    • SQL Client无法正确解析test1,默认 fallback 到localhost进行连接,而BlobServer并未在localhost上监听。
  3. SQL Client未加载正确配置
    若启动SQL Client时未确保其读取到指定的flink-conf.yaml,会默认使用localhost作为JobManager地址,导致连接的BlobServer地址与实际运行的JobManager不匹配。

内容的提问来源于stack exchange,提问作者gnnExplorer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 22:35:51