Giter Site home page Giter Site logo

Comments (3)

isuftin avatar isuftin commented on May 29, 2024

Note: This is being done in CentOS-65

from consul.

isuftin avatar isuftin commented on May 29, 2024

An update. I've figured out a decent Vagrantfile that works. The issue described above is when you feed an array of servers to a cluster that may not yet exist. (e.g. ["10.0.0.10","10.0.0.11","10.0.0.12"] ). If those servers don't exist, the consul service will not restart properly. I would consider this a bug but I don't know whether it's a bug in the cookbook or in the consul application itself.

Anyway, my Vagrantfile that works well to bring up 3 cluster nodes and a client node. The clusters are limited to 256M of RAM as I don't need them any larger. The CentOS image is one we Packer'd for our org but is essentially the base CentOS 6.6. The client is given the full server list since by the time the client comes up (unless Vagrant Up is done via --parallel) the cluster nodes are up and ready for connections. I bind the consul services to eth1 as those offer the 10.0.0.x address instead of eth0 which offers the DHCP address :

Vagrant.configure(2) do |config|
  config.omnibus.chef_version = :latest
  config.berkshelf.enabled = true

  (1..3).each do |i|
    config.vm.define "cluster-#{i}", primary: true do |node|
      node.vm.network "private_network", ip: "10.0.0.1#{i}"
      node.vm.provider "vmware_fusion" do |v|
        v.vmx["memsize"] = "256"
      end
      node.vm.provider :virtualbox do |v|
        v.customize ["modifyvm", :id, "--memory", "256"]
      end
      node.vm.provision :chef_solo do |chef|
        chef.add_recipe "consul::default"
        chef.json.merge!({
            :consul => {
              "servers" => ["10.0.0.11"],
              "service_mode" => "cluster",
              "bootstrap_expect" => "3",
              "retry_on_join" => true,
              "enable_syslog" => true,
              "log_level" => "debug",
              "node_name" => "cluster-#{i}",
              "advertise_addr" => "10.0.0.1#{i}",
              "bind_interface" => "eth1",
              "advertise_interface" => "eth1"
            }
          })
        end
    end
  end

  config.vm.define "agent" do |node|
    node.vm.network "private_network", ip: "10.0.0.20"
    node.vm.provision :chef_solo do |chef|
      chef.add_recipe "consul::default"
      chef.json.merge!({
          :consul => {
            "servers" => ["10.0.0.11","10.0.0.12","10.0.0.13"],
            "service_mode" => "client",
            "retry_on_join" => true,
            "enable_syslog" => true,
            "log_level" => "debug",
            "node_name" => "consul-agent",
            "advertise_addr" => "10.0.0.20",
            "bind_interface" => "eth1",
            "advertise_interface" => "eth1"
          }
        })
    end
  end
end

from consul.

lock avatar lock commented on May 29, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from consul.

Related Issues (20)

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.