foremand
= foreman
+ etcd
This short example assumes foremand, etcd and etcdctl are installed locally.
-
Start a
etcd
cluster in dev mode:$ etcd
-
Write data to the key in
etcd
:$ ETCDCTL_API=3 etcdctl put host1/app "python -m SimpleHTTPServer 8001" OK
-
Register to
etcd
:$ foremand -endpoints=http://127.0.0.1:2379 -prefix=host1 INFO[0000] Initialing foremand endpoints="[http://127.0.0.1:2379]" prefix=host1 INFO[0000] Starting foremand INFO[0000] forking app=host1/app shell="python -m SimpleHTTPServer 8001"
-
Test
app
connectivity:$ curl http://127.0.0.1:8001 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html> <title>Directory listing for /</title> <body> <h2>Directory listing for /</h2> ... </body> </html>