[英]Docker swarm - Manager node cannot access the containers in worker node
[英]Docker Swarm: deploy containers on Worker node
我正在嘗試在多個實例上部署應用程序。 在主節點上,我使用了這些命令:
docker swarm init
docker network create --attachable --driver overlay fabric
docker stack deploy --compose-file docker-compose-org2.yaml fabric
並且該服務已部署在主節點上並正常運行。
現在我有另一個名為: docker-compose-orderer.yaml
撰寫文件,我想將其部署在其他 AWS 實例上。
我在worker node
上使用了以下命令:
docker swarm join --token SWMTKN-1-29jg0j594eluoy8g86dniy3opax0jphhe3a4w3hjuvglekzt1b-525ene2t4297pgpxp5h5ayf89 <IP>:2377
docker stack deploy --compose-file docker-compose-org1.yaml fabric
它命令docker stack deploy --compose-file docker-compose-org1.yaml fabric
說this node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again
this node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again
有誰知道如何在工作節點中部署撰寫文件?
任何幫助/建議將不勝感激。
更新 1:
工作節點成功加入群管理器。
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
qz9y7p1ba3prp23xtuv3uo2dk ip-172-31-18-206 Ready Active 18.06.1-ce
no97mrg6f7eftbbeu86xg88d9 * ip-172-31-40-235 Ready Active Leader 18.06.1-ce
您必須在管理器節點上應用所有docker service
和docker stack
命令。 它將在較少使用的節點上自動部署容器。 當您想在特定節點上顯式部署容器時,您必須標記該節點並使用約束。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.