From f1235cf215ad575b6fd4fd9dcaf74b6349fcfafd Mon Sep 17 00:00:00 2001 From: Darrin Eden Date: Sun, 6 Mar 2011 10:08:47 -0800 Subject: [PATCH] graphite listen on localhost by default --- attributes/graphite.rb | 6 ++++++ recipes/carbon.rb | 11 +++++++++-- templates/default/carbon.conf.erb | 20 ++++++++++---------- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/attributes/graphite.rb b/attributes/graphite.rb index dfd0bfe..8b681f4 100644 --- a/attributes/graphite.rb +++ b/attributes/graphite.rb @@ -1,9 +1,15 @@ +default[:graphite][:carbon][:line_receiver_interface] = "127.0.0.1" +default[:graphite][:carbon][:pickle_receiver_interface] = "127.0.0.1" +default[:graphite][:carbon][:cache_query_interface] = "127.0.0.1" + default[:graphite][:carbon][:version] = "0.9.7" default[:graphite][:carbon][:uri] = "http://launchpadlibrarian.net/61904798/carbon-0.9.7.tar.gz" default[:graphite][:carbon][:checksum] = "ba698aca" + default[:graphite][:whisper][:version] = "0.9.7" default[:graphite][:whisper][:uri] = "http://launchpadlibrarian.net/61904764/whisper-0.9.7.tar.gz" default[:graphite][:whisper][:checksum] = "c6272ad6" + default[:graphite][:graphite_web][:version] = "0.9.7c" default[:graphite][:graphite_web][:uri] = "http://launchpadlibrarian.net/62379635/graphite-web-0.9.7c.tar.gz" default[:graphite][:graphite_web][:checksum] = "a3e16265" diff --git a/recipes/carbon.rb b/recipes/carbon.rb index cb0382e..5170e0e 100644 --- a/recipes/carbon.rb +++ b/recipes/carbon.rb @@ -17,11 +17,18 @@ cwd "/usr/src/carbon-#{node.graphite.carbon.version}" end -template "/opt/graphite/conf/carbon.conf" +template "/opt/graphite/conf/carbon.conf" do + variables( :line_receiver_interface => node[:graphite][:carbon][:line_receiver_interface], + :pickle_receiver_interface => node[:graphite][:carbon][:pickle_receiver_interface], + :cache_query_interface => node[:graphite][:carbon][:cache_query_interface] ) + notifies :restart, "service[carbon-cache]" +end + template "/opt/graphite/conf/storage-schemas.conf" service "carbon-cache" do - pattern "carbon-cache" + running true start_command "/opt/graphite/bin/carbon-cache.py start" + stop_command "/opt/graphite/bin/carbon-cache.py stop" action :start end diff --git a/templates/default/carbon.conf.erb b/templates/default/carbon.conf.erb index 289f8b2..1d5e200 100644 --- a/templates/default/carbon.conf.erb +++ b/templates/default/carbon.conf.erb @@ -27,13 +27,13 @@ MAX_UPDATES_PER_SECOND = 1000 # the files quickly but at the risk of slowing I/O down considerably for a while. MAX_CREATES_PER_MINUTE = inf -LINE_RECEIVER_INTERFACE = 0.0.0.0 +LINE_RECEIVER_INTERFACE = <%= @line_receiver_interface %> LINE_RECEIVER_PORT = 2003 -PICKLE_RECEIVER_INTERFACE = 0.0.0.0 +PICKLE_RECEIVER_INTERFACE = <%= @pickle_receiver_interface %> PICKLE_RECEIVER_PORT = 2004 -CACHE_QUERY_INTERFACE = 0.0.0.0 +CACHE_QUERY_INTERFACE = <%= @cache_query_interface %> CACHE_QUERY_PORT = 7002 # By default, carbon-cache will log every whisper update. This can be excessive and @@ -68,12 +68,12 @@ LOG_UPDATES = True # with the default configuration, you have to specify a distinict # interfaces and ports for the listeners. -[relay] -LINE_RECEIVER_INTERFACE = 0.0.0.0 -LINE_RECEIVER_PORT = 2003 +#[relay] +#LINE_RECEIVER_INTERFACE = 0.0.0.0 +#LINE_RECEIVER_PORT = 2003 -PICKLE_RECEIVER_INTERFACE = 0.0.0.0 -PICKLE_RECEIVER_PORT = 2004 +#PICKLE_RECEIVER_INTERFACE = 0.0.0.0 +#PICKLE_RECEIVER_PORT = 2004 -CACHE_SERVERS = server1, server2, server3 -MAX_QUEUE_SIZE = 10000 +#CACHE_SERVERS = server1, server2, server3 +#MAX_QUEUE_SIZE = 10000