docker-swarm

Prometheus dns service discovery in docker swarm

て烟熏妆下的殇ゞ 提交于 2019-12-01 03:03:17
问题 I'm searching for some monitor & alert solutions for my services. I found following nice related works. Prometheus monitoring for docker swarm Monitoring a docker swarm cluster with Prometheus Both works use dns service discovery to monitor multiple replicas of services. I've tried to replay these work, but I found I can only get single backend container ip. # dig A node-exporter ; <<>> DiG 9.10.4-P8 <<>> A node-exporter ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY,

Docker swarm run tasks only in workers

只谈情不闲聊 提交于 2019-12-01 01:27:49
问题 Say that we are working in swarm mode and we have three nodes: manager1 worker1 worker2 Is it possible to create a service and specify that the tasks only has to run in the workers (worker1 and worker2) and not in the managers (manager1) I am running the following command to create the service: docker-machine ssh manager1 "docker service create --network dognet --name dog-db redis" and when I ps the service: docker-machine ssh manager1 "docker service ps dog-db" I get: ID NAME IMAGE NODE

使用Docker构建持续集成与自动部署的Docker集群

二次信任 提交于 2019-11-30 18:30:22
为什么使用Docker 从我个人使用的角度讲的话 部署来的更方便 只要构建过一次环境 推送到镜像仓库 迁移起来也是分分钟的事情 虚拟化让集群的管理和控制部署都更方便 hub.docker.com 里面的镜像也很方便 节约了很多自己生成镜像的时间 相当于提高了复用率 安装Docker 我这里使用 Ubuntu 14.04 系统上安装 curl -s https://get.docker.com/ | sudo sh Ubuntu 其他版本可能需要先升级一下内核 详细可参考 这里 构建持续集成环境(Java) 下来开始我们今天的主题 构建持续集成与自动部署的Docker集群 持续集成的目的 让我们每次更新了代码提交到git仓库后就自动运行测试构建新版本 自动部署到测试或集群 从来提高生产效率 告别重复的劳动 持续集成和部署的原理 我们用到的所有基础设施我们都将使用Docker 部署 1. 推送到git 仓库 2. jenkine pull git代码 运行 编译镜像 进行编译 3. 打包生成的代码 生成一个新版本的镜像 推送到仓库 删除当前容器 重新运行新版本镜像 4. 监控系统 5 docker log 集中管理 LEK 本文使用的是Java的构建方式 除了第三步以外 其他工程也都是一样的 构建Gitlab Gitlab作为代码仓库是我们环节的第一步 ( 如果使用github

What is overlay network and how does DNS resolution work?

瘦欲@ 提交于 2019-11-30 18:02:50
I cannot connect to external mongodb server from my docker swarm cluster. As I understand this is because of cluster uses overlay network driver. Am I right? If not, how does docker overlay driver works and how can I connect to external mongodb server from cluster? François Maturel Q. How does the docker overlay driver work? I would recommend this good reference for understanding docker swarm network overlay, and more globally, Docker's architecture . This states that: Docker uses embedded DNS to provide service discovery for containers running on a single Docker Engine and tasks running in a

dockerd vs docker-containerd vs docker-runc vs docker-containerd-ctr vs docker-containerd-shim

元气小坏坏 提交于 2019-11-30 10:27:16
问题 This stuff is really getting confused now. Can someone please explain what's going on. Just the straight one liner difference. dockerd libcontainerd containerd docker-containerd docker-runc docker-containerd-ctr docker-containerd-shim thanks 回答1: dockerd - The Docker daemon itself. The highest level component in your list and also the only 'Docker' product listed. Provides all the nice UX features of Docker. (docker-)containerd - Also a daemon, listening on a Unix socket, exposes gRPC

What is overlay network and how does DNS resolution work?

一曲冷凌霜 提交于 2019-11-30 01:12:12
问题 I cannot connect to external mongodb server from my docker swarm cluster. As I understand this is because of cluster uses overlay network driver. Am I right? If not, how does docker overlay driver works and how can I connect to external mongodb server from cluster? 回答1: Q. How does the docker overlay driver work? I would recommend this good reference for understanding docker swarm network overlay, and more globally, Docker's architecture. This states that: Docker uses embedded DNS to provide

docker swarm how to find out why service can't start

血红的双手。 提交于 2019-11-29 20:18:51
I often have problems because a service that I deploy on docker swarm with multiple nodes won't start and there are not logs generated that I can look at with docker service logs {serviceName} There are many possible reasons for a service not to start such as Can't download image from registry Constraints that can't be fulfilled I have trouble finding out why a container won't start. I found the command docker service ps {serviceName} which List the tasks of one or more services and a short error message (if there was an error). However when I try to inspect the task with docker service logs

How to configure autoscaling on docker swarm?

非 Y 不嫁゛ 提交于 2019-11-29 20:17:51
I would like to know how to configure this tool to start with a minimum number of nodes and grow to a maximum number of nodes when it is required. Should I use another tool or can docker swarm solve this for me? Short answer : There is no easy way to do this with Docker Swarm for now. Docker Swarm (or Swarm mode) does not support auto-scaling machines out of the box. You'd need to use another solution for that like docker-machine to create machines (with docker) on your infrastructure and link these to the existing Swarm cluster (with docker swarm join ). This will involve a lot of scripting

How can I remotely connect to docker swarm?

社会主义新天地 提交于 2019-11-29 18:28:32
问题 Is it possible to execute commands on a docker swarm cluster hosted in cloud from my local mac? If yes, how? I want to execute command such as following on docker swarm from my local: docker create secret my-secret <address to local file> docker service create --name x --secrets my-secret image 回答1: Answer to the question can be found here. What one needs to do for ubuntu machine is define daemon.json file at path /etc/docker with following content: { "hosts": ["tcp://0.0.0.0:2375", "unix://

Troubles using docker-machine to setup Swarm

我与影子孤独终老i 提交于 2019-11-29 05:12:52
I have a problem with deploying local virtualbox based swarm - I have followed the instructions in the official docker documentation regarding setting up master/worker nodes using the docker-machine tool. I have created the token on dockerhub and used --swarm (and --swarm-master) with --swarm-discovery token://XXXX ... so far so good, two machines running, seemingly registered as the Swarm master and worker: spaceback@brutus:~$ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS swarm-master * (swarm) virtualbox Running tcp://192.168.99.100:2376 swarm-master (master) v1.12.0