Git Product home page Git Product logo

consul-getting-started's Introduction

consul-getting-started's People

Contributors

g0t4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

consul-getting-started's Issues

README and json locations

README details .json files residing in /vagrant directory.

These are not there. The files appear to be located under the sub-directories provision/*.d
On the assumption that the web.service.json is located there, I attempted to tun the consul agent on one of the web services. This failed:

consul agent -advertise $ip -config-file /vagrant/common.json -config-file /vagrant/provision//web-consul.d/web.service.json
==> Must specify data directory using -data-dir

dig not working on clients in AWS

Hello Wes,

Thank you for the awesome course. I have tried your examples. They work fine on Vagrant VM's but when I run the same on AWS with slight changes, I cannot dig or curl nodes/services from clients. I can on the server though.

I have the following server and client files for upstart and configuration. The upstart files are almost the same except I used -bind for the server. I modified the config files for AWS and I seem to be missing something for dig to work on localhost.

I ran the following commands from client
dig @localhost -p 8600 consul-server.node.consul :doesn't_work
dig @<server_ip> -p 8600 consul-server.node.consul :works

I am not sure if this is how it is supposed to work. I would like to know if we can dig from localhost instead of using server ip. By the way I am running 0.8.3. So something could have changed with the version too but it works on Vagrant.

server.json

 {
  "addresses" : {
    "dns": "0.0.0.0",
    "http": "0.0.0.0"
  },
  "client_addr": "0.0.0.0",
  "datacenter": "aws",
  "node_name": "consul-server",
  "server": true,
  "data_dir": "/var/lib/consul"
}

server.conf

description "Consul"

start on runlevel [2345]
stop on runlevel [!2345]

console log

script

 
  export GOMAXPROCS=`nproc`

  ip=$(ifconfig eth0 | grep 'inet addr' | awk '{ print substr($2,6) }')

  exec /usr/bin/consul agent -dev \
          -config-dir="/etc/consul.d" \
          -bind=${ip} \
          ${CONSUL_FLAGS}

end script

client.json

{
  "addresses" : {
    "dns": "0.0.0.0",
    "http": "0.0.0.0"
  },
  "client_addr": "0.0.0.0",
  "retry_join_ec2" : {
    "tag_key": "Name",
    "region": "us-east-1",
    "tag_value": "consul-server",
    "access_key_id": "Xxxxxxx",
    "secret_access_key": "yyyyyyyy"
  },
  "datacenter": "aws",
  "node_name": "consul-client",
  "data_dir": "/var/lib/consul"
}

client.conf

description "Consul"

start on runlevel [2345]
stop on runlevel [!2345]


console log

script

  
  export GOMAXPROCS=`nproc`

  ip=$(ifconfig eth0 | grep 'inet addr' | awk '{ print substr($2,6) }')

  exec /usr/bin/consul agent \
          -config-dir="/etc/consul.d" \
          -advertise ${ip} \
          ${CONSUL_FLAGS}

end script

Deploying Consul - Consul enterprise

Hello, I just started the Deploying Consul course, but I cannot see the option to create a new environment. What I can see if what I have attached.

Is it possible to work with Atlas and consul without paying?
screen shot 2017-04-14 at 2 48 09 pm

Thanks,

SSL read error: 104

Keep getting following error for vagrant up

Bringing machine 'consul-server' up with 'virtualbox' provider...
==> consul-server: Box 'wesmcclure/ubuntu1404-docker' could not be found. Attempting to find and install...
    consul-server: Box Provider: virtualbox
    consul-server: Box Version: >= 0
==> consul-server: Loading metadata for box 'wesmcclure/ubuntu1404-docker'
    consul-server: URL: https://vagrantcloud.com/wesmcclure/ubuntu1404-docker
==> consul-server: Adding box 'wesmcclure/ubuntu1404-docker' (v2.0.18) for provider: virtualbox
    consul-server: Downloading: https://vagrantcloud.com/wesmcclure/boxes/ubuntu1404-docker/versions/2.0.18/providers/virtualbox.box
==> consul-server: Box download is resuming from prior download progress
    consul-server: Download redirected to host: vagrantcloud-files-production.s3.amazonaws.com
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

SSL read: error:00000000:lib(0):func(0):reason(0), errno 104

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "wesmcclure/ubuntu1404-docker"

  config.vm.define "consul-server" do |cs|
    cs.vm.hostname = "consul-server"
    cs.vm.network "private_network", ip: "172.20.20.31"
  end
end

vagrant box `boxcutter/ubuntu1404-docker` seems unavailable

Looking at the atlas page it looks like it's gone:
https://atlas.hashicorp.com/boxcutter

Not sure why it's been delisted, but searching issues at boxcutter indicates that they may not be interested in building docker images anymore: boxcutter/ubuntu#49

As a workaround, I just added the docker install steps to the vagrant provisioning step. Something like this:

sudo apt-get -y update
sudo apt-get -y install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get -y update
sudo apt-get -y install docker-engine

Failed to create the host-only adapter

Vagrant file detail:
Vagrant.configure("2") do |config|
config.vm.box = "wesmcclure/ubuntu1404-docker"

config.vm.define "consul-server" do |cs|
cs.vm.hostname = "consul-server"
cs.vm.network "private_network", ip: "172.20.20.31"
end
end

F:\workspace\consul>vagrant up
Bringing machine 'consul-server' up with 'virtualbox' provider...
==> consul-server: Importing base box 'wesmcclure/ubuntu1404-docker'...
==> consul-server: Matching MAC address for NAT networking...
==> consul-server: Checking if box 'wesmcclure/ubuntu1404-docker' is up to date...
==> consul-server: Setting the name of the VM: consul_consul-server_1509732179552_56577
==> consul-server: Fixed port collision for 22 => 2222. Now on port 2200.
==> consul-server: Clearing any previously set network interfaces...
There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: E_INVALIDARG
VBoxManage.exe: error: Failed to create the host-only adapter
VBoxManage.exe: error: Assertion failed: [!aInterfaceName.isEmpty()] at 'F:\tinderbox\win-5.0\src\VBox\Main\src-server\HostNetworkInterfaceImpl.cpp' (74) in long __cdecl HostNetworkInterface::init(class com::Bstr,class com::Bstr,class com::Guid,enum __MIDL___MIDL_itf_VirtualBox_0000_0000_0036).
VBoxManage.exe: error: Please contact the product vendor!
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreate(struct HandlerArg *)" at line 71 of file VBoxManageHostonly.cpp

F:\workspace\consul>vagrant ssh consul-server
VM must be running to open SSH connection. Run vagrant up
to start the virtual machine

Install script fails with macOS Big Sur

Error: caskroom/cask was moved. Tap homebrew/cask instead.
โžœ ~ brew tap homebrew/cask

Old code:
brew tap caskroom/cask

Fixed code:
brew tap homebrew/cask

Error: Error: Cask 'consul' is unavailable: No Cask with this name exists.
Old code:
brew cask install vagrant consul

Fixed code:
brew install vagrant consul

Error: homebrew/completions was deprecated. This tap is now empty and all its contents were either deleted or migrated.
Remove code:
brew tap homebrew/completions

Initial Configs Fail

consul agent fails initially because common.json missing "retry_join" and also access denied because data_dir set to /opt/consul.

dc1 Datacenter?

I've noticed that the upstart.conf has a variable to pass along for the consul process.
However, using consul 0.7.0, the process spins up with dc = "consul", which means that no configuration is passing the string "dc1" (I've tried searching the repo, but couldn't find it)

Using Consul 0.7.1 on my "desktop" node, the process starts up as 'dc1'. I assume then that this minor change in behavior could confuse a few people.
Wouldn't be better to explicitly set the datacenter 'dc1'?

PS: Great courses, keep up the good work!

i/o timeout with port 8301

Following through course.
Got consul-server up and running
consul agent -dev -advertise 172.20.20.31

Tried next step of running agent from desktop (mac)
consul agent -config-file desky.json

Get timeout errors and

   2017/02/28 21:50:00 [INFO] serf: EventMemberJoin: neelamari 172.20.20.1
    2017/02/28 21:50:00 [WARN] manager: No servers available
    2017/02/28 21:50:00 [ERR] agent: failed to sync remote state: No known Consul servers
    2017/02/28 21:50:00 [INFO] agent: Joining cluster...
    2017/02/28 21:50:00 [INFO] agent: (LAN) joining: [172.20.20.31]
    2017/02/28 21:50:10 [INFO] agent: (LAN) joined: 0 Err: 1 error(s) occurred:

* Failed to join 172.20.20.31: dial tcp 172.20.20.31:8301: i/o timeout
    2017/02/28 21:50:10 [WARN] agent: Join failed: <nil>, retrying in 30s
    2017/02/28 21:50:24 [WARN] manager: No servers available
    2017/02/28 21:50:24 [ERR] agent: failed to sync remote state: No known Consul servers

Is there any needs to open ports in the server. The default image seems to have firewall disabled. Appreciate help.

consul 0.7.2

Hello,
Your course is great and everything works fine, but I wanted to change to a more recent version of Consul and connection (for your exercise 2) doesn't work between the server one and local node.

Do you have any idea, what I would have to change to make it work?

Thank you

Best regards,

Unable to update list of packages on consul-server

~/Documents/training/consul-course ยป cat Vagrantfile
1 Vagrant.configure("2") do |config|
2 config.vm.box = "wesmcclure/ubuntu1404-docker"
3
4 config.vm.define "consul-server" do |cs|
5 cs.vm.hostname = "consul-server"
6 cs.vm.network "private_network", ip: "172.20.20.31"
7 end
8
9 end

Error:
vagrant@consul-server:~$ sudo apt-get update -y
Err http://security.ubuntu.com trusty-security InRelease

Err http://security.ubuntu.com trusty-security Release.gpg
Could not resolve 'security.ubuntu.com'
Err http://us.archive.ubuntu.com trusty InRelease

Err http://us.archive.ubuntu.com trusty-updates InRelease

Err http://us.archive.ubuntu.com trusty-backports InRelease

Err http://us.archive.ubuntu.com trusty Release.gpg
Could not resolve 'us.archive.ubuntu.com'
Err http://us.archive.ubuntu.com trusty-updates Release.gpg
Could not resolve 'us.archive.ubuntu.com'
Err http://us.archive.ubuntu.com trusty-backports Release.gpg
Could not resolve 'us.archive.ubuntu.com'
Ign https://apt.dockerproject.org ubuntu-trusty InRelease
Ign https://apt.dockerproject.org ubuntu-trusty Release.gpg
Ign https://apt.dockerproject.org ubuntu-trusty Release
Err https://apt.dockerproject.org ubuntu-trusty/main amd64 Packages
Could not resolve host: apt.dockerproject.org
Ign https://apt.dockerproject.org ubuntu-trusty/main Translation-en_US
Ign https://apt.dockerproject.org ubuntu-trusty/main Translation-en
Reading package lists... Done
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg Could not resolve 'security.ubuntu.com'

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Could not resolve 'us.archive.ubuntu.com'

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg Could not resolve 'us.archive.ubuntu.com'

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg Could not resolve 'us.archive.ubuntu.com'

W: Failed to fetch https://apt.dockerproject.org/repo/dists/ubuntu-trusty/main/binary-amd64/Packages Could not resolve host: apt.dockerproject.org

W: Some index files failed to download. They have been ignored, or old ones used instead.

Any ideas? Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.