Last active
December 13, 2015 21:48
-
-
Save mattupstate/4979630 to your computer and use it in GitHub Desktop.
RabbitMQ cluster with Vagrant and Chef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# Generated by Chef | |
### | |
CONFIG_FILE=/etc/rabbitmq/rabbitmq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%% | |
%% Generated by Chef | |
%%% | |
[ | |
{rabbit, [ | |
{cluster_nodes, ['rabbit@rabbit1','rabbit@rabbit2']}, | |
{default_user, <<"guest">>}, | |
{default_pass, <<"guest">>} | |
]} | |
]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR: node with name "rabbit" already running on "rabbit1" | |
DIAGNOSTICS | |
=========== | |
nodes in question: [rabbit@rabbit1] | |
hosts, their running nodes and ports: | |
- rabbit1: [{rabbit,53706}, | |
{rabbitmqprelaunch5584,33443}, | |
{rabbitmqctl5603,46487}] | |
current node details: | |
- node name: rabbitmqprelaunch5584@rabbit1 | |
- home dir: /var/lib/rabbitmq | |
- cookie hash: 4NjflM1cWvj9cJOBjmsyOA== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant::Config.run do |vagrant| | |
vagrant.vm.define :vm1 do |config| | |
config.vm.box = "precise64" | |
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
config.vm.network :hostonly, "192.168.0.80" | |
config.vm.host_name = 'rabbit1' | |
config.vm.provision :chef_solo do |chef| | |
chef.add_recipe "apt" | |
chef.add_recipe "hostsfile" | |
chef.add_recipe "rabbitmq" | |
chef.json.merge!({ | |
'hostsfile' => { | |
'192.168.0.90' => 'rabbit2' | |
}, | |
'rabbitmq' => { | |
'erlang_cookie' => 'yummycookie', | |
'cluster' => true, | |
'cluster_disk_nodes' => ['rabbit@rabbit1', 'rabbit@rabbit2'] | |
} | |
}) | |
end | |
end | |
vagrant.vm.define :vm2 do |config| | |
config.vm.box = "precise64" | |
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
config.vm.network :hostonly, "192.168.0.90" | |
config.vm.host_name = 'rabbit2' | |
config.vm.provision :chef_solo do |chef| | |
chef.add_recipe "apt" | |
chef.add_recipe "hostsfile" | |
chef.add_recipe "rabbitmq" | |
chef.json.merge!({ | |
'hostsfile' => { | |
'192.168.0.80' => 'rabbit1' | |
}, | |
'rabbitmq' => { | |
'erlang_cookie' => 'yummycookie', | |
'cluster' => true, | |
'cluster_disk_nodes' => ['rabbit@rabbit1', 'rabbit@rabbit2'] | |
} | |
}) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment