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');
相关推荐
A小弈同学37 分钟前
新规则,新游戏:AI时代下的战略重构与商业实践
大数据·人工智能·重构·降本增效·电子合同
字节跳动数据平台2 小时前
一客一策:Data Agent 如何重构大模型时代的智能营销?
大数据·agent
用户Taobaoapi20143 小时前
京东图片搜索相似商品API开发指南
大数据·数据挖掘·数据分析
镭眸3 小时前
因泰立科技:用激光雷达重塑智能工厂物流生态
大数据·人工智能·科技
IT研究室5 小时前
大数据毕业设计选题推荐-基于大数据的贵州茅台股票数据分析系统-Spark-Hadoop-Bigdata
大数据·hadoop·spark·毕业设计·源码·数据可视化·bigdata
Lx3526 小时前
Hadoop异常处理机制:优雅处理失败任务
大数据·hadoop
小嵌同学6 小时前
Linux:malloc背后的实现细节
大数据·linux·数据库
IT毕设梦工厂8 小时前
大数据毕业设计选题推荐-基于大数据的国家基站整点数据分析系统-Hadoop-Spark-数据可视化-BigData
大数据·hadoop·spark·毕业设计·源码·数据可视化
江瀚视野8 小时前
苹果要在抖音上卖iPhone了?苹果看上了抖音什么?
大数据
微三云-轩8 小时前
区块链系统:解决549 亿元积分商城是否违法的问题
大数据·小程序·重构·区块链·生活