Tag:

etcd用户名密码与docker守护程序参数

我想通过docker守护进程参数–cluster-store来设置etcd连接。 对于我们的etcd,我们必须提供用户名和密码。 我没有看到提供这些信息的方法。 我怎样才能通过etcd身份validation凭据? 如果我不能通过docker守护进程传递它们,那么传递这些信息的另一种方法是什么? 我search了所有,只发现了一种连接客户端证书的方式,但这不会帮助我,因为我使用的etcd服务没有办法提供该信息。

如果没有shell,我怎么能从运行官方etcd映像的docker容器中获取文件?

我有一个docker容器,它运行的是CoreOS的etcd docker镜像,可以在这里find: https ://quay.io/repository/coreos/etcd。 我想要做的就是复制保存在etcd数据目录中的所有文件。 我尝试使用docker exec -it etcd /bin/sh连接到容器,但似乎没有shell( /bin/bash , /bin/sh ),或者至less不能在$PATHvariables。 我怎样才能进入图像或获取本地复制的etcd内的所有数据文件?

etcd2服务将不会在群集上启动

我正在启动一个核心操作系统集群。 3个节点已经启动,可以curl到https://discovery.etcd.io/XYZ ,每个节点都可以查看其他节点,YAML如下所示: curl https://discovery.etcd.io/*****70c50e2e9efb644 "action":"get","node":{"key":"/_etcd/registry/****8070c50e2e9efb644","dir":true,"nodes":[{"key":"/_etcd/registry/*****38070c50e2e9efb644/****fb2be24","value":"4e0f92950de64ebe8f343fd99eafc784=http://*****:2380","modifiedIndex":990603568,"createdIndex":990603568},{"key":"/_etcd/registry/862080a02e3e8f38070c50e2e9efb644/*****2930998b","value":"****91d8f554955e=http://******:2380","modifiedIndex":990612624,"createdIndex":990612624},{"key":"/_etcd/registry/*****c50e2e9efb644/***1257987a","value":"****c994f6493e0ff9214f22c2b=http://******:2380","modifiedIndex":990618969,"createdIndex":990618969}],"modifiedIndex":990598000,"createdIndex":990598000 journalctl -u etcd2 -f 两个节点显示: the server is already initialized as member before, starting as etcd member… 而第三个节点只显示它实际上在做什么: Jan 31 10:52:58 core-os03 etcd2[723]: ***1257987a [logterm: 1, index: 3] sent vote request to ****30998b at term 3727 Jan 31 10:52:58 core-os03 etcd2[723]: ***257987a [logterm: 1, index: 3] sent vote request […]

如何与etcd或consul一起使用kong服务器?

我想用kong来pipe理微服务或API,但是kong找不到用dockerbuild立的新的微服务。 所以能和etcd或领事一起工作吗?

在Docker上运行etcd v3时出错

当我尝试在Docker上运行etcd(版本3.0.0)时: sudo docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \ –name etcd quay.io/coreos/etcd:v3.0.0 \ -name etcd0 \ -advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 \ -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \ -initial-advertise-peer-urls http://${HostIP}:2380 \ -listen-peer-urls http://0.0.0.0:2380 \ -initial-cluster-token etcd-cluster-1 \ -initial-cluster etcd0=http://${HostIP}:2380 \ -initial-cluster-state new 我有一个错误: docker: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: […]

Docker忽略入口点

运行下面的docker命令有一些奇怪的错误: docker run -d \ –network="etcd" \ –ip 172.28.0.4 \ -v $(pwd)/etcd01:/etc/ssl/certs \ -p 4001:4001 -p 2380:2380 -p 2379:2379 \ –hostname etcd01 \ –name etcd01 quay.io/coreos/etcd:latest \ -name etcd01 \ -advertise-client-urls http://172.28.0.4:2379,http://172.28.0.4:4001 \ -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \ -initial-advertise-peer-urls http://172.28.0.4:2380 \ -listen-peer-urls http://0.0.0.0:2380 \ -initial-cluster etcd01=http://172.28.0.4:2380,etcd01=http://172.28.0.2:2380,etcd02=http://172.28.0.3:2380 \ -initial-cluster-state new 在etcd的Dockerfile中定义了一个ENTRYPOINT 。 Docker文档说,映像名称后的所有内容都作为parameter passing给入口点。 那为什么不呢? 我得到如下错误: docker: Error […]

Shell脚本 – “等待”不等待所有进程完成

在shell脚本中,我正在构build一些docker镜像(在后台),一旦完成,我正在运行它们(在后台),然后我必须等待所有这些完成。 代码如下所示: for tag in "${tags[@]}" do docker build -f dockerFilePath -t $tag . & done wait for tag in "${tags[@]}" do docker run $tag arg1 arg2 | tee logoutput & done wait 问题是不是第二个等待部分中的所有docker run命令都能够完成。 docker运行命令需要不同的时间才能完成,其中任何一个都是不完整的(总共4个)。 此外,我读了这个等待只适用于进程调用wait的直接subprocess,在这种情况下,我认为所有的docker build和docker run命令都是脚本进程的直接subprocess。 或者是错误的假设?

Docker Swarm与etcd

如果Swarm模式下的Docker具有内置的发现系统,那么使用另一个类似etcd的服务发现来运行Swarm模式有什么优势呢?

在python Docker容器中执行wait-for-it.sh

我有一个Pythondocker容器,需要等到另一个容器(postgres服务器)完成设置。 我尝试了标准的wait-for-it.sh,但没有包含几个命令。 我尝试了一个基本的睡眠(再次在一个sh文件中),但现在报告exec: 300: not found试图终于执行我正在等待的命令时exec: 300: not found 。 我如何解决这个问题(最好不要改变图像,或者不得不扩展图像)。 我知道我也可以运行一个Python脚本,但理想情况下,我想使用wait-for-it.sh来等待服务器启动而不只是睡眠。 Dockerfile(用于填充): FROM python:2.7.13 ADD ./stuff/bin /usr/local/bin/ ADD ./stuff /usr/local/stuff WORKDIR /usr/local/bin COPY requirements.txt /opt/updater/requirements.txt COPY internal_requirements.txt /opt/stuff/internal_requirements.txt RUN pip install -r /opt/stuff/requirements.txt RUN pip install -r /opt/stuff/other_requirements.txt 泊坞窗,compose.yml: version: '3' services: local_db: build: ./local_db ports: – "localhost:5432:5432" stuffer: build: ./ depends_on: – local_db […]

如何在docker中运行etcd集群使用ansible?

我试图在docker中通过ansible运行etcd集群。 我使用docker_container ansible模块,这是我所拥有的: – name: Run etcd KV node docker_container: name: "etcd0" image: quay.io/coreos/etcd network_mode: host command: [ "/usr/local/bin/etcd", \ "-name etcd0", \ "-advertise-client-urls http://{{ ansible_default_ipv4['address'] }}:2379,http://{{ ansible_default_ipv4['address'] }}:4001", \ "-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001", \ "-initial-advertise-peer-urls http://{{ ansible_default_ipv4['address'] }}:2380", \ "-initial-cluster etcd0=http://{{ ansible_default_ipv4['address'] }}:2380", \ "-initial-cluster-token etcd-cluster", \ "-listen-peer-urls http://0.0.0.0:2380", \ "-initial-cluster-state new" ] 这个工作在单一模式下,但是由于有etcd参数-initial-cluster应该包含所有节点,例如在3个节点的情况下,多于1个节点出现问题: -initial-cluster etcd0=http://192.168.12.50:2380,etcd1=http://192.168.12.51:2380,etcd2=http://192.168.12.52:2380 […]