Docker
You can run Replicator using Docker Compose, on any machine, which has Docker installed.
We prepared a complete set of files for this scenario. You find those files in the Replicator repository.
The Compose file includes the following components:
- Replicator itself
- Prometheus, pre-configured to scrape Replicator metrics endpoint
- Grafana, pre-configured to use Prometheus, with the Replicator dashboard included
Configuration
Section titled “Configuration”Before spinning up this setup, you need to change the replicator.yml file. Find out about Replicator settings on the Configuration page. Check the sample configuration file to the repository.
The sample configuration enables verbose logging using the REPLICATOR_DEBUG environment variable. For production deployments, you should remove it from the configuration.
Monitoring
Section titled “Monitoring”When you start all the component using docker-compose up, you’d be able to check the Replicator web UI by visiting http://localhost:5000, as well as Grafana at http://localhost:3000. Use admin/admin default credentials for Grafana. The Replicator dashboard is included in the deployment, so you can find it in the dashboards list.
OAuth authentication
Section titled “OAuth authentication”Every auth option can be set with an environment variable named REPLICATOR_<SIDE>_AUTH_<OPTION>. For example, to authenticate the sink with OAuth client credentials while the reader keeps using basic credentials from its connection string, add the variables to the replicator service in docker-compose.yml:
services: replicator: container_name: repl-replicator image: eventstore/replicator:latest ports: - "5000:5000" volumes: - ./replicator.yml:/app/config/appsettings.yaml - ./transform.js:/app/transform.js - ./client-secret.txt:/run/secrets/replicator_client_secret environment: REPLICATOR_SINK_AUTH_TYPE: oauthClientCredentials REPLICATOR_SINK_AUTH_TOKENENDPOINT: https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token REPLICATOR_SINK_AUTH_CLIENTID: <replicator-app-client-id> REPLICATOR_SINK_AUTH_CLIENTSECRETFILE: /run/secrets/replicator_client_secret REPLICATOR_SINK_AUTH_SCOPE: api://kurrentdb/.defaultReplicator prints the environment variables it loads at startup, with connection strings, all auth values except type, and any value containing credentials (a URI with user info such as mongodb://user:pass@host, or DefaultUserCredentials=) masked as ***. See Authentication for every option.