mirror of https://github.com/hashicorp/consul
Remove demo directory
This demo setups are no longer maintained. See https://github.com/hashicorp/demo-consul-101 for a maintained demo.pull/11686/head
parent
29c791c90e
commit
282c8dccf0
|
@ -1,34 +0,0 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
|
||||
consul-agent-1: &consul-agent
|
||||
image: consul:latest
|
||||
networks:
|
||||
- consul-demo
|
||||
command: "agent -retry-join consul-server-bootstrap -client 0.0.0.0"
|
||||
|
||||
consul-agent-2:
|
||||
<<: *consul-agent
|
||||
|
||||
consul-agent-3:
|
||||
<<: *consul-agent
|
||||
|
||||
consul-server-1: &consul-server
|
||||
<<: *consul-agent
|
||||
command: "agent -server -retry-join consul-server-bootstrap -client 0.0.0.0"
|
||||
|
||||
consul-server-2:
|
||||
<<: *consul-server
|
||||
|
||||
consul-server-bootstrap:
|
||||
<<: *consul-agent
|
||||
ports:
|
||||
- "8400:8400"
|
||||
- "8500:8500"
|
||||
- "8600:8600"
|
||||
- "8600:8600/udp"
|
||||
command: "agent -server -bootstrap-expect 3 -ui -client 0.0.0.0"
|
||||
|
||||
networks:
|
||||
consul-demo:
|
|
@ -1,57 +0,0 @@
|
|||
# Vagrant Consul Demo
|
||||
|
||||
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 *the latest version* of Consul
|
||||
is pre-installed.
|
||||
|
||||
To get started, you can start the nodes by just doing:
|
||||
|
||||
```
|
||||
vagrant up
|
||||
```
|
||||
|
||||
> NOTE: If you prefer a different Vagrant box, you can set the `DEMO_BOX_NAME`
|
||||
> environment variable before starting `vagrant` like this:
|
||||
> `DEMO_BOX_NAME="ubuntu/xenial64" vagrant up`
|
||||
|
||||
Once it is finished, you should be able to see the following:
|
||||
|
||||
```
|
||||
vagrant status
|
||||
Current machine states:
|
||||
|
||||
n1 running (virtualbox)
|
||||
n2 running (virtualbox)
|
||||
```
|
||||
|
||||
At this point the two nodes are running and you can SSH in to play with them:
|
||||
|
||||
```
|
||||
vagrant ssh n1
|
||||
consul version
|
||||
Consul v0.7.5
|
||||
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
|
||||
Consul v0.7.5
|
||||
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)
|
||||
exit
|
||||
```
|
||||
|
||||
> NOTE: This demo will query the HashiCorp Checkpoint service to determine
|
||||
> the latest Consul release version and install that version by default,
|
||||
> but if you need a different Consul version, set the `CONSUL_DEMO_VERSION`
|
||||
> environment variable before `vagrant up` like this:
|
||||
> `CONSUL_DEMO_VERSION=0.6.4 vagrant up`
|
||||
|
||||
## Where to Next?
|
||||
|
||||
To learn more about starting Consul, joining nodes into a cluster, and
|
||||
interacting with the agent, check out the [Getting Started guide](https://www.consul.io/intro/getting-started/install.html).
|
|
@ -1,56 +0,0 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
$script = <<SCRIPT
|
||||
|
||||
echo "Installing dependencies ..."
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y unzip curl jq dnsutils
|
||||
|
||||
echo "Determining Consul version to install ..."
|
||||
CHECKPOINT_URL="https://checkpoint-api.hashicorp.com/v1/check"
|
||||
if [ -z "$CONSUL_DEMO_VERSION" ]; then
|
||||
CONSUL_DEMO_VERSION=$(curl -s "${CHECKPOINT_URL}"/consul | jq .current_version | tr -d '"')
|
||||
fi
|
||||
|
||||
echo "Fetching Consul version ${CONSUL_DEMO_VERSION} ..."
|
||||
cd /tmp/
|
||||
curl -s https://releases.hashicorp.com/consul/${CONSUL_DEMO_VERSION}/consul_${CONSUL_DEMO_VERSION}_linux_amd64.zip -o consul.zip
|
||||
|
||||
echo "Installing Consul version ${CONSUL_DEMO_VERSION} ..."
|
||||
unzip consul.zip
|
||||
sudo chmod +x consul
|
||||
sudo mv consul /usr/bin/consul
|
||||
|
||||
sudo mkdir /etc/consul.d
|
||||
sudo chmod a+w /etc/consul.d
|
||||
|
||||
SCRIPT
|
||||
|
||||
# Specify a Consul version
|
||||
CONSUL_DEMO_VERSION = ENV['CONSUL_DEMO_VERSION']
|
||||
|
||||
# Specify a custom Vagrant box for the demo
|
||||
DEMO_BOX_NAME = ENV['DEMO_BOX_NAME'] || "debian/stretch64"
|
||||
|
||||
# Vagrantfile API/syntax version.
|
||||
# NB: Don't touch unless you know what you're doing!
|
||||
VAGRANTFILE_API_VERSION = "2"
|
||||
|
||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
config.vm.box = DEMO_BOX_NAME
|
||||
|
||||
config.vm.provision "shell",
|
||||
inline: $script,
|
||||
env: {'CONSUL_DEMO_VERSION' => CONSUL_DEMO_VERSION}
|
||||
|
||||
config.vm.define "n1" do |n1|
|
||||
n1.vm.hostname = "n1"
|
||||
n1.vm.network "private_network", ip: "172.20.20.10"
|
||||
end
|
||||
|
||||
config.vm.define "n2" do |n2|
|
||||
n2.vm.hostname = "n2"
|
||||
n2.vm.network "private_network", ip: "172.20.20.11"
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue