-
Notifications
You must be signed in to change notification settings - Fork 588
[Bug] Docker setup broken on macOS/Windows — network_mode: host replaced with bridge networking (single-node + 3-node cluster) #2951
Description
Bug Type (问题类型)
others (please edit later)
Before submit
- 我已经确认现有的 Issues 与 FAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
Environment (环境信息)
PR is based on master branch (miscommunication in issue description).
Docker Desktop on macOS and Windows
Deployment method docker compose single node configuration
File docker-compose.yml
Expected & Actual behavior (期望与实际表现)
Expected Behavior
Single node cluster starts normally
Actual Behavior
Server stuck printing Hugegraph server are waiting for storage backend
Server logs show UNAVAILABLE io exception
Store reports {"leaderCount":0,"partitionCount":0}
Cluster never becomes usable even though containers run
Description
The single node Docker setup uses network_mode host. This works only on Linux.
On macOS and Windows, Docker Desktop does not support host networking the same way.
Containers fall back to bridge networking but service configuration still assumes localhost style addresses.
PD and Store advertise gRPC endpoints as 0.0.0.0 or 127.0.0.1.
These are bind addresses, not reachable service addresses inside Docker networking.
Other containers cannot connect, causing PD client failures and preventing partition creation.
Root Cause
network_mode host is Linux only
Docker Desktop ignores or emulates it differently
Services advertise non routable addresses
Server fails to communicate with PD
Fix
Switch to bridge networking and container hostnames.
docker-compose.yml
Remove network_mode host
Use default bridge network
Add environment override hugegraph.pd.peers=pd:8686
docker/pd-conf/application.yml
grpc.host set to pd
raft.address set to pd:8610
raft.peers-list set to pd:8610
initial-store-list set to store:8500
docker/store-conf/application.yml
grpc.host set to store
raft.address set to store:8510
pdserver.address=pd:8686
Why This Works
Bridge networking is cross platform
Docker resolves container names automatically
Services advertise reachable addresses
Result After Fix
PD reachable via pd:8686
Store registers as store:8500
Partitions created normally
Server reachable on localhost 8080
Related fixes discovered during this work:
| Bug | Issue | Fix |
|---|---|---|
getLeaderGrpcAddress() NPE in bridge mode |
#2959 | #2961 |
IpAuthHandler hostname vs IP mismatch |
#2960 | #2962 |
| 'Docker Logs' Not Working | #2979 | #2980 |
Changes Checklist
- Added / verified required port mappings
- Updated Docker networking configuration
- Adjusted service communication to use container hostnames
- Validated environment-based configuration
- Verified PD, Store, and Server containers start correctly
- Confirmed single-node cluster reaches healthy state
- Confirmed partition assignment and leader election
- Validated multi-node (3-node) cluster deployment
- Tested on macOS (Apple M4)
- Fixed server startup timeout to allow partition assignment to complete
- Verified PD, Store and Server healthchecks pass on both single and 3-node
- Test on Linux
- Fixed
IpAuthHandlerhostname vs IP resolution (fix(pd): resolve hostname entries in IpAuthHandler allowlist #2962) - Fixed
getLeaderGrpcAddress()NPE (fix(pd): add timeout and null-safety to getLeaderGrpcAddress() #2961) - Removed static IP workaround after
IpAuthHandlerfix - Update Docker images to reflect entrypoint changes chore(docker): remove tmp volume mounts after image update #2976
- Update in-repo documentation — docs: update Docker deployment docs for bridge networking migration #2963
- Fix docker Logs - fix(docker): enable docker logs for pd/store/server containers #2980
- Update documentation (follow-up PR to hugegraph-doc) — doc: add docker-compose guide and update deployment docs hugegraph-doc#455
Metadata
Metadata
Assignees
Labels
Type
Projects
Status