Skip to content

Instantly share code, notes, and snippets.

@davisford
Last active May 4, 2017 16:59
Show Gist options
  • Save davisford/aa440c9973bf72b12a5ba4af96b1c1b3 to your computer and use it in GitHub Desktop.
Save davisford/aa440c9973bf72b12a5ba4af96b1c1b3 to your computer and use it in GitHub Desktop.
Quick nats cluster
docker run -it --rm -p 4222:4222 -p 6222:6222 -p 8222:8222 --name nats-main nats
docker run -it --rm --name=nats-2 --link nats-main nats --cluster=nats://0.0.0.0:6222 --routes=nats-route://ruser:T0pS3cr3t@nats-main:6222
docker run -it --rm --name=nats-3 --link nats-main nats --cluster=nats://0.0.0.0:6222 --routes=nats-route://ruser:T0pS3cr3t@nats-main:6222
You now have a 3-node nats cluster. See http://localhost:8222/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment