-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathconfig.toml
160 lines (137 loc) · 6.7 KB
/
config.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Path to target SQLite database
db_path="/tmp/marmot.db"
# ID to uniquely identify your nodes in your cluster
# It's recommended to always configure this
# node_id=1
# Path to persist the saved sequence map on disk for warm reboot
# If this file is missing Marmot has to download snapshot
# and replay all logs in order to restore database
# seq_map_path="/tmp/seq-map.cbor"
# Replication enabled/disabled (default: true)
# This will allow process to consume incoming changes from NATS
# replicate = true
# Publishing enabled/disabled (default: true)
# This will allow process to control publishing of local DB changes to NATS
# publish = true
# Number of maximum rows to process per change allows configuring the maximum number of rows Marmot
# will process (scan/load in memory) before publishing to NATS (default: 512)
# scan_max_changes = 512
# Cleanup interval in milliseconds used to clean up published rows. This is done in order to reduce write
# load on the system (default: 5000)
# cleanup_interval = 5000
# Sleep timeout in milliseconds, useful for serverless scenarios. If there is no activity within given timelimit,
# a snapshot will be performed, and process will exit. Value of 0 means it's disabled (default: 0).
# sleep_timeout = 15000
# Polling interval in milliseconds, that will explicitly check DB for change logs. This should not be required,
# it's only useful for broken or buggy file system watchers. Value of 0 means it's disabled (default: 0)
# polling_interval = 0
# Snapshots are used to limit log size and have a database snapshot backedup on your
# configured blob storage (NATS for now). This helps speedier recovery or cold boot
# nodes to come up. A Snapshot is taken every log entries are close to max_entries
# configured in replication_log section. It's recommended to use a large value
# for maximum entries in replication log, because SQLite can do 1000s of TPS
# replaying a couple thousands of entries should be really quick.
[snapshot]
# Disabling snapshot disables both restore and save
enabled=true
# Storage for snapshot can be "nats" | "webdav" | "s3" (default "nats")
store="nats"
# Interval sets perodic interval in milliseconds after which an automatic snapshot should be saved
# If there was a snapshot saved within interval range due to other log threshold triggers, then
# new snapshot won't be saved (since it's within time range), a value of 0 means it's disabled.
interval=0
# When setting snapshot.store to "nats" [snapshot.nats] will be used to configure snapshotting details
# NATS connection settings (urls etc.) will be loaded from global [nats] configurations
[snapshot.nats]
# Number of NATS replicas of snapshot object store (max 5). Recommended values: 2-3
replicas=1
# Bucket name for object store to save snapshot on.
#bucket="custom-bucket-name"
# When setting snapshot.store to "s3" [snapshot.s3] will be used to configure snapshotting details
[snapshot.s3]
# For S3 this will be `s3.region-code.amazonaws.com` (check your AWS Console for details).
# For Minio this will point to the host where Minio lives
endpoint="127.0.0.1:9000"
# Directory path within bucket where snapshot is saved and restore from
path="snapshots/marmot"
# By default false but should be set to true depending upong Minio configuration, for S3 it should be
# always true. This essentially lets you select between https and http for your hosting.
use_ssl=false
# Access key ID or Minio user name
#access_key="marmot"
# Secret Key or Minio password
#secret="ChangeMe"
# Bucket name where snapshots live
bucket="marmot"
[snapshot.webdav]
# URL of the WebDAV server root
url="https://<webdav_server>/<web_dav_path>?dir=/snapshots/path/for/marmot&login=<username>&secret=<password>"
[snapshot.sftp]
# URL of the SFTP server with path
url="sftp://<user>:<password>@<sftp_server>:<port>/path/to/save/snapshot"
# Change log that is published and persisted in JetStreams by Marmot.
# Marmot auto-configures missing JetStreams when booting up for you.
[replication_log]
# Number of replicas per log to configure (user > 1 for failover and redundancy).
replicas=1
# Number of shards to divide the logs over, each JetStream and subject will be prefixed
# by the configured `subject_prefix` and `stream_prefix` under nats
shards=1
# Max log entries JetStream should persist, JetStream is configured to drop older entries
# Each JetStream is configured to persist on file.
max_entries=1024
# Enable log compression, uses zstd to compress logs as they are streamd to NATS
# This is useful for DB storing large blobs that can be compressed.
compress=true
# Update existing stream if the configurations of JetStream don't match up with configurations
# generated due to parameters above. Use this option carefully because changing shards,
# or max_etries etc. might have undesired side-effects on existing running cluster
update_existing=false
# NATS server configurations
[nats]
# List of NATS server to use as boot server. Reference NATS documentation on how to pass
# authentication credentials as part of URL. Leaving out this list empty will result
# in embedded NATS server being started with node named `marmot-node-{node_id}`.
# NATS configuration can provided via `server_config` variable
urls=[
# "nats://localhost:4222"
# "nats://<user>:<password>@<host>:<port>"
]
# Embedded server bind address
bind_address="0.0.0.0:4222"
# Embedded server config file (will only be used if URLs array is empty)
server_config=""
# Subject prefix used when publishing log entries, it's usually suffixed by shard number
# to get the full subject name
subject_prefix="marmot-change-log"
# JetStream name prefix used for publishing log entries, it's usually suffixed by shard number
# to get the full JetStream name
stream_prefix="marmot-changes"
# Seed file used for client nkey authentication
# nk -gen user > user.seed
# nk -inkey user.seed -pubout > user.pub
# Set to user.seed
# Reference https://docs.nats.io/running-a-nats-service/nats_admin/security/jwt#what-are-nkeys
seed_file=""
# User credentials used for plain user password authentication
user_name=""
user_password=""
# Number of retries when establishing the NATS server connection (will only be used if URLs array is not empty)
connect_retries=5
# Wait time between NATS reconnect attempts (will only be used if URLs array is not empty)
reconnect_wait_seconds=2
[prometheus]
# Enable/Disable prometheus telemetry collection
enable=false
# HTTP endpoint to expose for prometheus matrix collection
# bind=":3010"
# Namespace for prometheus (default: `marmot`), applies to all counters, gaugues, histograms
# namespace=""
# Subsystem for prometheus (default: empty), applies to all counters, gauges, histograms
# subsystem=""
# Console STDOUT configurations
[logging]
# Configure console logging
verbose=true
# "console" | "json"
format="console"