Permalink
Browse files

preventing bucket error causing server halt

  • Loading branch information...
ronniedada committed Aug 28, 2013
1 parent 6c4a123 commit b363ebf8efd1b905b32d3916bef0851c443ddd92
Showing with 7 additions and 11 deletions.
  1. +7 −11 cookbooks/couchbase/recipes/setup-2.1.1.rb
@@ -186,24 +186,20 @@
log e
end
# create bucket after rebalance
log("sleep 30 && /opt/couchbase/bin/couchbase-cli bucket-create" +
" -c 127.0.0.1:8091" +
" -u #{node[:db_couchbase][:cluster][:username]}" +
" --bucket=#{node[:db_couchbase][:bucket][:name]}" +
" --bucket-type=couchbase" +
" --bucket-ramsize=#{node[:db_couchbase][:bucket][:ram]}" +
" --bucket-replica=#{node[:db_couchbase][:bucket][:replica]} 2>\&1")
begin
execute "creating bucket: #{node[:db_couchbase][:bucket][:name]}" do
command("sleep 30 && /opt/couchbase/bin/couchbase-cli bucket-create" +
bucket_create = "sleep 30 && /opt/couchbase/bin/couchbase-cli bucket-create" +
" -c 127.0.0.1:8091" +
" -u #{node[:db_couchbase][:cluster][:username]}" +
" -p #{node[:db_couchbase][:cluster][:password]}" +
" --bucket=#{node[:db_couchbase][:bucket][:name]}" +
" --bucket-type=couchbase" +
" --bucket-password=\"#{node[:db_couchbase][:bucket][:password]}\"" +
" --bucket-ramsize=#{node[:db_couchbase][:bucket][:ram]}" +
" --bucket-replica=#{node[:db_couchbase][:bucket][:replica]} 2>\&1")
" --bucket-replica=#{node[:db_couchbase][:bucket][:replica]} 2>\&1"
cmd = "x=\`#{bucket_create}\`; echo x"
log(cmd)
begin
execute "creating bucket: #{node[:db_couchbase][:bucket][:name]}" do
command(cmd)
action :run
end
rescue Exception => e

0 comments on commit b363ebf

Please sign in to comment.