Comments (3)
Note: This is being done in CentOS-65
from consul.
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.
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)
- Dangerfile should use failure instead of fail
- Remove .rubocop.yml with Dangerfile HOT 1
- Update Changelog HOT 2
- Run latest cookstyle HOT 2
- Update builds to be parallel HOT 1
- undefined method `join_path' for PoiseArchive::Resources::PoiseArchive::Resource HOT 6
- Segment part of the config is wrong type HOT 1
- Poise dependency is abandoned HOT 3
- Rewrite Consul cookbook to use custom resources HOT 5
- `services` definition throws "no implicit conversion of Symbol into Integer" HOT 3
- Support arm64 on linux
- Diplomat gem fails on Chef 16.9.29+ HOT 4
- Error in configure_diplomat with Diplomat 2.5.0 HOT 12
- Chef 17 - Poise no longer works HOT 2
- Consul 1.9.x - ui/ui_dir deprecated HOT 1
- Why are unit tests disabled? Any plans to return them back? HOT 1
- consul_service ignores program property HOT 1
- Dependency Dashboard
- Consul 1.12.x deprecated fields
- Consul client install latest packages missing checksums
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from consul.