IT

프로덕션에서 Docker 컨테이너를 확장하는 방법

lottoking 2020. 6. 21. 19:12
반응형

프로덕션에서 Docker 컨테이너를 확장하는 방법


최근에이 멋진 도구를 발견했습니다.

Docker는 모든 응용 프로그램에서 가볍고 휴대 가능하며 자급 자족 컨테이너를 쉽게 만들 수있는 오픈 소스 프로젝트입니다. 개발자가 랩톱에서 빌드하고 테스트하는 것과 동일한 컨테이너는 규모, 프로덕션, VM, 베어 메탈, OpenStack 클러스터, 퍼블릭 클라우드 등에서 실행될 수 있습니다.

Nginx를 실행하는 도커 이미지가 있고 웹 사이트가 외부 데이터베이스에 연결되어 있다고 가정 해 봅시다. 프로덕션 환경에서 컨테이너를 어떻게 확장합니까?


업데이트 : 2019-03-11

우선 수년 동안이 답변을지지 해 주신 분들께 감사드립니다.

Docker가 여전히 매우 새로운 기술이었던 2013 년 8 월에이 질문이 제기되었습니다. 그 이후 : Kubernetes 는 2014 년 6 월에 출시되었으며 Docker swarm 은 2015 년 2 월에 Docker 엔진에 통합되었으며, Amazon은 2015 년 4 월에 컨테이너 솔루션 ECS를 출시했으며 , 2015 년 8 월 Google은 GKE출시했습니다 . 크게 변경되었습니다.


짧은 대답은 이것을하기 위해 자신의 논리를 작성해야한다는 것입니다.

이러한 종류의 기능은 도커 위에 구축되고 프로덕션 응용 프로그램을 지원하도록 설계된 다음 프로젝트에서 나타날 것으로 기대합니다.

업데이트 1

내가 최근에 발견 한 다른 관련 프로젝트 :

업데이트 2

최신 릴리스 Openstack에는 Docker 컨테이너 관리를 지원합니다.

업데이트 3

Docker 인스턴스 관리 시스템

그리고 Packer , Docker 및 Serf같은 도구를 사용 하여 불변의 서버 인프라 패턴을 제공하는 방법에 대한 프레젠테이션

업데이트 4

serf를 사용하여 도커 컨테이너를 연결하는 방법에 대한 깔끔한 기사 :

업데이트 5

Marathon 프레임 워크를 사용하여 Mesos에서 Docker 실행

Mesosphere Docker 개발자 튜토리얼

업데이트 6

docker-cluster분리 된 스케줄러 배포를 지원하므로 Tsuru 에서 Docker를 실행하십시오.

업데이트 7

도커 기반 환경 오케스트레이션

마에스트로

업데이트 8

decking.io

업데이트 9

구글 쿠 버네 티스

업데이트 10

Redhat은 Openshift PAAS를 리팩터링하여 Docker를 통합했습니다.

업데이트 11

Docker 명령 줄을 래핑하고 json 파일에서 관리하는 Docker NodeJS lib

업데이트 12

Amazon의 새로운 컨테이너 서비스를 통해 클러스터를 확장 할 수 있습니다.

업데이트 13

엄밀히 말하면 Flocker 는 응용 프로그램을 "확장"하지 않지만 여러 도커 호스트에서 상태 저장 컨테이너 (데이터베이스 서비스 실행 중)를 이식 가능하게 만드는 관련 기능을 수행하도록 설계되었습니다.

https://clusterhq.com/

업데이트 14

A project to create portable templates that describe Docker applications:

http://panamax.io/

Update 15

The Docker project is now addressing orchestration natively (See announcement)

Update 16

Spotify Helios

See also:

Update 17

The Openstack project now has a new "container as a service" project called Magnum:

Shows a lot of promise, enables the easy setup of Docker orchestration frameworks like Kubernetes and Docker swarm.

Update 18

Rancher is a project that is maturing rapidly

http://rancher.com/

Nice UI and strong focus on hyrbrid Docker infrastructures

Update 19

The Lattice project is an offshoot of Cloud Foundry for managing container clusters.

Update 20

Docker recently bought Tutum:

https://www.docker.com/tutum

Update 21

Package manager for applications deployed on Kubernetes.

http://helm.sh/

Update 22

Vamp is an open source and self-hosted platform for managing (micro)service oriented architectures that rely on container technology.

http://vamp.io/

Update 23

A Distributed, Highly Available, Datacenter-Aware Scheduler

From the guys that gave us Vagrant and other powerful tools.

Update 24

Container hosting solution for AWS, open source and based on Kubernetes

https://supergiant.io/

Update 25

Apache Mesos based container hosted located in Germany

https://sloppy.io/features/#features

And Docker Inc. also provide a container hosting service called Docker cloud

https://cloud.docker.com/

Update 26

Jelastic is a hosted PAAS service that scales containers automatically.


Deis automates scaling of Docker containers (among other things).

Deis (pronounced DAY-iss) is an open source PaaS that makes it easy to deploy and manage applications on your own servers. Deis builds upon Docker and CoreOS to provide a lightweight PaaS with a Heroku-inspired workflow.

Here is the developer workflow:

deis create myapp                      # create a new deis app called "myapp"
git push deis master                   # built with a buildpack or dockerfile
deis scale web=16 worker=4             # scale up docker containers

Deis automatically deploys your Docker containers across a CoreOS cluster and configures the Nginx routers to route requests to healthy Docker containers. If a host dies, containers are automatically restarted on another host in seconds. Just browse to the proxy URL or use deis open to hit your app.

Some other useful commands:

deis config:set DATABASE_URL=          # attach to a database w/ an envvar
deis run make test                     # run ephemeral containers for one-off tasks
deis logs                              # get aggregated logs for troubleshooting
deis rollback v23                      # rollback to a prior release

To see this in action, check out the terminal video at http://deis.io/overview/. You can also learn about Deis concepts or jump right into deploying your own private PaaS.


You can try Tsuru. Tsuru is a opensource PaaS inspired in Heroku, and it is already with some products in production at Globo.com(internet arm of the biggest Broadcast Television Company in Brazil)

It manages the entire flow of an application, since the container creation, deploy, routing(with hipache) with many nice features as docker cluster, scaling of units, segregated deploy, etc.

Take a look in our documentation bellow: http://docs.tsuru.io/

Here our post covering our environment: http://blog.tsuru.io/2014/04/04/running-tsuru-in-production-scaling-and-segregating-docker-containers/


Have a look at Rancher.com - it can manage multiple Docker hosts and much more.


A sensible approach to scaling Docker could be:

  1. Each service will be a docker container
  2. Intra container service discovery managed through links (new feature from docker 0.6.5)
  3. Containers will be deployed through Dokku
  4. Applications will be managed through Shipyard which in its turn is using hipache

Another docker open sourced project from Yandex:


Openshift guys also created a project. You can find more information here, try test container and detailed info here . The only problem is the solution is Redhat centric for now :)


While we're big fans of Deis (deis.io) and are actively deploying to it, there are other Heroku like PaaS style deployment solutions out there, including:

Longshoreman from the Wayfinder folks:

https://github.com/longshoreman/longshoreman

Decker from the CloudCredo folks, using CloudFoundry:

http://www.cloudcredo.com/decker-docker-cloud-foundry/

As for straight up orchestration, NewRelic's opensource Centurion project seems quite promising:

https://github.com/newrelic/centurion


Take a look also at etcd and Consul.


Panamax: Docker Management for Humans. panamax.io

Fig: Fast, isolated development environments using Docker. fig.sh


One option not mentioned in other posts is Helios. It is built by spotify and does not try to do too much.

https://github.com/spotify/helios

참고URL : https://stackoverflow.com/questions/18285212/how-to-scale-docker-containers-in-production

반응형