# 事务协调器不可用异常：事务协调器不可用

- **ID:** `kafka/transaction-coordinator-not-available`
- **领域:** kafka
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 82%

## 根因

作为事务ID的事务协调器的代理已关闭或不可达。

## 解决方案

1. ```
   检查代理健康状况，必要时重启协调器代理：在受影响的代理上执行 systemctl restart kafka。
   ```
2. ```
   增加 transaction.timeout.ms 以给协调器更多时间恢复，例如 props.put("transaction.timeout.ms", "900000");
   ```
3. ```
   等待协调器可用并使用指数退避重试事务。
   ```

## 无效尝试

- **** — Restarting the application without ensuring the coordinator broker is healthy will retrigger the error. (90% 失败率)
- **** — Changing the transactional.id in config causes the producer to be fenced and lose transaction state. (85% 失败率)
