2017-02-10 70 views
1

我試圖安裝在碼頭工人的Elasticsearch集羣遵循本指南:https://sematext.com/blog/2016/12/12/docker-elasticsearch-swarm/多克爾版本1.13.1,多克爾羣,jwilder/nginx的代理將無法啓動的碼頭工人服務

但我一直獲得創建jwilder/nginx-proxy服務後,有關/tmp/docker.sock的錯誤。下面的控制檯剪輯來自新安裝並更新的CentOS7。我這裏的操作說明安裝通過yum泊塢窗:https://docs.docker.com/engine/installation/linux/centos/

[[email protected]]# docker -v 
Docker version 1.13.1, build 092cba3 
[[email protected]]# 
[[email protected]]# docker service create --mode global \ 
> --name proxy -p 80:80 \ 
> --network elasticsearch-frontend \ 
> --network elasticsearch-backend \ 
> --mount type=bind,bind-propagation=rshared,src=/var/run/docker.sock,target=/tmp/docker.sock:ro \ 
> jwilder/nginx-proxy 
xbhj4rzjyuu0k8maf1ha5fmgs 
[[email protected]]# docker service ls 
ID   NAME MODE REPLICAS IMAGE 
xbhj4rzjyuu0 proxy global 0/1  jwilder/nginx-proxy:latest 
[[email protected]]# docker ps -a 
CONTAINER ID  IMAGE                       COMMAND     CREATED    STATUS      PORTS    NAMES 
7ba303e0f8b6  jwilder/[email protected]:9a2d63aad9068f817c705965f41f2f32fa0bbef6b217ae5c9b2340ef23e3dcba "/app/docker-entry..." 2 seconds ago  Created           proxy.kifcc5gbdcxz5ixsbx7sl1cv8.zuizhtt7q94nluuudlgjgy1yi 
2fe655a93aa4  jwilder/[email protected]:9a2d63aad9068f817c705965f41f2f32fa0bbef6b217ae5c9b2340ef23e3dcba "/app/docker-entry..." 10 seconds ago  Exited (1) 3 seconds ago      proxy.kifcc5gbdcxz5ixsbx7sl1cv8.baqn1204spbw5v6qxx6qjx327 
7894fd0e1dee  jwilder/[email protected]:9a2d63aad9068f817c705965f41f2f32fa0bbef6b217ae5c9b2340ef23e3dcba "/app/docker-entry..." 18 seconds ago  Exited (1) 11 seconds ago      proxy.kifcc5gbdcxz5ixsbx7sl1cv8.6s9u0q0y1kjelebszheius2es 
51840cca0d32  jwilder/[email protected]:9a2d63aad9068f817c705965f41f2f32fa0bbef6b217ae5c9b2340ef23e3dcba "/app/docker-entry..." 26 seconds ago  Exited (1) 19 seconds ago      proxy.kifcc5gbdcxz5ixsbx7sl1cv8.wlwy723ts9kw00sgyu3s5f985 
d52fd18567a9  jwilder/[email protected]:9a2d63aad9068f817c705965f41f2f32fa0bbef6b217ae5c9b2340ef23e3dcba "/app/docker-entry..." 34 seconds ago  Exited (1) 27 seconds ago      proxy.kifcc5gbdcxz5ixsbx7sl1cv8.wa5jk9xnly1tdxpbvonnjmoty 
[[email protected]]# docker logs 2fe655a93aa4 
ERROR: you need to share your Docker host socket with a volume at /tmp/docker.sock 
Typically you should run your jwilder/nginx-proxy with: `-v /var/run/docker.sock:/tmp/docker.sock:ro` 
See the documentation at http://git.io/vZaGJ 
[[email protected]]# 

時,作爲使用-v選項安裝docker.sock一個容器中推出的jwilder/nginx的代理容器的作品。

我已經搜索谷歌(Docker文檔,jwilder/nginx-proxy git)尋找什麼會導致這一點,我什麼都沒有得到。有沒有人看到錯誤?我是碼頭工人,所以也許我錯過了一些簡單的東西。

在此先感謝! :-)

回答

1

而不是使/var/run/docker.sock/tmp/docker.sock的只讀掛載,而是將/var/run/docker.sock掛載到/tmp/docker.sock:ro,因此應用程序會發出吶喊聲。

要糾正此問題,請稍作修改。替換...

--mount type=bind,bind-propagation=rshared,src=/var/run/docker.sock,target=/tmp/docker.sock:ro 

...有:

--mount type=bind,bind-propagation=rshared,src=/var/run/docker.sock,target=/tmp/docker.sock,ro=1 

documentation

只讀或RO:發動機支承結合和卷讀寫除非 只讀選項在安裝綁定或卷時給出。當爲真 或1或無值時,綁定或卷將以只讀方式掛載。當錯誤 或0時,綁定或卷被掛載爲讀寫。

+0

謝謝!我知道我錯過了一些愚蠢的東西。 :-) – eeach