Difference between revisions of "Docker Swarm Classic"

From berki WIKI
Jump to: navigation, search
Line 12: Line 12:
  
  
A régi swarm használatához szükség van egy 'discovery' szolgáltatásra. Ezek közül kettőt emelnék ki:  
+
Bármelyik megoldást is választjuk a swarm cluster létrehozására, szükség van egy discovery szolgáltatóra, ahova a node-ok regisztrálják magukat. A master a discovery szolgáltatót folyamatosan poll-ozza, hogy hozzájusson az aktuális member listához.
* token: egy
+
 
 +
 
 +
Két discovery szolgáltatásra térnék ki.
 +
Forrás1: https://docs.docker.com/swarm/discovery/#docker-hub-as-a-hosted-discovery-service<br>
 +
Forrás2: https://docs.docker.com/swarm/reference/manage/
 +
* token: A DockerHub által nyújtott, ingyenes discovery szolgáltatás. Produkciós környezetbe nagyon nem ajánlott.
 +
* consul: A Consul egy ingyenes, lokálisan futó discovery szolgáltatás, ezt írja magáról: "Consul is a distributed service mesh to connect, secure, and configure services across any runtime platform and public or private cloud Service registry, integrated health checks, and DNS and HTTP interfaces enable any service to discover and be discovered by other services"
 +
 
 +
 
 +
==Swarm cluster DockerHub discovery service használatával==
 +
 
 +
 
 +
==Swarm cluster 'Consul' használatával==
 +
 
 +
 
 +
 
 +
=Cluster vizsgálata=
  
 
<pre>
 
<pre>

Revision as of 21:09, 4 July 2018

<< Back to Orchestration main



https://docs.docker.com/swarm/reference/manage/


There are two main options for creating swarm classic cluster.

  1. We create the physical or virtual environment, and install docker manually. Then the nodes must be added to the cluster also manually.
  2. We use the docker-machine command with the --swarm options to create new VMs that are part of the swarm cluster out of the box.


Bármelyik megoldást is választjuk a swarm cluster létrehozására, szükség van egy discovery szolgáltatóra, ahova a node-ok regisztrálják magukat. A master a discovery szolgáltatót folyamatosan poll-ozza, hogy hozzájusson az aktuális member listához.


Két discovery szolgáltatásra térnék ki. Forrás1: https://docs.docker.com/swarm/discovery/#docker-hub-as-a-hosted-discovery-service
Forrás2: https://docs.docker.com/swarm/reference/manage/

  • token: A DockerHub által nyújtott, ingyenes discovery szolgáltatás. Produkciós környezetbe nagyon nem ajánlott.
  • consul: A Consul egy ingyenes, lokálisan futó discovery szolgáltatás, ezt írja magáról: "Consul is a distributed service mesh to connect, secure, and configure services across any runtime platform and public or private cloud Service registry, integrated health checks, and DNS and HTTP interfaces enable any service to discover and be discovered by other services"


Swarm cluster DockerHub discovery service használatával

Swarm cluster 'Consul' használatával

Cluster vizsgálata

# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                    NAMES
4d6e01c1b7ce        swarm:latest        "/swarm join --adver…"   6 minutes ago       Up 6 minutes        2375/tcp                                 worker1/swarm-agent
116582ce7e0c        swarm:latest        "/swarm join --adver…"   9 minutes ago       Up 9 minutes        2375/tcp                                 swarm-master/swarm-agent
88440d8e5e1b        swarm:latest        "/swarm manage --tls…"   9 minutes ago       Up 9 minutes        2375/tcp, 192.168.42.35:3376->3376/tcp   swarm-master/swarm-agent-master


# docker info
Containers: 3
 Running: 3
 Paused: 0
 Stopped: 0
Images: 2
Server Version: swarm/1.2.9
Role: primary
Strategy: spread
Filters: health, port, containerslots, dependency, affinity, constraint, whitelist
Nodes: 2
 swarm-master: 192.168.42.35:2376
  └ ID: UVDV:W5VI:NRDU:25KM:43GY:2ZL6:AIBL:TKKL:ASEG:JSMM:6DI5:NLLN|192.168.42.35:2376
  └ Status: Healthy
  └ Containers: 2 (2 Running, 0 Paused, 0 Stopped)
  └ Reserved CPUs: 0 / 1
  └ Reserved Memory: 0 B / 1.021 GiB
  └ Labels: kernelversion=4.9.93-boot2docker, operatingsystem=Boot2Docker
  └ UpdatedAt: 2018-07-04T20:45:47Z
  └ ServerVersion: 18.05.0-ce
 worker1: 192.168.42.181:2376
  └ ID: SMB3:EZOK:OZJ7:22W6:3PBB:ZLCF:BUFA:VYMU:PLH5:RWBT:2E7D:GAOT|192.168.42.181:2376
  └ Status: Healthy
  └ Containers: 1 (1 Running, 0 Paused, 0 Stopped)
  └ Reserved CPUs: 0 / 1
  └ Reserved Memory: 0 B / 1.021 GiB
  └ Labels: kernelversion=4.9.93-boot2docker,