9ebf343673a9c1f66df18f77ca0fbc42a47b8cdb
redis\345\223\250\345\205\265\346\250\241\345\274\217\345\234\272\346\231\257\346\265\213\350\257\225.md
| ... | ... | @@ -449,6 +449,16 @@ panic: dial tcp 192.168.184.122:6380: connectex: No connection could be made bec |
| 449 | 449 | at io.netty.channel.AbstractChannel$AbstractUnsafe.write(Object, ChannelPromise)(Unknown Source) |
| 450 | 450 | ``` |
| 451 | 451 | |
| 452 | +消费异常: |
|
| 453 | + |
|
| 454 | +``` |
|
| 455 | +2025/08/13 17:58:17 消费错误: dial tcp 192.168.184.122:6380: connectex: No connection could be made because the target machine actively refused it. |
|
| 456 | +2025/08/13 17:58:28 消费错误: dial tcp 192.168.184.122:6380: connectex: No connection could be made because the target machine actively refused it. |
|
| 457 | +2025/08/13 17:58:37 消费错误: dial tcp 192.168.184.122:6380: connectex: No connection could be made because the target machine actively refused it. |
|
| 458 | +``` |
|
| 459 | + |
|
| 460 | +在实际业务中,需要主动 catch 住异常,防止整个服务挂掉,并做重试,而且无休止的重试,直到成功。 |
|
| 461 | + |
|
| 452 | 462 | 待选主成功后,异常终止,redis恢复正常。 |
| 453 | 463 | |
| 454 | 464 |