Skip to content

Instantly share code, notes, and snippets.

@judavi
Created May 20, 2018 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judavi/5c426f7629404a34eb05cd597d465c21 to your computer and use it in GitHub Desktop.
Save judavi/5c426f7629404a34eb05cd597d465c21 to your computer and use it in GitHub Desktop.
Docker Certified Associate Prep Course

Docker Swarm

Swarm manager (N+2 for qurom) Docker daemon and discovery service . Just one no fault tolerance Swarm workers (1 to N)

Installation yum install -y yum-utils device-mapper-persisten-data lvm2 yum-config manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum update yum install docker-ce systemctl enable docker && systemctl start docker && systemctl status docker #creating the symlink, running the service

Then we should add our user to the docker group cd var/run ls -al docker.sock (the service is own by the root)

usermode -aG docker --user-- then login in and out

Selecting a Storage Driver

RedHat or Centos -> Device Mapper

  1. tell Docker wich will be the storage addapter : docker info (storage driver susbsystem) docker info | grep Storage

How to configure

etc/docker/daemon.json { "storage-driver": "devicemapper" }

restart docker systemctl stop docker && systemctl start docker

Docker files : /var/lib/docker

Configuring Logging Drivers (Syslog, JSON-File, etc.)

docker logs nameofthecontainer

/etc/rsyslog.conf --> tail -f /var/log/messages off course systemctl start rsyslogs using syslog sModLod imudp sUDPServer 514

in daemon { "log-driver":"syslog", "log-opts": { "syslog-address" : "udp://172.31.125.216:514" } }

Docker swarm init

docker swarm init --advertise-addr 172.31.16.218

how to join ? docker swarm join-token flkjkdsjfhskdf ipaddressmaster:port

to check the token again : docker swarm join --token worker

And if is another manager: docker swarm join-token manager

docker node ls

Outline the Sizing Requirements Prior to Installation

Complete Backups for UCP and DTR

Namespaces and CGroups

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment