You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Docker Swarm多主机链码部署时join命令报grpc连接不可用错误求助

Troubleshooting Docker Swarm Join "grpc: the connection is unavailable" Error

Let's walk through the most common fixes for this issue when trying to add PC2 to your Swarm cluster:

  • First, fix the command syntax (critical!)
    Looking at the join command you copied:

    docker swarm join — token SWMTKN-1–3as8cvf3yxk8e7zj98954jhjza3w75mngmxh543llgpo0c8k7z-61zyibtaqjjimkqj8p6t9lwgu 172.16.0.153:2377
    

    Notice the — before token is a full-width Chinese dash instead of two half-width dashes (--). This is a common copy-paste error that breaks the command entirely. Correct it to:

    docker swarm join --token SWMTKN-1-3as8cvf3yxk8e7zj98954jhjza3w75mngmxh543llgpo0c8k7z-61zyibtaqjjimkqj8p6t9lwgu 172.16.0.153:2377
    

    (Also double-check the token string itself for any extra spaces or corrupted characters.)

  • Verify network connectivity between PC1 and PC2
    Docker Swarm requires three ports to be open on the manager node (PC1):

    • 2377/TCP (Swarm management communications)
    • 7946/TCP/UDP (Node discovery)
    • 4789/UDP (Overlay network traffic)
      On PC2, test if you can reach port 2377 on PC1 using:
    nc -zv 172.16.0.153 2377
    # Or on Windows:
    telnet 172.16.0.153 2377
    

    If this fails, check:

    • PC1's firewall settings (allow incoming traffic on the three ports above)
    • PC2's firewall settings (allow outgoing traffic to those ports)
    • Whether the two PCs are on the same network or if a router/firewall is blocking traffic between them
  • Check the Swarm manager's status on PC1
    On PC1, run these commands to confirm the manager node is healthy:

    docker node ls
    docker info | grep -A 5 Swarm
    

    You should see the manager listed as Ready and Active in the output. If it's not, restart the Docker service on PC1 with systemctl restart docker (Linux) or restart Docker Desktop (Windows/macOS), then reinitialize the Swarm if needed.

  • Ensure Docker version consistency
    Major version mismatches between the manager (PC1) and worker (PC2) can cause compatibility issues. Run docker --version on both PCs to check. If versions are far apart, update Docker on one or both machines to match.

  • Check system clock synchronization
    Grpc relies on accurate time for TLS and session validation. If PC1 and PC2 have significant clock drift, this can break connections. On Linux, use timedatectl to check sync status; on Windows, use w32tm /query /status. Sync both machines to a common NTP server if needed.

内容的提问来源于stack exchange,提问作者pjs

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:46:00