Giter Site home page Giter Site logo

docker-nomad's Introduction

docker-nomad

##Nomad Agent in Docker This project is a Docker container for Nomad that is pre-configured Nomad Agent made specifically to work in the Docker ecosystem.

##Getting the container The container is very small and based on Alpine base image.

docker pull aatarasoff/nomad           //base image
docker pull aatarasoff/nomad-server    //server pre-configured image
docker pull aatarasoff/nomad-client    //client pre-configured image

##Using the container

###Standalone

docker run -d --net host --name nomad \
  -p 4646:4646 -p 4646:4646/udp \
  -p 4647:4647 -p 4647:4647/udp \
  -p 4648:4648 -p 4648:4648/udp \
  -v /var/run/docker.sock:/var/run/docker.sock \
  aatarasoff/nomad -dev -bind=<your_binding_ip_address>

Standalone configuration is recommended for developing only.

###Clustering First you need to run three server nodes on different machines. Each node is running like:

docker run -d --net host --name nomad \
  -p 4646:4646 -p 4646:4646/udp \
  -p 4647:4647 -p 4647:4647/udp \
  -p 4648:4648 -p 4648:4648/udp \
  -v /var/run/docker.sock:/var/run/docker.sock \
  aatarasoff/nomad-server -bind=<your_binding_ip_address>

Next step is joining nodes number two and three to node number one:

docker exec nomad nomad server-join -address http://<node2_ip>:4646 <node1_ip>:4648
docker exec nomad nomad server-join -address http://<node3_ip>:4646 <node1_ip>:4648

Or you may use HTTP API for this. Next step is launch clients:

docker run -d --net host --name nomad \
  -p 4646:4646 -p 4646:4646/udp \
  -p 4647:4647 -p 4647:4647/udp \
  -p 4648:4648 -p 4648:4648/udp \
  -v /var/run/docker.sock:/var/run/docker.sock \
  aatarasoff/nomad-client -bind=<your_binding_ip_address> -servers http://<node1_ip>:4647

Check that client nodes is available:

curl <node1_ip>/v1/nodes

###Run example task Try your configuration with example task on one of the server nodes:

docker exec nomad nomad init
docker exec nomad nomad run -address=http://<node_ip>:4646 example.nomad

Check that redis container is launched on client nodes.

##Enjoy!

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.