docs: standardize all configuration examples to singular 'replica' format (#822)

Co-authored-by: Takayuki Miyahara <voyager.3taka28@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Cory LaNou
2025-11-07 17:37:29 -06:00
committed by GitHub
parent 0a0e7e4663
commit ee93ed319a
6 changed files with 48 additions and 46 deletions

View File

@@ -101,10 +101,10 @@ go test -race -v ./[backend]/...
## Configuration Pattern
```yaml
replicas:
- type: [backend]
option1: value1
option2: value2
replica:
type: [backend]
option1: value1
option2: value2
```
## References

View File

@@ -71,10 +71,10 @@ Create a new storage backend implementation for Litestream with all required com
5. **Add Documentation**
Update README.md with configuration example:
```yaml
replicas:
- type: {{backend_name}}
option1: value1
option2: value2
replica:
type: {{backend_name}}
option1: value1
option2: value2
```
## Key Requirements

View File

@@ -372,13 +372,13 @@ jobs:
cat > /tmp/sftp-concurrent.yml <<EOF
dbs:
- path: /tmp/test-concurrent.db
replicas:
- type: sftp
host: localhost:2222
key-path: /test/id_ed25519
user: root
path: /test/data/concurrent
concurrent-writes: true
replica:
type: sftp
host: localhost:2222
key-path: /test/id_ed25519
user: root
path: /test/data/concurrent
concurrent-writes: true
EOF
# Create test database
@@ -398,12 +398,12 @@ jobs:
cat > /tmp/sftp-sequential.yml <<EOF
dbs:
- path: /tmp/test-sequential.db
replicas:
- type: sftp
host: localhost:2222
key-path: /test/id_ed25519
user: root
path: /test/data/sequential
replica:
type: sftp
host: localhost:2222
key-path: /test/id_ed25519
user: root
path: /test/data/sequential
concurrent-writes: false
EOF

View File

@@ -773,11 +773,11 @@ l0-retention: 5m # Minimum time to keep compacted L0 files
l0-retention-check-interval: 15s # Frequency for enforcing L0 retention
dbs:
- path: /path/to/db.sqlite
replicas:
- type: s3
bucket: my-bucket
path: db-backup
sync-interval: 10s # How often to sync
replica:
type: s3
bucket: my-bucket
path: db-backup
sync-interval: 10s # How often to sync
# Compaction configuration (default)
levels:

View File

@@ -4,21 +4,23 @@
# dbs:
# - path: /path/to/primary/db # Database to replicate from
# replicas:
# - path: /path/to/replica # File-based replication
# - url: s3://my.bucket.com/db # S3-based replication
# - type: nats # NATS JetStream replication
# url: nats://nats.example.com:4222
# bucket: litestream-backups
# # Optional TLS configuration:
# # client-cert: /path/to/client.pem
# # client-key: /path/to/client.key
# # root-cas: [/path/to/ca.pem]
# - url: sftp://user@host:22/path # SFTP-based replication
# key-path: /etc/litestream/sftp_key
# # Strongly recommended: SSH host key for verification
# # Get this from the server's /etc/ssh/ssh_host_*.pub file
# # or use `ssh-keyscan hostname`
# # Example formats:
# # host-key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMvvypUkBrS9RCyV//p+UFCLg8yKNtTu/ew/cV6XXAAP
# # host-key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ...
# replica:
# path: /path/to/replica # File-based replication
# url: s3://my.bucket.com/db # S3-based replication
# type: nats # NATS JetStream replication
# url: nats://nats.example.com:4222
# bucket: litestream-backups
# # Optional TLS configuration:
# # client-cert: /path/to/client.pem
# # client-key: /path/to/client.key
# # root-cas: [/path/to/ca.pem]
# - path: /path/to/another/db
# replica:
# url: sftp://user@host:22/path # SFTP-based replication
# key-path: /etc/litestream/sftp_key
# # Strongly recommended: SSH host key for verification
# # Get this from the server's /etc/ssh/ssh_host_*.pub file
# # or use `ssh-keyscan hostname`
# # Example formats:
# # host-key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMvvypUkBrS9RCyV//p+UFCLg8yKNtTu/ew/cV6XXAAP
# # host-key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ...

View File

@@ -408,8 +408,8 @@ func CreateSoakConfig(dbPath, replicaURL string, s3Config *S3Config, shortMode b
config.WriteString(" min-checkpoint-page-count: 100\n")
config.WriteString(" max-checkpoint-page-count: 5000\n")
config.WriteString("\n")
config.WriteString(" replicas:\n")
config.WriteString(fmt.Sprintf(" - url: %s\n", replicaURL))
config.WriteString(" replica:\n")
config.WriteString(fmt.Sprintf(" url: %s\n", replicaURL))
// Add S3-specific settings if provided
if s3Config != nil {