Skip to content
Browse files

catch node init failure

  • Loading branch information...
1 parent 1527c76 commit bd7c3be23c1295915bfde73011fc3188b34aa79f @ronniedada ronniedada committed Dec 27, 2012
Showing with 17 additions and 14 deletions.
  1. +17 −14 cookbooks/couchbase/recipes/setup-2.0.0.rb
View
31 cookbooks/couchbase/recipes/setup-2.0.0.rb
@@ -46,23 +46,26 @@
log "configuring #{couchbase_package}"
-unless (node[:block_device].nil? or
- node[:block_device][:devices].nil? or
- node[:block_device][:devices][:device1].nil? or
- node[:block_device][:devices][:device1][:mount_point].nil?)
- mount_point = node[:block_device][:devices][:device1][:mount_point]
- execute "configure data path to use mount point: #{mount_point}" do
- command("sleep 5 && chown couchbase:couchbase #{mount_point} &&" +
- " /opt/couchbase/bin/couchbase-cli node-init" +
- " --node-init-data-path=#{mount_point}" +
- " -c 127.0.0.1:8091" +
- " -u=#{node[:db_couchbase][:cluster][:username]}" +
- " -password=#{node[:db_couchbase][:cluster][:password]}")
- action :run
+begin
+ unless (node[:block_device].nil? or
+ node[:block_device][:devices].nil? or
+ node[:block_device][:devices][:device1].nil? or
+ node[:block_device][:devices][:device1][:mount_point].nil?)
+ mount_point = node[:block_device][:devices][:device1][:mount_point]
+ execute "configure data path to use mount point: #{mount_point}" do
+ command("sleep 5 && chown couchbase:couchbase #{mount_point} &&" +
+ " /opt/couchbase/bin/couchbase-cli node-init" +
+ " --node-init-data-path=#{mount_point}" +
+ " -c 127.0.0.1:8091" +
+ " -u=#{node[:db_couchbase][:cluster][:username]}" +
+ " -password=#{node[:db_couchbase][:cluster][:password]}")
+ action :run
+ end
end
+rescue Exception => e
+ log e
end
-
log("/opt/couchbase/bin/couchbase-cli cluster-init" +
" -c 127.0.0.1:8091" +
" --cluster-init-username=#{node[:db_couchbase][:cluster][:username]}")

0 comments on commit bd7c3be

Please sign in to comment.
Something went wrong with that request. Please try again.