Author Archives: prakash

How to restore Couchbase Views to another Data bucket?

I was Struggling for restoring my couchbase views from one Data Bucket to another. This is useful when you are still in development phase and want to change Data or create new bucket from existing one. Easiest way to do is just copy a file name “master.couch.X” which is located inside the same directory as bucket name. Here is detail how can it be done

Let’s suppose you have bucket name “A”  and data directory is /var/lib/couchbase/data/ inside this there is a directory  A which represent bucket A. let’s suppose you created new data Bucket “B” so there is another directory with name “B”.  stop the couchbase server(service) and copy the file  /var/lib/couchbase/data/A /”master.couch.X”  (here X can be any number)  to   /var/lib/couchbase/data/B/ and  Start Couchbase service.

Now It should shows views in Admin section. 🙂

Mongo DB: JavaScript execution failed: Error: couldn’t connect to server at src/mongo/shell/mongo.js:L112

if following error appear when try to start mongo in Linux

JavaScript execution failed: Error: couldn’t connect to server at src/mongo/shell/mongo.js:L112

here is the solution:

Open Terminal and type following command
First Stop service

sudo service mongodb stop

Then remove the Mongo log file with following

sudo rm /var/lib/mongodb/mongod.lock

then change the permission of the Mongo Library and give full control to mongodb

sudo chown -R mongodb:mongodb /var/lib/mongodb/

Finally start Mongo service

sudo service mongodb start


For windows,

  • go to services.msc stop MongoDB service.
  • then go to your data directory of Mongodb
  • there is one “.lock” file, delete it.
  • start MongoDB service
  • Done

How to connect ssh from windows host to ubuntu guest in Virtualbox

After long pain, I am able to connect ssh from my windows as host to Ubuntu Guest. The Idea was simple:

first connect go to setting->network: At Adapter1 set it “Bridged Adapter” you dont have to do anything.
On Adapter2, enable it and set “host only Adapter”  it automatically set the name that is already exists we don’t have to do anything.  Then it should work.

If it did not work the go to file->preference->network and then add(or edit existing network adapter) and set the IP address and server range for the network. Now start the Guest install  openssh in your guest with following command

sudo apt-get install openssh-server