Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

configure data path to be mount point

- replace symlink
  • Loading branch information...
commit e65a27ef0ea5575af6c60cf09159c2c9e8cebb97 1 parent dcaf551
@ronniedada ronniedada authored
Showing with 17 additions and 29 deletions.
  1. +17 −29 cookbooks/couchbase/recipes/setup-2.0.0.rb
View
46 cookbooks/couchbase/recipes/setup-2.0.0.rb
@@ -30,6 +30,23 @@
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
+ end
+end
+
+
log("/opt/couchbase/bin/couchbase-cli cluster-init" +
" -c 127.0.0.1:8091" +
" --cluster-init-username=#{node[:db_couchbase][:cluster][:username]}")
@@ -42,35 +59,6 @@
action :run
end
-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]
-
- log "configuring to mount_point: #{mount_point}"
-
- execute "stopping server" do
- command "/etc/init.d/couchbase-server stop && sleep 5"
- action :run
- end
-
- execute "moving directory" do
- command "mv /opt/couchbase #{mount_point}"
- action :run
- end
-
- execute "symlinking directory" do
- command "ln -s #{mount_point}/couchbase /opt/"
- action :run
- end
-
- execute "starting server" do
- command "/etc/init.d/couchbase-server start"
- action :run
- end
-end
-
log("sleep 10 && /opt/couchbase/bin/couchbase-cli bucket-create" +
" -c 127.0.0.1:8091" +
" -u #{node[:db_couchbase][:cluster][:username]}" +
Please sign in to comment.
Something went wrong with that request. Please try again.