Created
December 4, 2010 00:47
-
-
Save daharon/727782 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
set_unless[:rabbitmq][:flow_control_watermark] = 0.6 | |
set[:rabbitmq][:cluster] = [ | |
# Each list of hostnames defines a cluster. | |
[ | |
'mq3.internal.sazze.com', | |
'mq4.internal.sazze.com' | |
], | |
[ | |
'mq5.internal.sazze.com', | |
'mq6.internal.sazze.com' | |
] | |
] |
This file contains hidden or 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
cluster_nodes = [] | |
node[:rabbitmq][:cluster].each do |cluster| | |
if cluster.include?(node[:fqdn]) | |
cluster_nodes += cluster.reject { |item| item == node[:fqdn] } | |
break | |
end | |
end | |
template "rabbitmq.config" do | |
path "/etc/rabbitmq/rabbitmq.config" | |
source "rabbitmq.config.erb" | |
mode 0644 | |
owner "root" | |
group "root" | |
action :create | |
variables( | |
:vm_memory_high_watermark => node[:rabbitmq][:flow_control_watermark], | |
:cluster_nodes => cluster_nodes.join("', 'rabbit@") | |
) | |
end |
This file contains hidden or 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
[ | |
{ | |
rabbit, [ | |
{vm_memory_high_watermark, <%= @vm_memory_high_watermark %>}, | |
<% unless @cluster_nodes.empty? -%> | |
{cluster_nodes, ['rabbit@<%= @cluster_nodes %>']} | |
<% end -%> | |
] | |
} | |
]. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment