2014-04-11 00:34:10 +00:00
|
|
|
# Vagrant Consul Demo
|
|
|
|
|
2016-11-21 17:49:59 +00:00
|
|
|
This demo provides a very simple `Vagrantfile` that creates two Consul
|
|
|
|
server nodes, one at *172.20.20.10* and another at *172.20.20.11*. Both are
|
|
|
|
running a standard Debian * distribution, and Consul is pre-installed.
|
2014-04-11 00:34:10 +00:00
|
|
|
|
2016-11-21 17:49:59 +00:00
|
|
|
To get started, you can start the nodes by just doing:
|
2014-04-11 00:34:10 +00:00
|
|
|
|
2016-11-21 17:49:59 +00:00
|
|
|
```
|
|
|
|
vagrant up
|
|
|
|
```
|
|
|
|
|
|
|
|
> NOTE: If you prefer a different Vagrant box, you can set the `DEMO_BOX_NAME`
|
2017-01-13 16:03:10 +00:00
|
|
|
> environment variable before starting `vagrant` like this:
|
2016-11-21 17:49:59 +00:00
|
|
|
> `DEMO_BOX_NAME="ubuntu/xenial64" vagrant up`
|
2014-04-11 00:34:10 +00:00
|
|
|
|
|
|
|
Once it is finished, you should be able to see the following:
|
|
|
|
|
2016-11-21 17:49:59 +00:00
|
|
|
```
|
|
|
|
vagrant status
|
|
|
|
Current machine states:
|
|
|
|
|
|
|
|
n1 running (virtualbox)
|
|
|
|
n2 running (virtualbox)
|
|
|
|
```
|
2014-04-11 00:34:10 +00:00
|
|
|
|
|
|
|
At this point the two nodes are running and you can SSH in to play with them:
|
|
|
|
|
2016-11-21 17:49:59 +00:00
|
|
|
```
|
|
|
|
vagrant ssh n1
|
|
|
|
consul version
|
2017-01-13 16:03:10 +00:00
|
|
|
Consul v0.7.2
|
2016-11-21 17:49:59 +00:00
|
|
|
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)
|
|
|
|
exit
|
|
|
|
```
|
|
|
|
|
|
|
|
and
|
|
|
|
|
|
|
|
```
|
|
|
|
vagrant ssh n2
|
|
|
|
consul version
|
2017-01-13 16:03:10 +00:00
|
|
|
Consul v0.7.2
|
2016-11-21 17:49:59 +00:00
|
|
|
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)
|
|
|
|
exit
|
|
|
|
```
|
2014-04-11 00:34:10 +00:00
|
|
|
|
2017-01-13 16:03:10 +00:00
|
|
|
> NOTE: This demo will install the latest Consul release version by default,
|
|
|
|
> but if you prefer a different version, you can set the `CONSUL_DEMO_VERSION`
|
|
|
|
> environment variable before starting `vagrant` like this:
|
|
|
|
> `CONSUL_DEMO_VERSION=0.6.4 vagrant up`
|
|
|
|
|
2016-11-21 17:49:59 +00:00
|
|
|
## Where to Next?
|
2014-04-11 00:34:10 +00:00
|
|
|
|
2017-01-13 16:03:10 +00:00
|
|
|
To learn more about starting Consul, joining nodes into a cluster, and
|
2016-11-21 17:49:59 +00:00
|
|
|
interacting with the agent, check out the [Getting Started guide](https://www.consul.io/intro/getting-started/install.html).
|