4.9. Replicator
4.9.1. Replicator Database Configuration
[replicator]
maxjobs
New in version 2.1.
Number of actively running replications.This value represents the threshold to trigger the automatic replicationscheduler.The system will check everyinterval
milliseconds how many replicationjobs are running, and if there are more thanmax_jobs
active jobs,the scheduler will pause-and-restart up tomax_churn
jobs in thescheduler queue.Making this value too high could cause performance issues, while makingit too low could mean replications jobs might not have enough time to makeprogress before getting unscheduled again.This parameter can be adjusted at runtime and will take effect during nextrescheduling cycle:- [replicator]
max_jobs = 500
- [replicator]
interval
New in version 2.1.
Scheduling interval in milliseconds.During each reschedule cycle the scheduler might start or stop up tomax_churn
number of jobs:- [replicator]
interval = 60000
- [replicator]
max_churn
New in version 2.1.
Maximum number of replication jobs to start and stop during rescheduling.This parameter, along withinterval
, defines the rate of job replacement.During startup, however, a much larger number of jobs could be started(up tomax_jobs
) in a short period of time:- [replicator]
max_churn = 20
- [replicator]
update_docs
New in version 2.1.
When set totrue
replicator will update replication document witherror and triggered states. This approximates pre-2.1 replicatorbehavior:- [replicator]
update_docs = false
- [replicator]
worker_batch_size
With lower batch sizes checkpoints are done more frequently. Lowerbatch sizes also reduce the total amount of used RAM memory:- [replicator]
worker_batch_size = 500
- [replicator]
worker_processes
More worker processes can give higher network throughput but can alsoimply more disk and network IO:- [replicator]
worker_processes = 4
- [replicator]
http_connections
Maximum number of HTTP connections per replication:- [replicator]
http_connections = 20
- [replicator]
connection_timeout
HTTP connection timeout per replication.This is divided by three (3) when the replicator makes changes feed requests.Even for very fast/reliable networks it might need to be increased ifa remote database is too busy:- [replicator]
connection_timeout = 30000
- [replicator]
retries_per_request
Changed in version 2.1.1.
If a request fails, the replicator will retry it up to N times. Thedefault value for N is 5 (before version 2.1.1 it was 10). The requestsare retried with a doubling exponential backoff starting at 0.25seconds. So by default requests would be retried in 0.25, 0.5, 1, 2, 4second intervals. When number of retires is exhausted, the wholereplication job is stopped and will retry again later:- [replicator]
retries_per_request = 5
- [replicator]
socket_options
Some socket options that might boost performance in some scenarios:
-{nodelay, boolean()}
-{sndbuf, integer()}
-{recbuf, integer()}
-{priority, integer()}
See the inet Erlang module’s man page for the full list of options:- [replicator]
socket_options = [{keepalive, true}, {nodelay, false}]
- [replicator]
checkpoint_interval
New in version 1.6.
Defines replication checkpoint interval in milliseconds.Replicator willrequests
from theSource database at the specified interval:- [replicator]
checkpoint_interval = 5000
Lower intervals may be useful for frequently changing data, whilehigher values will lower bandwidth and make fewer requests forinfrequently updated databases.- [replicator]
use_checkpoints
New in version 1.6.
Ifuse_checkpoints
is set totrue
, CouchDB will makecheckpoints during replication and at the completion of replication.CouchDB can efficiently resume replication from any of thesecheckpoints:- [replicator]
use_checkpoints = true
Note
Checkpoints are stored in local documentson both the source and target databases (which requires writeaccess).
Warning
Disabling checkpoints is not recommended as CouchDB will scanthe Source database’s changes feed from the beginning.- [replicator]
cert_file
Path to a file containing the user’s certificate:- [replicator]
cert_file = /full/path/to/server_cert.pem
- [replicator]
key_file
Path to file containing user’s private PEM encoded key:- [replicator]
key_file = /full/path/to/server_key.pem
- [replicator]
password
String containing the user’s password. Only used if the private key fileis password protected:- [replicator]
password = somepassword
- [replicator]
verify_ssl_certificates
Set to true to validate peer certificates:- [replicator]
verify_ssl_certificates = false
- [replicator]
ssl_trusted_certificates_file
File containing a list of peer trusted certificates (in the PEMformat):- [replicator]
ssl_trusted_certificates_file = /etc/ssl/certs/ca-certificates.crt
- [replicator]
ssl_certificate_max_depth
Maximum peer certificate depth (must be set even if certificatevalidation is off):- [replicator]
ssl_certificate_max_depth = 3
- [replicator]
auth_plugins
New in version 2.2.
List of replicator client authentication plugins. Plugins willbe tried in order and the first to initialize successfully willbe used. By default there are two plugins available:_couch_replicator_auth_session implementing session (cookie)authentication, and couch_replicator_auth_noop implementing basicauthentication. For backwards compatibility, the no-op plugin should be used atthe end of the plugin list:- [replicator]
auth_plugins = couch_replicator_auth_session,couch_replicator_auth_noop
Note
In version 2.2, the session plugin is considered experimental and is not enabled by default.- [replicator]
原文: http://docs.couchdb.org/en/stable/config/replicator.html