run.sh 834 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. rm -rf /tmp/m1.data /tmp/m2.data /tmp/m3.data
  3. /etc/init.d/bind9 start
  4. # get rid of hosts so go lookup won't resolve 127.0.0.1 to localhost
  5. cat /dev/null >/etc/hosts
  6. goreman -f /insecure/Procfile start &
  7. # TODO: remove random sleeps
  8. sleep 7s
  9. ETCDCTL_API=3 ./etcdctl \
  10. --endpoints=http://m1.etcd.local:2379 \
  11. endpoint health --cluster
  12. ETCDCTL_API=3 ./etcdctl \
  13. --endpoints=http://m1.etcd.local:2379,http://m2.etcd.local:22379,http://m3.etcd.local:32379 \
  14. put abc def
  15. ETCDCTL_API=3 ./etcdctl \
  16. --endpoints=http://m1.etcd.local:2379,http://m2.etcd.local:22379,http://m3.etcd.local:32379 \
  17. get abc
  18. # TODO: add host header check to enforce same-origin-policy
  19. curl -L http://127.0.0.1:2379/v2/keys/queue \
  20. -XPOST \
  21. -d value=Job1
  22. curl -L http://m1.etcd.local:2379/v2/keys/queue \
  23. -XPOST \
  24. -d value=Job1