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
--- src/http/ngx_http_upstream_round_robin.c.orig 2011-09-30 14:30:01.000000000 +0000 | |
+++ src/http/ngx_http_upstream_round_robin.c 2012-01-18 18:38:25.438381169 +0000 | |
@@ -7,13 +7,44 @@ | |
#include <ngx_config.h> | |
#include <ngx_core.h> | |
#include <ngx_http.h> | |
+#include <ngx_supervisord.h> | |
+ | |
+#if (NGX_SUPERVISORD_API_VERSION != 2) | |
+ #error "ngx_supervisord-aware upstream requires NGX_SUPERVISORD_API v2" |
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
# | |
# Cookbook Name:: pentaho | |
# Recipe:: default | |
# | |
provide_service("nfs-client-for-pentaho") | |
searchenv = node[:pentaho][:nfs_environment] ? node[:pentaho][:nfs_environment] : nil | |
wait_for_service("nfs-server-for-pentaho", 1, 5, true, searchenv) | |
nfs_server = provider_for_service("nfs-server-for-pentaho", true, searchenv) |
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
# register with cluster_service_discovery | |
provide_service("nfs-server-for-pentaho") | |
include_recipe "nfs::server" | |
# I think there's the potential for a chicken-and-egg issue here, where the NFS server doesn't | |
# know who to set up exports for, and the clients fail mounting an NFS share that has no permissions. | |
searchenv = node[:pentaho][:nfs_environment] ? node[:pentaho][:nfs_environment] : nil | |
nfs_clients = all_provider_private_ips_services("nfs-client-for-pentaho", :ignore_cluster => true, searchenv.to_a) |
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
rb = ruby_block "wait_for_myself" do | |
action :nothing | |
block do | |
Chef::Log.info "Waiting for service registration to complete" | |
providers = all_providers_for_service("rabbitmq-disk-member") | |
found = false | |
until found | |
providers.each do |n| | |
n.hostname == node.hostname && found = true | |
Chef::Log.info "still waiting... #{providers.join(", ")}" |
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
ruby_block "create ssh key" do | |
block do | |
k = SSHKey.generate(:type => 'RSA', :bits => 1024, :comment => "Postgres Master") | |
node.set[:postgresql][:pubkey] = k.ssh_public_key | |
node.save | |
# Much of the DSL disappears in ruby blocks. Here's how to create a template. | |
rc = Chef::RunContext.new(node, node.cookbook_collection) | |
t = Chef::Resource::Template.new "/var/lib/postgresql/.ssh/id_rsa" | |
t.source("id_rsa.erb") |
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
#!/bin/bash | |
/usr/bin/chef-client | |
rm -f /opt/graphite/webapp/graphite/settings.pyc /opt/graphite/webapp/graphite/settings.py | |
if [ -d "/var/chef/cache/graphite-web-0.9.10" ]; then | |
cd /var/chef/cache/graphite-web-0.9.10 | |
python setup.py install | |
elif [ -d "/var/cache/chef/graphite-web-0.9.10" ]; then | |
cd /var/cache/chef/graphite-web-0.9.10 |
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
envs = Hash.new | |
q = Chef::Search::Query.new | |
r, f, l = q.search(:node, "fqdn:*.*") | |
r.each { |n| envs.has_key?(n.chef_environment) ? envs[n.chef_environment] += 1 : envs[n.chef_environment] = 1 } |
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
namespace :pre_deploy do | |
task "default" do | |
create_zipfile | |
end | |
desc "Create package zip file" | |
task "create_zipfile" do | |
run_locally "mkdir -p #{build_dir}" | |
run_locally "git archive --format=zip --prefix=#{app_name}/ -6 --output=#{build_dir}/#{app_name}-`git rev-parse --short=8 HEAD`.zip HEAD" |
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
actions :create | |
attribute :user, :kind_of => String, :name_attribute => true, :required => true | |
attribute :type, :kind_of => String, :default => "rsa", :equal_to => ["rsa", "dsa"] | |
attribute :length, :kind_of => String, :default => "2048", :equal_to => [ "1024", "2048", "4096" ] | |
action :create do | |
gem_package "sshkey" do | |
action :install |
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
#!/bin/bash | |
while true ; do | |
for i in {1..4} ; do | |
now=$(date '+%s' | perl -pe 's/\012//') | |
c=$(echo stats | nc xtincache0$i.xt.local 11211 | grep curr_conn | cut -d ' ' -f 3 | perl -pe 's/\015//' ) | |
echo "greg.cache.xtincache0${i}.curr_connections ${c} $now" | nc graphite-s1.xt.local 2013 | |
done | |
sleep 5 | |
done |
OlderNewer