Backup Fails
I've followed the docs for backing up a couchbase 1.8 server, and tweaked the paths for my installation, but the backup script continues to state it can not find the files.
Backkup command example is below, i started with mbbackup, which leads me to cbbackup, which ultimately just executes a python script and i've tried all three as well as running simply through sudo and as sudo -u couchbase. The examples show that data is in /var/opt, but using the latest .deb file from couchbase, they are installed/created in the paths below. I have also confirmed that the python script correctly finds sqlite3.
jeff@demo:/data/db/backups$ /opt/couchbase/lib/python/cbbackup /opt/couchbase/var/lib/couchbase/data/propjoe-data /data/db/backups/couchbase/
Error: unable to open database "/opt/couchbase/var/lib/couchbase/data/propjoe-data": unable to open database file
I am able to view the files in this directory:
jeff@demo:/data/db/backups$ ls -la /opt/couchbase/var/lib/couchbase/data/propjoe-data
total 2344
drwxr-xr-x 2 couchbase couchbase 4096 2012-03-25 10:51 .
drwxr-xr-x 15 couchbase couchbase 4096 2012-03-24 17:31 ..
-rw-r--r-- 1 couchbase couchbase 52224 2012-03-25 10:24 propjoe
-rw-r--r-- 1 couchbase couchbase 307200 2012-03-24 17:41 propjoe-0.mb
-rw-r--r-- 1 couchbase couchbase 32768 2012-03-24 17:41 propjoe-0.mb-shm
-rw-r--r-- 1 couchbase couchbase 0 2012-03-24 17:41 propjoe-0.mb-wal
-rw-r--r-- 1 couchbase couchbase 307200 2012-03-24 17:41 propjoe-1.mb
-rw-r--r-- 1 couchbase couchbase 32768 2012-03-24 17:41 propjoe-1.mb-shm
-rw-r--r-- 1 couchbase couchbase 0 2012-03-24 17:41 propjoe-1.mb-wal
-rw-r--r-- 1 couchbase couchbase 307200 2012-03-24 17:41 propjoe-2.mb
-rw-r--r-- 1 couchbase couchbase 32768 2012-03-24 17:41 propjoe-2.mb-shm
-rw-r--r-- 1 couchbase couchbase 0 2012-03-24 17:41 propjoe-2.mb-wal
-rw-r--r-- 1 couchbase couchbase 307200 2012-03-24 17:41 propjoe-3.mb
-rw-r--r-- 1 couchbase couchbase 32768 2012-03-24 17:41 propjoe-3.mb-shm
-rw-r--r-- 1 couchbase couchbase 0 2012-03-24 17:41 propjoe-3.mb-wal
-rw-r--r-- 1 couchbase couchbase 32768 2012-03-25 10:51 propjoe-shm
-rw-r--r-- 1 couchbase couchbase 1058512 2012-03-25 10:51 propjoe-wal
Thanks for the comment, but i had tried that, but only via sudo, this time i got a login as this user and tried it with the same results:
couchbase@demo:~$ /opt/couchbase/bin/cbbackup /opt/couchbase/var/lib/couchbase/data/propjoe-data /data/db/backups/couchbase/
Error: unable to open database "/opt/couchbase/var/lib/couchbase/data/propjoe-data": unable to open database file
Try backup propjoe-data again
^CTraceback (most recent call last):
File "/opt/couchbase/lib/python/cbbackup", line 67, in
backup(sqlite_path, dirname, dest_path, bucket_name)
File "/opt/couchbase/lib/python/cbbackup", line 37, in backup
time.sleep(sleep_time)
KeyboardInterrupt
couchbase@demo:~$ ls -la /opt/couchbase/var/lib/couchbase/data/propjoe-data
total 2344
drwxr-xr-x 2 couchbase couchbase 4096 2012-03-27 08:22 .
drwxr-xr-x 15 couchbase couchbase 4096 2012-03-24 17:31 ..
-rw-r--r-- 1 couchbase couchbase 52224 2012-03-27 06:59 propjoe
-rw-r--r-- 1 couchbase couchbase 307200 2012-03-24 17:41 propjoe-0.mb
-rw-r--r-- 1 couchbase couchbase 32768 2012-03-24 17:41 propjoe-0.mb-shm
-rw-r--r-- 1 couchbase couchbase 0 2012-03-24 17:41 propjoe-0.mb-wal
-rw-r--r-- 1 couchbase couchbase 307200 2012-03-24 17:41 propjoe-1.mb
-rw-r--r-- 1 couchbase couchbase 32768 2012-03-24 17:41 propjoe-1.mb-shm
-rw-r--r-- 1 couchbase couchbase 0 2012-03-24 17:41 propjoe-1.mb-wal
-rw-r--r-- 1 couchbase couchbase 307200 2012-03-24 17:41 propjoe-2.mb
-rw-r--r-- 1 couchbase couchbase 32768 2012-03-24 17:41 propjoe-2.mb-shm
-rw-r--r-- 1 couchbase couchbase 0 2012-03-24 17:41 propjoe-2.mb-wal
-rw-r--r-- 1 couchbase couchbase 307200 2012-03-24 17:41 propjoe-3.mb
-rw-r--r-- 1 couchbase couchbase 32768 2012-03-24 17:41 propjoe-3.mb-shm
-rw-r--r-- 1 couchbase couchbase 0 2012-03-24 17:41 propjoe-3.mb-wal
-rw-r--r-- 1 couchbase couchbase 32768 2012-03-27 08:22 propjoe-shm
-rw-r--r-- 1 couchbase couchbase 1058512 2012-03-27 08:22 propjoe-wal
try doing the cbbackup command as the couchbase user.
this took me a while to realize what was the problem, too. the cbbackup command should really have a usage message saying something about permissions...