How to bring back DataBase to online?


#1

Hi, My database is went to offline,

For Your Information,
{“committed_update_seq”:498,“compact_running”:false,“db_name”:“db”,“disk_format_version”:0,“instance_start_time”:1466595295682612,“purge_seq”:0,“state”:“Offline”,“update_seq”:498}

We tried the below links to bring back the database to online.

http://developer.couchbase.com/documentation/mobile/1.2/develop/references/sync-gateway/admin-rest-api/database-admin/post-db-online/index.html

http://developer.couchbase.com/documentation/mobile/current/develop/guides/sync-gateway/administering-sync-gateway/database-offline/index.html

But, we are getting an error as you can see it in the attached image.

Thanks in advance.


#2

@venkatrao

Can you provide the following information:

The Sync Gateway version (you can get this from the Sync Gateway Log on startup), the OS you are running on, whether you are running on bare metal or in a VM.

The Sync Gateway Logs from the time when you call _online

Your Sync Gateway config.json file.


#3

@andy,
here are the details.

$ docker run -d -p 4984:4984 -p 4985:4985 couchbase/sync-gateway https://api.myjson.com/bins/3yc03

{
“log”: [
"
],
“databases”: {
“db”: {
“server”: “http://myipaddress:8091/”,
“bucket”: “default”,
“users”: {
“GUEST”: {
“disabled”: false,
“admin_channels”: [
"

]
}
}
}
}
}


#4

@itssrinadh

Can you try with the following top level property added to your config.json file:

"adminInterface":"0.0.0.0:4985",

By default the ADMIN REST API is bound to 127.0.0.1, I think curl will only work if run from within the docker container.

With the above property the ADMIN REST API will bind to all interfaces, which should allow your external curl command to work.


#5

Thank you @Andy, So after add this does my config.json look like below

{
“log”: [
""
],
“adminInterface”: “0.0.0.0:4985”,
“databases”: {
“db”: {
“server”: “http://myipaddress:8091/”,
“bucket”: “default”,
“users”: {
“GUEST”: {
“disabled”: false,
“admin_channels”: [
"
"
]
}
}
}
}
}


#6

@itssrinadh

Yes, that config looks correct, have you retested to see if you can access the REST API to take the DB offline?


#7

@andy After i change that my DB came to online. Thanks for your help.


#8

@andy Hi I dont know why my Database went offline some times. is there any way to prevent offline or else automatically upto online. i tried to get datbase into online by using following line of post request. but it has been loading. but no use. i simply restart docker then it came to up. please assist me a solution

http://162.243.87.160: 59840/_online