Using the Command Line
Start a Sync Gateway instance using command line options and securely sync enterprise data from cloud to edge
Introduces the options available when running Sync Gateway from the command line
Related Deploy topics: Deployment | REST API Access | Bootstrap Configuration
Overview
You can configure some Sync Gateway features by specifying command-line options when you start it.
For more comprehensive configuration options see: Configuration Overview
Configuration
Configuration determines the runtime behavior of Sync Gateway, including server configuration and the database or set of databases with which a sync gateway instance can interact.
Command-line options can only specify a sub-set of the available configuration properties, and cannot be used to configure multiple databases. |
Two command-line options do not have corresponding configuration properties: -help
and -verbose
.
Option Format
When specifying command-line options use the format shown in Example 1
-
Command-line options are case-insensitive.
-
You can prefix command-line options with one hyphen (-) or with two hyphens (--).
-
For command-line options that take an argument, you specify the argument after an equal sign (=).
For example,-bucket=db
, or as a following item on the command line, for example,-bucket db
.
-
Format
-
List CLI Arguments
When specifying command-line options use this format:
sync_gateway [ -{option} ]
1 | Seperate multiple options by a comma or a space |
You can check the latest position by navigating to the folder containing the Sync Gateway executable and using:
$ ./sync_gateway -help (1)
1 | This command lists all Sync Gateway’s current command line arguments |
Available Options
The command-line options that can be used when starting Sync Gateway are outlined in Table 1 and Table 2.
Option | Default | Description | ||
---|---|---|---|---|
|
The config group ID to use when discovering databases. Allows for non-homogenous configuration |
|||
|
How often to poll Couchbase Server for new config changes |
|||
|
Couchbase Server connection string/URL
|
|||
|
Username for authenticating to server |
|||
|
Password for authenticating to server |
|||
|
none |
Root CA certificate path |
||
|
none |
Client certificate path |
||
|
none |
Client private key path |
||
|
false |
Set to ignore certificate validation — development and testing mode only |
||
|
true |
Forces the connection to Couchbase Server to use TLS. |
||
|
:4984 |
Network interface to bind public API to |
||
|
:4985 |
Network interface to bind admin API to |
||
|
:4986 |
Network interface to bind metrics API to |
||
|
Network interface to bind profiling API to |
|||
|
Whether the admin API requires authentication |
|||
|
Whether the metrics API requires authentication |
|||
|
Whether to enable the DP permissions check feature of admin auth |
|||
|
Maximum duration.Second before timing out read of the HTTP(S) request |
|||
|
Maximum duration.Second before timing out write of the HTTP(S) response |
|||
|
The amount of time allowed to read request headers |
|||
|
The maximum amount of time to wait for the next request when keep-alives are enabled |
|||
|
Pretty-print JSON responses |
|||
|
Max number of incoming HTTP connections to accept |
|||
|
If false, disables compression of HTTP responses |
|||
|
Whether product versions removed from Server headers and REST API responses |
|||
|
The minimum allowable TLS version for the REST APIs |
|||
|
The TLS certificate filepath to use for the REST APIs |
|||
|
The TLS key filepath to use for the REST APIs |
|||
|
List of comma separated allowed origins. Use '*' to allow access from everywhere |
|||
|
List of comma separated allowed login origins |
|||
|
List of comma separated allowed headers |
|||
|
Maximum age of the CORS Options request |
|||
|
Absolute or relative path on the filesystem to the log file directory. A relative path is from the directory that contains the Sync Gateway executable file |
|||
|
Redaction level to apply to log output. Options: none, partial, full, unset |
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Options: none, error, warn, info, debug, trace |
|||
|
HTTP |
A comma-separated list of log keywords to be enabled. |
||
|
||||
|
Can be used to override the default stderr output, and write to the file specified inst |
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Most to use for bcrypt password hashes |
|||
|
Max heartbeat value for _changes request |
|||
|
LIP data compression level (0-9) |
|||
|
How often should stats be written to stats logs |
|||
|
Bypass the jsoniter package and use Go’s stdlib instead |
|||
|
Whether HTTP2 support is enabled |
|||
|
Max number of open file descriptors (RLIMIT_NOFILE) |
Option | Default | Description |
---|---|---|
|
none |
URL of server that can return database configs |
|
sync_gateway |
Name of the Couchbase Server database to serve through the Public REST API. |
|
false |
Set this property 'true' to continue using the legacy configuration mode (File-based Configuration) |
|
none |
Path to log files, as a fallback default value when |
|
none |
Customer/project identifier for stats reporting |
|
none |
Lists the available options and exits. |
|
default |
Name of the Couchbase Server pool in which to find buckets. |
|
false |
Pretty-print JSON responses to improve readability. This is useful for debugging, but reduces performance. |
|
Address to bind the profile interface to |
|
|
|
The URL of the database server |
|
Non-verbose logging |
Logs more information about requests. |