How to connect config.json file to sync gateway


#1

I have referred the documentation from couchbase server officials , over there it is given that for connecting sync gateway by using config.json file use command $ sync_gateway config.json but my question is this command is for windows OS ? if yes then where should i run that command ? and if not then how should i run sync gateway by using config.json file ? please help !
(config.json is the file where i specified the logs, buckets, shodowing and all other things)


#2

@shriram.punde

Yes that is the basic command for all platforms.

If the Sync Gateway ‘/bin’ directory is on your environments $PATH variable then you can run the command from any directory, otherwise you will need to provide the full path to the sync_gateway binary.

If you pass config.json without a path prefix you will need to run the command from the directory containing config.json.

If you have installed Sync Gateway from a package installer (not from a local dev build) a service will be created and automatically start the sync_gateway executable after the installation and on system reboot.


#3

I think you are referring to starting the sync gateway. $ is the prompt indication in *nix style OSes.

If you are in Windows, you don’t need to run that command. Check the Services.msc for the Sync Gateway service and start it, if not already running.

If you have to make changes to the config.json, it is there in the program files directory next to the sync gateway binary. After making changes, you need to restart the service.


#4

Thank you @andy @vasu1


#5

I have one more doubt , now i am able to connect sync gateway to couchbase server…I have a consideration like couchbase lite is used as a local database or standalone database for windows application…so how the couchbase lite (local database from application) is connected with sync gateway??? is it done by API provided by Couchbase lite??


Regarding couchbase lite and sync gateway
#6

Yes, that’s what the replicator in Couchbase Lite does. Your app doesn’t have to worry about talking to Sync Gateway; it just configures Replication objects that do the sync in the background.