Skip to content

Commit

Permalink
hack: introduce a insta-discovery script
Browse files Browse the repository at this point in the history
This sets up a localhost cluster via a new discovery token. Very useful
for testing.
  • Loading branch information
Brandon Philips committed Oct 7, 2014
1 parent 3ca3c9a commit ef0ed31
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/machine*
/bin
.vagrant
/*_etcd_data
*_etcd_data
etcd
*.swp
/hack/insta-discovery/.env
1 change: 1 addition & 0 deletions hack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Various hacks that are used by developers.
4 changes: 4 additions & 0 deletions hack/insta-discovery/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Use goreman to run `go get github.com/mattn/goreman`
etcd1: ../../bin/etcd -name node1 -listen-client-urls http://127.0.0.1:4001 -advertise-client-urls http://127.0.0.1:4001 -listen-peer-urls http://127.0.0.1:7001 -advertise-peer-urls http://127.0.0.1:7001
etcd2: ../../bin/etcd -name node2 -listen-client-urls http://127.0.0.1:4002 -advertise-client-urls http://127.0.0.1:4002 -listen-peer-urls http://127.0.0.1:7002 -advertise-peer-urls http://127.0.0.1:7002
etcd3: ../../bin/etcd -name node3 -listen-client-urls http://127.0.0.1:4003 -advertise-client-urls http://127.0.0.1:4003 -listen-peer-urls http://127.0.0.1:7003 -advertise-peer-urls http://127.0.0.1:7003
1 change: 1 addition & 0 deletions hack/insta-discovery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Starts a cluster via the discovery service on your local machine. Useful for testing.
7 changes: 7 additions & 0 deletions hack/insta-discovery/discovery
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

disc=$(curl https://discovery.etcd.io/new?size=3)
echo ETCD_DISCOVERY=${disc} > .env
echo "setup discovery start your cluster"
cat .env
goreman start

0 comments on commit ef0ed31

Please sign in to comment.