_example

command
Version: v0.0.0-...-3763b7f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2017 License: MIT Imports: 7 Imported by: 0

README

Example for go distribution

What does this test ?

This is a simple master/node example compiled in only one binary and launched in deveral docker containers.

Each node container will have is own ip address, and will register to "master:10000". Docker allows node to contact "master" with that name that is registered in docker-compose.yml file

By scaling up and down "node" containers, you'll see registration and deletion.

Curl command on "/sum" endpoint will give you the "Arith.Sum" call response using random integers.

How to

To make that test:

cd $GOPATH/github.com/metal3d/_example
make build
docker-compose up -d
docker-compose logs

Open a second terminal and try:

for i in $(seq 4); do curl -s localhost:10000/sum  & done; wait

You can scale up nodes, in the terminal where you launched docker-compose:

CTRL+C # stop logs
docker-compose scale node=4
docker-compose logs

And redo the command in second terminal:

for i in $(seq 4); do curl -s localhost:10000/sum  & done; wait

You can scale-down, and retry again...

To stop and cleanup docker:

CTRL+C
docker-compose down -v

Documentation

The Go Gopher

There is no documentation for this package.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL