我有一個簡單的撰寫文件,其中我有三個服務A,B和C.A和B都依賴於C(即對C具有links
)。這裏的簡化摘自docker-compose.yml
:多主機Docker在Swarm上撰寫應用程序
kafka:
image: spotify/kafka
environment:
ADVERTISED_PORT: 9092
ports:
- "2181:2181"
- "9092:9092"
ServiceA:
image: elsoufy/myimage
command: ./mycommand -role producer -queue kafka:9092
ports:
- "8080"
ServiceB:
image: elsoufy/myimage
command: ./mycommand -role consumer -queue kafka:9092
我設置在AWS上泊塢窗羣並啓用覆蓋通過領事密鑰存儲網絡。我一直在努力爭取一段時間才能正常工作(我必須手動將機器的內核升級到linux 3.16)。
我使用泊塢1.9
Client:
Version: 1.9.0
API version: 1.21
Go version: go1.4.3
Git commit: 76d6bc9
Built: Tue Nov 3 19:20:09 UTC 2015
OS/Arch: darwin/amd64
Server:
Version: 1.9.0
API version: 1.21
Go version: go1.4.3
Git commit: 76d6bc9
Built: Tue Nov 3 19:20:09 UTC 2015
OS/Arch: linux/amd64
我可以成功啓動與docker-compose up -d
,但ServiceA
和ServiceB
崩潰許多嘗試連接到kafka
,因爲他們無法找到它後撰寫的。當我嘗試使用顯式links
並啓用覆蓋爲這個應用程序I get an error:
docker-compose --x-networking --x-network-driver=overlay up
links, which are not compatible with Docker networking and will be ignored. Future versions of Docker will not support links - you should remove them for forwards-compatibility.
它看起來像我不能使用links
當我想啓用多主機!但是,那麼我如何運行一個組合應用程序,在這裏我已經在容器之間建立了依賴關係,並在碼頭羣上擴展了容器?
docker 1.9中的新網絡功能使用共享網絡上的IP主機發現來代替鏈接。請參閱以下答案:http://stackoverflow.com/questions/33785804/docker-networking-on-single-host-with-compose/33791395#33791395 –
此消息只是一個警告(不是錯誤)。我認爲它應該在郵件上有一個「警告」前綴,對吧?它只是在複製/粘貼中被切斷。 – dnephin
@dnephin我沒有完整的信息,我在看到問題後的一天發佈了此主題。 – bachr