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
RedHat or Centos -> Device Mapper
- 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 --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