basic

command
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Command basic runs an out-of-the-box embedded etcd with libraft installed.

The blank import of github.com/cnuss/libraft below is the entire integration: when ETCD_S3LOG_URL is set it monkey-patches etcd's raft entry points at init, so the embedded server stores its raft log in S3 instead of running raft. With the variable unset the installer is a no-op and this is a plain single-node embedded etcd — safe to run as a smoke test.

The URL is the http(s) endpoint of any S3-compatible store, followed by the bucket (lowercase) and an optional prefix:

export ETCD_S3LOG_URL=https://s3.us-east-1.amazonaws.com/my-bucket/my-prefix
export AWS_ACCESS_KEY_ID=…  AWS_SECRET_ACCESS_KEY=…
go run .

Or against a local MinIO (credentials default to minioadmin/minioadmin):

docker run -d -p 9000:9000 minio/minio server /data
ETCD_S3LOG_URL=http://127.0.0.1:9000/libraft-demo/basic go run .

Run it twice with ETCD_S3LOG_URL set: the second run starts from a brand-new data directory yet reads back the first run's value, restored from S3.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL