GithubHelp home page GithubHelp logo

Comments (3)

tifayuki avatar tifayuki commented on August 15, 2024

In a services , all the containers are treated equally. You cannot set some containers are with a backup option while others are not.

What you can do is to create another service for backup purpose, and set the one you want to backup with EXTRA_SETTINGS=server backup BACKUP_SERVICE:PORT backup

from dockercloud-haproxy.

gomap-us avatar gomap-us commented on August 15, 2024

Thanks for the feedback @tifayuki ! After digging around in a couple of the python scripts I found the _merge_services_with_same_vhost function which was indeed causing my backup service to get merged with my primary service. To get around this I added a fake entry into my backup's VIRTUAL_HOST so the services wouldn't get merged, and then made use of the EXTRA_SETTINGS variable you suggested (but it only worked right if I added it to the primary service in the stackfile). Also had to throw in some VIRTUAL_HOST_WEIGHT entries to make sure the primary service was used over the backup service when both were available. Still need to do a bit more testing, but this stackfile appears to be working well on docker cloud so far.

proxytest-web:
  image: 'dockercloud/hello-world:latest'
  target_num_containers: 1
  environment:
    - NAME=Live
    - EXTRA_SETTINGS=server Replica proxytest-web-failover:80 backup check
    - VIRTUAL_HOST=http://full_endpoint.domain.for_proxy_service_goes_here.svc.dockerapp.io
    - VIRTUAL_HOST_WEIGHT=10
  expose:
    - '80'
  restart: always
  tags:
    - proxytest_live
proxytest-web-failover:
  image: 'dockercloud/hello-world:latest'
  target_num_containers: 1
  environment:
    - NAME=Replica
    - VIRTUAL_HOST=http://full_endpoint.domain.for_proxy_service_goes_here.svc.dockerapp.io,http://www.trickhaproxyintogroupingthisintoitsownservice.com
    - VIRTUAL_HOST_WEIGHT=1
  expose:
    - '80'
  restart: always
  tags:
    - proxytest_replica
proxytest:
  image: dockercloud/haproxy:latest
  deployment_strategy: every_node
  tags:
    - proxytest
  restart: always
  roles:
    - global
  ports:
    - "80:80"
    - "1936:1936"
  environment:
     - STATS_AUTH=stats:stats
  links:
    - proxytest-web-failover
    - proxytest-web

from dockercloud-haproxy.

LoungeFlyZ avatar LoungeFlyZ commented on August 15, 2024

Just wanted to say THANKS! for figuring this out. I wanted to do the same thing and your solution works very nicely. Thanks again.

from dockercloud-haproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.