I’m using boot2docker on my mac and I’m trying to mount a directory for couchbase data volume using the following command:
run -d -v ~/couchbase:/opt/couchbase/var -p 8091:8091 --name my-couchbase couchbase
But when I checked the logs, I got this:
Starting Couchbase Server -- Web UI available at http://<ip>:8091
{"init terminating in do_boot",{{badmatch,{error,{bad_return,{{ns_babysitter,start,[normal,[]]},{'EXIT',{shutdown,{gen_server,call,[ale,{set_loglevel,error_logger,debug}]}}}}}}},[{init,start_it,1,[]},{init,start_em,1,[]}]}}
init terminating in do_boot ()
If I create a new container without setting -v, it’s able to start with no issues.
Thanks for your suggesiton Val_Entin2. By changing the folder permission, I’m able to get the container to not crash on startup. But I’m encountering another problem. The container has the following log output:
Starting Couchbase Server -- Web UI available at http://<ip>:8091
{"init terminating in do_boot",{{badmatch,{error,{bad_return,{{ns_babysitter,start,[normal,[]]},{'EXIT',{shutdown,{gen_server,call,[ale,{add_sink,ns_server,babysitter_sink,debug}]}}}}}}},[{init,start_it,1,[]},{init,start_em,1,[]}]}}
And I see there are two files created in a couchbase sub-folder:
erl_crash.dump.1434431000.1.babysitter - looks like a stacktrace dump
Starting Couchbase Server -- Web UI available at http://<ip>:8091
{error_logger,{{2015,6,16},{18,20,30}},std_error,"File operation error: eacces. Target: /etc/resolv.conf. Function: get_file. Process: kernel_sup."}
Can you add any more suggestions here? I can’t believe that me and Val_Entin2 are the only ones who’s trying to get couchbase to run in boot2docker with a custom volume mount.
My soltuion ATM is to mount the volume on the boot2docker root:
run -d -v /couchbase:/opt/couchbase/var -p 8091:8091 --name my-couchbase couchbase
Which set up the couchbase folder at the root of the boot2docker VM, this works well, but you don’t have access to the data on your host, only if you SSH the boot2docker VM:
$ boot2docker ssh # cd /couchbase
So if you do it this way, each time you start the boot2docker VM, your files will normally be there.
But if, for some reason, you delete the boot2docker image you also delete your couchbase configuration files and your couchbase datas datas.
I think you can do some backups with SSH to your Host if you want to keep your configuration and push them again if you have deleted/upgraded your boot2docker VM.
I think the problem it self come from the way boot2docker have been designed wich mount aiutomatically the /Users forlder on the on the VM. I think it was more for read files from the Host instead to write them.
An other approach would be to use Vagrant your own Linux VM and set up your own volumes instead of Boot2Docker.
But I don’t know if you will came accross the same permission issues.
Yes, I have done the nfs approach:
configurate nfs on my Host machine
unmount \Users on the vm,
mount \Users[username] with nfs
etc…
And still having after all this mess a new error on couchbase data folder and subfolders:
chown: changing ownership of `var/lib/couchbase/config': Operation not permitted
and the same message on all couchbase data subfolders
This error occurs because couchase is installed on the linux machine under a specific user and this user doesnt have any right on the Host machine (cf same problem on boot2docker with postgre, mysql, apache…)
I tried to do a chown -R 999:999 . and many command to open the rights on the folder to change ownership on the couchbase data folder, but no sucessfull results.
For me the only solutions ATM are:
Store Datas on the boot2docker VM and try to make some backup services before updating the boot2docker VM
Use vagrant VM instead of docker images with devops like Puppet, Chief or whatever…
The old way by installing couchbase on the machine and waiting for Docker team to solve the permission issue (I have choose that one)
Develop on linux instead of OSX
I have already spent 2 day trying to solve the problem (to much time for a dev environment), I hope it’s not for nothing, but I need to get back on code and may be try it again @ home this weekend.