apache / apache/incubator-seata
希望支持 Nacos 注册端口与监听端口分离(Docker 主机端口映射)
- Dominant language
- Java
- Stars
- 26k
- Forks
- 8.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 4
Description
### Check Ahead
- [x] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate.
- [x] I am willing to try to implement this feature myself.
### Why you need it?
## 背景 / Background
在 Docker 中部署 Seata Server 时,通常使用端口映射,例如 `-p 21908:8091`。
希望 Seata 在容器内监听 8091,但向 Nacos 注册的地址为宿主机 IP:21908,
以便客户端通过宿主机端口 21908 连接。
## 问题 / Problem
目前 `SEATA_PORT` 和 `seata.server.service-port` 会同时影响监听端口和注册端口,
无法做到“监听端口”与“注册端口”分离。
### How it could be?
## 建议 / Suggestion
支持 `seata.registry.nacos.ip` 和 `seata.registry.nacos.port` 配置,
当配置时优先使用这两个值作为向 Nacos 注册的地址,
否则保持现有行为(使用监听地址和端口)。
### Other related information
## 使用场景 / Use Case
- Docker 端口映射:容器内 8091,宿主机暴露 21908
- 防火墙仅开放 21908,客户端通过 IP:21908 访问
- 需要 Nacos 中注册为 IP:21908,而不是 8091
Contributor guide
Research direction
Locate the handling for SEATA_PORT and seata.server.service-port, then trace the Nacos registration path and its address configuration. Check how the proposed seata.registry.nacos.ip and seata.registry.nacos.port should override registration values while leaving the container listener unchanged. Done means Docker-mapped deployments register the host IP and mapped port, while existing behavior remains unchanged without overrides.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100