Flink槽位满了

flink服务启动失败,报错原因:

javascript 复制代码
Caused by: org.postgresql.util.PSQLException: ERROR: all replication slots are in use
Hint: Free one or increase max_replication_slots.

日志:

javascript 复制代码
类名	:org.apache.flink.runtime.source.coordinator.SourceCoordinator
方法名:	lambda$runInEventLoop$10(SourceCoordinator.java:478)
内容	:Uncaught exception in the SplitEnumerator for Source org.apache.flink.util.FlinkRuntimeException: Fail to get or create slot for global stream split, the slot name is 130000fa4e20085ba54852927bad24cd811e10. Due to:
at com.ververica.cdc.connectors.postgres.source.enumerator.PostgresSourceEnumerator.createSlotForGlobalStreamSplit(PostgresSourceEnumerator.java:76)
at com.ververica.cdc.connectors.postgres.source.enumerator.PostgresSourceEnumerator.start(PostgresSourceEnumerator.java:50)
at org.apache.flink.runtime.source.coordinator.SourceCoordinator.lambda$start$1(SourceCoordinator.java:233)
at org.apache.flink.runtime.source.coordinator.SourceCoordinator.lambda$runInEventLoop$10(SourceCoordinator.java:469)
at org.apache.flink.util.ThrowableCatchingRunnable.run(ThrowableCatchingRunnable.java:40)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.postgresql.util.PSQLException: ERROR: all replication slots are in use
Hint: Free one or increase max_replication_slots.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:496)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:413)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:333)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:319)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:295)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:290)
at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.createReplicationSlot(PostgresReplicationConnection.java:442)
at com.ververica.cdc.connectors.postgres.source.enumerator.PostgresSourceEnumerator.createSlotForGlobalStreamSplit(PostgresSourceEnumerator.java:71)
... 11 more
while {}. Triggering job failover.

排查后问题后发现:flink每一个任务会创建一个slot进行数据解析,重启服务,以前的slot的active为变为false,但不会删除,导致槽位满了,新增slot无法加入,导致服务启动失败

解决方案:手动删除无用槽位。

  • 1、查看当前使用的复制槽及其状态
sql 复制代码
SELECT * FROM pg_replication_slots;
  • 2、删除复制槽
sql 复制代码
//  slot_name是你希望删除的复制槽的名称
SELECT * FROM pg_drop_replication_slot('slot_name');
相关推荐
辞--忧3 小时前
双十一美妆数据分析:洞察消费趋势与行业秘密
大数据
时序数据说9 小时前
国内时序数据库概览
大数据·数据库·物联网·时序数据库·iotdb
阿Paul果奶ooo12 小时前
Flink中基于时间的合流--双流联结(join)
大数据·flink
数据爬坡ing12 小时前
过程设计工具深度解析-软件工程之详细设计(补充篇)
大数据·数据结构·算法·apache·软件工程·软件构建·设计语言
计算机源码社14 小时前
分享一个基于Hadoop的二手房销售签约数据分析与可视化系统,基于Python可视化的二手房销售数据分析平台
大数据·hadoop·python·数据分析·毕业设计项目·毕业设计源码·计算机毕设选题
Direction_Wind14 小时前
Flinksql bug: Heartbeat of TaskManager with id container_XXX timed out.
大数据·flink·bug
计算机毕设残哥15 小时前
完整技术栈分享:基于Hadoop+Spark的在线教育投融资大数据可视化分析系统
大数据·hadoop·python·信息可视化·spark·计算机毕设·计算机毕业设计
轻流AI17 小时前
线索转化率翻3倍?AI重构CRM
大数据·人工智能·低代码·重构
最初的↘那颗心17 小时前
Java 泛型类型擦除
java·flink
Kay_Liang18 小时前
从聚合到透视:SQL 窗口函数的系统解读
大数据·数据库·sql·mysql·数据分析·窗口函数