### Initializing, Building, and Running rqlite | bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/install-rqlite/building-from-source/_index.md This snippet outlines the steps to download the rqlite source code into a designated directory, build the `rqlited` binary using `go install`, and then start a single rqlite node instance. It assumes Go 1.23.4+ and a C compiler are installed and the `GOPATH` environment variable is set. The final command starts a node listening on localhost:4001 using a data directory `~/node.1`. ```bash mkdir rqlite # Or any directory of your choice. cd rqlite/ export GOPATH=$PWD mkdir -p src/github.com/rqlite cd src/github.com/rqlite git clone https://github.com/rqlite/rqlite.git cd rqlite go install ./... $GOPATH/bin/rqlited ~/node.1 ``` -------------------------------- ### Installing rqlite on macOS - Homebrew Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Quick-start/_index.md Installs the rqlite server (`rqlited`) and client (`rqlite`) executables on a macOS system using the Homebrew package manager. ```homebrew brew install rqlite ``` -------------------------------- ### Starting rqlite with Docker - Docker Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Quick-start/_index.md Runs rqlite using the official Docker image, making the database accessible by mapping the container's internal port 4001 to the host machine's port 4001. ```docker docker run -p 4001:4001 rqlite/rqlite ``` -------------------------------- ### Starting a Single rqlite Node - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Quick-start/_index.md Launches a single rqlite node from a pre-built binary, specifying a node ID and a directory for storing data. The node listens on the default HTTP address (localhost:4001) unless configured otherwise. ```bash $ rqlited -node-id=1 data/ ``` -------------------------------- ### Starting Additional Nodes for Clustering - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Quick-start/_index.md Starts two new rqlite nodes to form a cluster with an existing node. Each new node is given a unique ID, custom HTTP and RAFT addresses, and joins the cluster via the address of the initial node. ```bash $ rqlited -node-id 2 -http-addr localhost:4003 -raft-addr localhost:4004 -join localhost:4002 data2/ ``` ```bash $ rqlited -node-id 3 -http-addr localhost:4005 -raft-addr localhost:4006 -join localhost:4002 data3/ ``` -------------------------------- ### Performing Database Operations - rqlite Shell Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Quick-start/_index.md Demonstrates interacting with a running rqlite node using the rqlite command-line shell. It shows how to connect to the database, execute SQL commands like CREATE TABLE, INSERT, and SELECT, and use shell-specific commands like .schema to inspect the database. ```rqlite shell $ rqlite 127.0.0.1:4001> CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name TEXT) 1 row affected (0.000668 sec) 127.0.0.1:4001> .schema +-----------------------------------------------------------------------------+ | sql | +-----------------------------------------------------------------------------+ | CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name TEXT) | +-----------------------------------------------------------------------------+ 127.0.0.1:4001> INSERT INTO foo(name) VALUES("fiona") 1 row affected 127.0.0.1:4001> SELECT * FROM foo +----+-------+ | id | name | +----+-------+ | 1 | fiona | +----+-------+ ``` -------------------------------- ### Starting rqlite Node with TLS/Auth - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Security/_index.md Example command to start the first rqlite node in a cluster with HTTPS enabled for the HTTP API, TLS encryption for inter-node (Raft) communication, and Basic Authentication using the specified configuration file. This command assumes the necessary certificate/key files and the configuration file exist at the provided paths. ```Bash rqlited -auth config.json -http-cert server.crt -http-key key.pem \ -node-cert node.crt -node-key node-key.pem ~/node.1 ``` -------------------------------- ### Rebuilding and Running rqlite | bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/install-rqlite/building-from-source/_index.md This snippet shows how to navigate back to the rqlite source directory within the `GOPATH`, rebuild the project using `go install ./...`, and then restart the `rqlited` process. This is used for quickly testing code changes after the initial build setup is complete. It requires the `$GOPATH` to be set correctly. ```bash cd $GOPATH/src/github.com/rqlite/rqlite go install ./... $GOPATH/bin/rqlited ~/node.1 ``` -------------------------------- ### Installing Code Generation Tools and Running Go Generate | bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/install-rqlite/building-from-source/_index.md This snippet provides commands to install specific Go tools (`protoc-gen-go` and `flagforge`) needed for code generation tasks like processing Protobuf definitions or command-line flags. It then updates the `PATH` environment variable to include the `$GOPATH/bin` directory where the installed tools reside and finally runs `go generate ./...` in the rqlite source directory to perform the code generation. This is only required if certain core definition files are modified. ```bash go install google.golang.org/protobuf/cmd/protoc-gen-go go install github.com/rqlite/flagforge/cmd/flagforge@latest export GOBIN=$GOPATH/bin export PATH=$PATH:$GOBIN go generate ./... ``` -------------------------------- ### Get rqlite Pprof Cmdline Data - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Retrieve the command line arguments used to start the rqlite process using the pprof /debug/pprof/cmdline endpoint via `curl`. This is useful for verifying startup configuration. ```bash curl localhost:4001/debug/pprof/cmdline ``` -------------------------------- ### Starting Initial rqlite Node (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/general-guidelines/_index.md Start the first node of a rqlite cluster, which will act as the initial leader. This command sets the unique node ID, the address for the HTTP API client interface, the address for Raft intra-cluster communication, and the directory where the node will store its state. ```Bash # Run this on host 1: $ rqlited -node-id 1 -http-addr host1:4001 -raft-addr host1:4002 ~/node ``` -------------------------------- ### Configuring rqlited with SQLite DB on RAM Disk and Raft Log on Persistent Disk (Shell) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Performance/_index.md This sequence first mounts a 4GB temporary filesystem (RAM disk) at `/mnt/ramdisk`. It then starts rqlited, using `-on-disk-path` to place the SQLite database file (`db.sqlite`) on the RAM disk (`/mnt/ramdisk/node1/db.sqlite`) for high performance reads, while keeping the Raft log and other essential data on a persistent disk (`/path_to_persistent_disk/data`) to ensure data durability, as the Raft log is the source of truth. ```Shell mount -t tmpfs -o size=4096m tmpfs /mnt/ramdisk rqlited -on-disk-path /mnt/ramdisk/node1/db.sqlite /path_to_persistent_disk/data ``` -------------------------------- ### Scheduling Automatic PRAGMA optimize on rqlited Startup (Shell) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Performance/_index.md This command starts the rqlited node with the `-auto-optimze-int` flag set to 6 hours, causing rqlite to automatically run `PRAGMA optimize` every six hours. Setting the interval to '0h' disables automatic optimization. ```Shell rqlited -auto-optimze-int=6h # rqlite will run 'PRAGMA optimize' every six hours ``` -------------------------------- ### Creating SQLite database for CLI restore - bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Creates a sample SQLite database file (`mydb.sqlite`) using the `sqlite3` command-line tool to be used as input for the rqlite CLI's `.restore` command example. ```bash ~ $ sqlite3 mydb.sqlite SQLite version 3.22.0 2018-01-22 18:45:57 Enter ".help" for usage hints. sqlite> CREATE TABLE foo (id integer not null primary key, name text); sqlite> INSERT INTO "foo" VALUES(1,'fiona'); sqlite> .exit ``` -------------------------------- ### Running rqlite Docker Container - Docker Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/install-rqlite/_index.md This command pulls and runs the official rqlite Docker image, exposing port 4001 on the host machine. It launches a single rqlite node for immediate use. ```Docker docker run -p 4001:4001 rqlite/rqlite ``` -------------------------------- ### Installing rqlite using Homebrew - Homebrew Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/install-rqlite/_index.md This command utilizes the Homebrew package manager to download and install the rqlite binaries on macOS or Linux. It's a simple method for users with Homebrew already set up. ```Homebrew brew install rqlite ``` -------------------------------- ### Starting rqlite Node with Node Reaping Configuration (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/general-guidelines/_index.md This command starts an rqlite node with a specific ID and configures automatic removal of non-reachable voting nodes after 48 hours and non-voting nodes after 30 minutes. The 'data' argument specifies the data directory. These settings must be applied to all potential leader nodes for consistent reaping. ```bash rqlited -node-id 1 -raft-reap-node-timeout=48h -raft-reap-read-only-node-timeout=30m data ``` -------------------------------- ### Scheduling Automatic VACUUM on rqlited Startup (Shell) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Performance/_index.md This command starts the rqlited node with the `-auto-vacuum-int` flag set to 24 hours, instructing rqlite to automatically run the VACUUM command once every day. Setting the interval to '0h' disables automatic VACUUM. ```Shell rqlited -auto-vacuum-int=24h # rqlite will run an automatic VACUUM every day ``` -------------------------------- ### Speeding Up rqlite Builds by Pre-compiling SQLite | bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/install-rqlite/building-from-source/_index.md This snippet demonstrates how to pre-compile and install the `github.com/rqlite/go-sqlite3` library separately. This step is recommended to significantly reduce the time taken for subsequent full rqlite builds, as the time-consuming SQLite source compilation is performed only once. It assumes you are currently in the rqlite source directory within your `$GOPATH`. ```bash cd $GOPATH/src/github.com/rqlite/rqlite go install github.com/rqlite/go-sqlite3 ``` -------------------------------- ### Disabling Automatic PRAGMA optimize on rqlited Startup (Shell) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Performance/_index.md This command starts the rqlited node with the `-auto-optimze-int` flag set to 0 hours, explicitly disabling the automatic daily execution of the `PRAGMA optimize` command. ```Shell rqlited -auto-optimze-int=0h # Disable automatic optimization ``` -------------------------------- ### Creating a SQLite database file - bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Uses the `sqlite3` command-line tool to create a simple SQLite database file named `restore.sqlite`, defining a table `foo` and inserting a single row. This database is used as a source for subsequent loading examples. ```bash ~ $ sqlite3 restore.sqlite SQLite version 3.14.1 2016-08-11 18:53:32 Enter ".help" for usage hints. sqlite> CREATE TABLE foo (id integer not null primary key, name text); sqlite> INSERT INTO "foo" VALUES(1,'fiona'); sqlite> ``` -------------------------------- ### Checking Cluster Status - rqlite Shell Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Quick-start/_index.md Uses the rqlite command-line shell's built-in '.nodes' command to display information about all nodes in the cluster. It shows details such as node ID, API/RAFT addresses, voter status, reachability, and leader status. ```rqlite shell 127.0.0.1:4001> .nodes 1: api_addr: http://localhost:4001 addr: localhost:4002 voter: true reachable: true leader: true id: 1 2: api_addr: http://localhost:4003 addr: localhost:4004 voter: true reachable: true leader: false id: 2 3: api_addr: http://localhost:4005 addr: localhost:4006 voter: true reachable: true leader: false id: 3 ``` -------------------------------- ### Configuring rqlited with SQLite DB on a Separate Disk (Shell) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Performance/_index.md This command starts a rqlited node, specifying that the SQLite database file (`db.sqlite`) should be stored on a separate persistent disk located at `/disk2/node1/` via the `-on-disk-path` flag. The Raft log and other data are stored in the default data directory location, here represented by `/disk1/data`, optimizing I/O by separating concerns. ```Shell rqlited -on-disk-path /disk2/node1/db.sqlite /disk1/data ``` -------------------------------- ### Enabling SQLite Extensions in rqlite Docker Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/extensions/_index.md How to start the rqlite Docker container and enable pre-loaded SQLite extensions by setting the SQLITE_EXTENSIONS environment variable with a comma-separated list of extension keys. Requires the rqlite Docker image. ```Bash docker run -e SQLITE_EXTENSIONS='sqlean,icu' -p4001:4001 rqlite/rqlite ``` -------------------------------- ### Running rqlite Go Test Suite | bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/install-rqlite/building-from-source/_index.md This snippet demonstrates how to execute the Go test suite for the rqlite project. By navigating to the rqlite source directory within the `$GOPATH` and running `go test ./...`, all tests in packages within the project directory are discovered and run. This step is essential for verifying code changes before submitting a pull request. The output shows example test results for different packages. ```bash cd $GOPATH/src/github.com/rqlite/rqlite go test ./... ``` -------------------------------- ### Joining Second rqlite Node to Cluster (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/general-guidelines/_index.md Start a second rqlite node and connect it to an existing cluster by specifying the address of a node already in the cluster (preferably the leader). This command sets the new node's ID, its HTTP and Raft addresses, the join address, and its data directory. ```Bash # Run this on host 2: $ rqlited -node-id 2 -http-addr host2:4001 -raft-addr host2:4002 -join host1:4002 ~/node ``` -------------------------------- ### S3 Auto-Restore Configuration - JSON Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Provides a JSON configuration example used with the `-auto-restore` command-line flag to configure rqlite to automatically download and load a database backup from an Amazon S3 bucket upon startup. Specifies S3 credentials, region, bucket, and file path. ```json { "version": 1, "type": "s3", "timeout": "60s", "continue_on_failure": false, "sub": { "access_key_id": "$ACCESS_KEY_ID", "secret_access_key": "$SECRET_ACCESS_KEY_ID", "region": "$BUCKET_REGION", "bucket": "$BUCKET_NAME", "path": "backups/db.sqlite3.gz" } } ``` -------------------------------- ### Connecting to Remote rqlite Node (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/cli/_index.md Specify the target rqlite node's host address and port using the `-H` and `-p` command-line options when starting the `rqlite` client. ```Bash $ rqlite -H 192.168.0.1 -p 8493 192.168.0.1:8493> ``` -------------------------------- ### Bootstrapping rqlite Cluster via DNS (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/Automatic clustering/_index.md Starts rqlite nodes configured to discover peers using DNS A records. Nodes resolve a specified hostname (`rqlite.cluster`) and attempt to join all returned IP addresses on the default Raft port. This simplifies deployment as individual IP addresses are not required in the command. ```bash $ rqlited -node-id 1 -http-addr=$HOST1:4001 -raft-addr=$HOST1:4002 \ -disco-mode=dns -disco-config='{"name":"rqlite.cluster"}' -bootstrap-expect 3 data ``` ```bash $ rqlited -node-id 2 -http-addr=$HOST2:4001 -raft-addr=$HOST2:4002 \ -disco-mode=dns -disco-config='{"name":"rqlite.cluster"}' -bootstrap-expect 3 data ``` ```bash $ rqlited -node-id 3 -http-addr=$HOST3:4001 -raft-addr=$HOST3:4002 \ -disco-mode=dns -disco-config='{"name":"rqlite.cluster"}' -bootstrap-expect 3 data ``` -------------------------------- ### Bootstrapping rqlite Cluster with bootstrap-expect (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/Automatic clustering/_index.md Starts rqlite nodes configured for automatic bootstrapping. Nodes wait for a specified number of peers (`-bootstrap-expect`) to become available at the given join addresses (`-join`) before forming a cluster. This requires knowing all node addresses beforehand. ```bash rqlited -node-id 1 -http-addr=$HOST1:4001 -raft-addr=$HOST1:4002 \ -bootstrap-expect 3 -join $HOST1:4002,$HOST2:4002,$HOST3:4002 data ``` ```bash rqlited -node-id 2 -http-addr=$HOST2:4001 -raft-addr=$HOST2:4002 \ -bootstrap-expect 3 -join $HOST1:4002,$HOST2:4002,$HOST3:4002 data data ``` ```bash rqlited -node-id 3 -http-addr=$HOST3:4001 -raft-addr=$HOST3:4002 \ -bootstrap-expect 3 -join $HOST1:4002,$HOST2:4002,$HOST3:4002 data data ``` -------------------------------- ### Querying PRAGMA - rqlite HTTP API - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/API/api/_index.md Shows how to execute a `PRAGMA foreign_keys` query against the rqlite HTTP API `/db/query` endpoint using the `curl` command-line tool. It uses `GET`, requests pretty-printed JSON output and timings, and URL-encodes the query. Requires a running rqlite node on localhost:4001 and the `curl` utility. The output is a JSON object containing query results. ```bash $ curl -G 'localhost:4001/db/query?pretty&timings' --data-urlencode 'q=PRAGMA foreign_keys' { "results": [ { "columns": [ "foreign_keys" ], "types": [ "" ], "values": [ [ 0 ] ], "time": 0.000070499 } ], "time": 0.000540857 }$ ``` -------------------------------- ### Bootstrapping rqlite Cluster via etcd KV (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/Automatic clustering/_index.md Starts rqlite nodes configured to discover peers using an etcd key-value store. Nodes register their address with etcd and query etcd to find other nodes registered under the same discovery key, enabling automatic cluster formation. ```bash rqlited -node-id $ID1 -http-addr=$HOST1:4001 -raft-addr=$HOST1:4002 \ -disco-key rqlite1 -disco-mode etcd-kv -disco-config '{"endpoints":["example.com:2379"]}' data ``` ```bash rqlited -node-id $ID2 -http-addr=$HOST2:4001 -raft-addr=$HOST2:4002 \ -disco-key rqlite1 -disco-mode etcd-kv -disco-config '{"endpoints":["example.com:2379"]}' data ``` ```bash rqlited -node-id $ID3 -http-addr=$HOST3:4001 -raft-addr=$HOST3:4002 \ -disco-key rqlite1 -disco-mode etcd-kv -disco-config '{"endpoints":["example.com:2379"]}' data ``` -------------------------------- ### Listing and Using Loaded SQLite Extensions rqlite CLI Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/extensions/_index.md Example interaction with the rqlite command-line interface (rqlite) showing how to list loaded extensions using the .extensions command and how to invoke a function provided by a loaded extension, such as rot13(). Requires rqlite running with extensions loaded. ```rqlite CLI Welcome to the rqlite CLI. Enter ".help" for usage hints. Connected to http://127.0.0.1:4001 running version 8 127.0.0.1:4001> .extensions carray.so rot13.so 127.0.0.1:4001> SELECT rot13("abc") +--------------+ | rot13("abc") | +--------------+ | nop | +--------------+ ``` -------------------------------- ### Get Specific rqlite Expvar Data - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Fetch a specific section of expvar metrics, such as HTTP statistics, by using the `key` query parameter with the /debug/vars endpoint. This allows filtering the output to relevant data. ```bash curl localhost:4001/debug/vars?key=http ``` -------------------------------- ### Loading SQLite Extensions from File List rqlited CLI Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/extensions/_index.md Command to start the rqlite daemon (rqlited) and specify a comma-separated list of paths pointing directly to compiled SQLite extension files using the -extensions-path flag. Each specified file is loaded as an extension, exiting if any fail. ```rqlited CLI rqlited -extensions-path=~/extensions/rot13.so,~/extensions/carray.so data ``` -------------------------------- ### Loading SQLite Extensions from Directory rqlited CLI Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/extensions/_index.md Command to start the rqlite daemon (rqlited) and specify a directory path containing compiled SQLite extensions using the -extensions-path flag. rqlite attempts to load all files in the specified directory as extensions, exiting if any fail. ```rqlited CLI rqlited -extensions-path=~/extensions data ``` -------------------------------- ### Get rqlite Pprof CPU Profile - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Generate and retrieve a CPU profile of the rqlite process using the pprof /debug/pprof/profile endpoint via `curl`. This data is valuable for performance analysis. ```bash curl localhost:4001/debug/pprof/profile ``` -------------------------------- ### Get rqlite Pprof Symbol Table - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Retrieve the symbol table for the rqlite process using the pprof /debug/pprof/symbol endpoint via `curl`. This information helps in debugging and interpreting profiles. ```bash curl localhost:4001/debug/pprof/symbol ``` -------------------------------- ### Executing PRAGMA optimize via curl API (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Performance/_index.md This command sends an HTTP POST request to the rqlite execute API endpoint to run the SQLite `PRAGMA optimize` command. This command instructs SQLite to analyze tables and gather statistics, which can help the query planner improve performance. rqlite automatically runs this daily by default. ```Bash curl -XPOST 'localhost:4001/db/execute' -H "Content-Type: application/json" -d '["PRAGMA optimize"]' ``` -------------------------------- ### Bootstrapping rqlite Cluster via DNS SRV (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/Automatic clustering/_index.md Starts an rqlite node configured to discover peers using DNS SRV records. Nodes look up SRV records for a specific service (`rqlite-raft`) and domain (`rqlite.local`), which provides both IP addresses and custom ports for joining. ```bash rqlited -node-id $ID -http-addr=$HOST:4001 -raft-addr=$HOST:4002 \ -disco-mode=dns-srv -disco-config='{"name":"rqlite.local","service":"rqlite-raft"}' \ -bootstrap-expect 3 data ``` -------------------------------- ### Joining Third rqlite Node to Cluster (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/general-guidelines/_index.md Start a third rqlite node and join it to the cluster created by the previous steps. This expands the cluster size to 3 nodes, providing fault tolerance. The command is similar to joining the second node, using a unique node ID and specifying an existing node's address to join. ```Bash # Run this on host 3: $ rqlited -node-id 3 -http-addr host3:4001 -raft-addr host3:4002 -join host1:4002 ~/node ``` -------------------------------- ### Dump rqlite Database as SQL Text via API using Curl Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Send a GET request to the /db/backup API endpoint with the fmt=sql query parameter using curl. This retrieves the database content formatted as a SQL text dump and saves it to a file. ```bash curl -s -XGET localhost:4001/db/backup?fmt=sql -o bak.sql ``` -------------------------------- ### Get rqlite Expvar Data - rqlite CLI Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Access expvar runtime metrics and counters directly from the rqlite command-line interface. This command uses the built-in `.expvar` command within the rqlite interactive shell. ```rqlite CLI 127.0.0.1:4001> .expvar ``` -------------------------------- ### Backup rqlite to File via API using Curl Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Use the curl command to make a GET request to the /db/backup endpoint of an rqlite node's API. This downloads the SQLite database backup directly to a local file. Assumes the node is accessible via HTTP. ```bash curl -s -XGET localhost:4001/db/backup -o bak.sqlite3 ``` -------------------------------- ### Bootstrapping rqlite Cluster via Consul KV (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/Automatic clustering/_index.md Starts rqlite nodes configured to discover peers using a Consul key-value store. Nodes register their address with Consul and query Consul to find other nodes registered under the same discovery key, forming a cluster automatically. ```bash rqlited -node-id $ID1 -http-addr=$HOST1:4001 -raft-addr=$HOST1:4002 \ -disco-key rqlite1 -disco-mode consul-kv -disco-config '{"address":"example.com:8500"}' data ``` ```bash rqlited -node-id $ID2 -http-addr=$HOST2:4001 -raft-addr=$HOST2:4002 \ -disco-key rqlite1 -disco-mode consul-kv -disco-config '{"address":"example.com:8500"}' data ``` ```bash rqlited -node-id $ID3 -http-addr=$HOST3:4001 -raft-addr=$HOST3:4002 \ -disco-key rqlite1 -disco-mode consul-kv -disco-config '{"address":"example.com:8500"}' data ``` -------------------------------- ### Loading SQLite Extensions from Zip File rqlited CLI Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/extensions/_index.md Command to start the rqlite daemon (rqlited) and specify the path to a zip archive containing compiled SQLite extensions using the -extensions-path flag. rqlite will extract and load extensions from the root of the zip file, exiting if any fail. ```rqlited CLI rqlited -extensions-path=~/extensions.zip data ``` -------------------------------- ### Get rqlite Nodes API Data (Pretty) - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Fetch basic information about nodes in the cluster, including reachability and leadership status, from the /nodes endpoint using `curl`. This command requests the data in pretty-printed JSON format. ```bash curl localhost:4001/nodes?pretty ``` -------------------------------- ### Automatic S3 Backup Configuration (Timestamp & No Compression) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md JSON configuration example demonstrating how to enable timestamping in the backup file path and disable compression for automatic S3 backups. 'timestamp' and 'no_compress' are added at the top level, combined with standard S3 sub-configuration. ```json { "version": 1, "type": "s3", "interval": "5m", "timestamp": true, "no_compress": true, "sub": { "access_key_id": "$ACCESS_KEY_ID", "secret_access_key": "$SECRET_ACCESS_KEY_ID", "region": "$BUCKET_REGION", "bucket": "$BUCKET_NAME", "path": "backups/db.sqlite3" } } ``` -------------------------------- ### Get rqlite Nodes API Data (Timeout) - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Fetch node information from the /nodes endpoint, specifying a maximum duration to wait for all nodes to respond. This `curl` command includes the `timeout` parameter set to 5 seconds. ```bash curl localhost:4001/nodes?timeout=5s ``` -------------------------------- ### Get rqlite Nodes Data - rqlite CLI Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Access the cluster's node information directly from the rqlite command-line interface. This command uses the built-in `.nodes` command within the rqlite interactive shell. ```rqlite CLI 127.0.0.1:4001> .nodes ``` -------------------------------- ### Get rqlite Expvar Data - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Retrieve standard and custom expvar runtime metrics and counters from the rqlite node's /debug/vars endpoint using `curl`. This endpoint provides detailed information about the process's internal state. ```bash curl localhost:4001/debug/vars ``` -------------------------------- ### Get rqlite Status API Data - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Retrieve detailed diagnostic and statistical information from the rqlite node's /status endpoint using `curl`. This command requests the data in a human-readable, pretty-printed JSON format. ```bash curl localhost:4001/status?pretty ``` -------------------------------- ### Get rqlite Nodes API Data (Non-voters) - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Request information about all nodes in the cluster, including both voting and non-voting members, from the /nodes endpoint. This `curl` command uses the `nonvoters` parameter along with `pretty` printing. ```bash curl localhost:4001/nodes?nonvoters&pretty ``` -------------------------------- ### Mounting a Temporary Filesystem (RAM Disk) (Shell) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Performance/_index.md This command mounts a temporary filesystem (tmpfs) on Linux at `/mnt/ramdisk` with a maximum size of 512MB. This can be used to place the rqlite data directory or the SQLite database file in memory for significantly improved I/O performance, but storing the Raft log here is risky as data may not persist across node failures. ```Shell mount -t tmpfs -o size=512m tmpfs /mnt/ramdisk ``` -------------------------------- ### Get rqlite Nodes API Data (Version 2) - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Retrieve node information from the /nodes endpoint in an improved JSON format better suited for parsing. This `curl` command specifies `pretty` for readability and `ver=2` for the enhanced format. ```bash curl localhost:4001/nodes?pretty&ver=2 ``` -------------------------------- ### Get rqlite Status Data - rqlite CLI Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Access the rqlite node's status information directly from the rqlite command-line interface. This command uses the built-in `.status` command within the rqlite interactive shell. ```rqlite CLI 127.0.0.1:4001> .status ``` -------------------------------- ### Joining rqlite Node Securely - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Security/_index.md Command to start a second rqlite node and join it to an existing cluster while maintaining the same security configurations (HTTPS, node-to-node TLS, Basic Auth) as the first node. It specifies a different HTTP and Raft address for the new node, targets the existing leader node using -join, and provides credentials using -join-as for the joining operation. ```Bash rqlited -auth config.json -http-addr localhost:4003 -http-cert server.crt \ -http-key key.pem -raft-addr :4004 -join localhost:4002 -join-as bob\ -node-cert node.crt -node-key node-key.pem ~/node.2 ``` -------------------------------- ### Executing Insert - rqlite HTTP API - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/API/api/_index.md Provides an example of executing an SQL INSERT statement on an rqlite cluster using the HTTP API's `/db/execute` endpoint via `curl`. It specifies a 2-minute timeout for the request using the `timeout` query parameter. The request uses `POST`, sets the `Content-Type`, and sends the SQL command and parameters as a JSON array in the request body. ```bash curl -XPOST 'localhost:4001/db/execute?timeout=2m' -H "Content-Type: application/json" -d '[ ["INSERT INTO foo(name, age) VALUES(?, ?)", "fiona", 20] ]' ``` -------------------------------- ### Querying rqlite Node Securely - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Security/_index.md Uses the curl command-line tool to send a secure GET request to the /db/query endpoint of an rqlite node configured with HTTPS and Basic Authentication. The command includes the username and password directly in the HTTPS URL and sends a URL-encoded SQL query, demonstrating how a client can authenticate and interact with the secured API. ```Bash curl -G 'https://mary:secret2@localhost:4001/db/query?pretty&timings' \ --data-urlencode 'q=SELECT * FROM foo' ``` -------------------------------- ### Defining User Permissions - rqlite - JSON Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Security/_index.md This JSON configuration file defines usernames, associated passwords, and specific permissions for accessing the rqlite HTTP API. It is used with the -auth command-line flag when starting an rqlite node to enable Basic Authentication and granular user control, allowing different users to access specific endpoints or perform certain operations. ```JSON [ { "username": "bob", "password": "secret1", "perms": ["all"] }, { "username": "mary", "password": "secret2", "perms": ["query", "backup", "join"] }, { "username": "*", "perms": ["status", "ready", "join-read-only"] } ] ``` -------------------------------- ### Executing VACUUM via curl API (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Performance/_index.md This command sends an HTTP POST request to the rqlite execute API endpoint (default port 4001) to run the SQLite VACUUM command. VACUUM defragments the database file, potentially improving query performance by reducing its size, but it can temporarily double disk usage and blocks writes during execution. ```Bash curl -XPOST 'localhost:4001/db/execute' -H "Content-Type: application/json" -d '["VACUUM"]' ``` -------------------------------- ### Querying rqlite with None Read Consistency and Freshness in Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/API/Read Consistency/_index.md Shows a 'none' consistency read combined with a freshness check using 'level=none&freshness=1s'. The read is fast, like a standard 'none' read, but only succeeds if the node last heard from the leader within the specified freshness duration (1 second in this example), bounding potential staleness. ```bash curl -G 'localhost:4001/db/query?level=none&freshness=1s' --data-urlencode 'q=SELECT * FROM foo' ``` -------------------------------- ### Booting rqlite node via HTTP - bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Demonstrates how to initialize a standalone rqlite node using the `/boot` HTTP endpoint and upload a SQLite database file for rapid initialization. Requires a running rqlite node and a SQLite database file. ```bash curl -XPOST 'http://localhost:4001/boot' -H "Transfer-Encoding: chunked" \ --upload-file largedb.sqlite ``` -------------------------------- ### Booting rqlite node via CLI - rqlite Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Shows the process of booting an rqlite node from a SQLite file using the rqlite command-line interface's `.boot` command, followed by a query to confirm successful data loading. Requires the rqlite CLI and a SQLite database file. ```rqlite ~ $ rqlite Welcome to the rqlite CLI. Enter ".help" for usage hints. 127.0.0.1:4001> .boot largedb.sqlite Node booted successfully 127.0.0.1:4001> SELECT * FROM foo +----+-------+ | id | name | +----+-------+ | 1 | fiona | +----+-------+ ``` -------------------------------- ### Connecting to Local rqlite Shell and Listing Commands (Shell) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/cli/_index.md Run the `rqlite` command without options to connect to a local node using default settings (127.0.0.1:4001). Use the `.help` command within the interactive shell to list all available administrative dot commands. ```Shell $ rqlite 127.0.0.1:4001> .help .backup Write database backup to SQLite file .consistency [none|weak|strong] Show or set read consistency level .dump Dump the database in SQL text format to a file .exit Exit this program .expvar Show expvar (Go runtime) information for connected node .help Show this message .indexes Show names of all indexes .nodes Show connection status of all nodes in cluster .ready Show ready status for connected node .remove Remove a node from the cluster .restore Restore the database from a SQLite database file or dump file .schema Show CREATE statements for all tables .status Show status and diagnostic information for connected node .sysdump Dump system diagnostics to a file for offline analysis .tables List names of tables 127.0.0.1:4001> ``` -------------------------------- ### Cloning a Forked rqlite Repository | bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/install-rqlite/building-from-source/_index.md This snippet provides instructions for cloning a personal fork of the rqlite repository instead of the main one, while still maintaining the required directory structure (`$GOPATH/src/github.com/rqlite`). This structure is crucial for Go's import paths to function correctly. It uses `git clone` with an SSH URL and requires replacing `` with the actual GitHub username. ```bash export GOPATH=$HOME/rqlite mkdir -p $GOPATH/src/github.com/rqlite cd $GOPATH/src/github.com/rqlite git clone git@github.com:/rqlite ``` -------------------------------- ### Applying Kubernetes Service Configuration (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Kubernetes/_index.md Downloads the rqlite Kubernetes service configuration YAML file from the rqlite GitHub repository and applies it using the `kubectl` command. This creates the necessary headless service for internal node communication and a standard service for client access. ```bash curl -s https://raw.githubusercontent.com/rqlite/kubernetes-configuration/master/service.yaml -o rqlite-service.yaml kubectl apply -f rqlite-service.yaml ``` -------------------------------- ### Displaying rqlite CLI Help (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/cli/_index.md Use the `-h` or `--help` option with the `rqlite` command to display the full list of available command-line options and their descriptions. ```Bash $> rqlite -h Options: -h, --help display help information -a, --alternatives comma separated list of 'host:port' pairs to use as fallback -s, --scheme[=http] protocol scheme (http or https) -H, --host[=127.0.0.1] rqlited host address -p, --port[=4001] rqlited host port -P, --prefix[=/] rqlited HTTP URL prefix -i, --insecure[=false] do not verify rqlited HTTPS certificate -c, --ca-cert path to trusted X.509 root CA certificate -u, --user set basic auth credentials in form username:password -v, --version display CLI version ``` -------------------------------- ### Applying rqlite 3-Node StatefulSet Configuration (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Kubernetes/_index.md Downloads the Kubernetes StatefulSet configuration YAML file designed for a 3-node rqlite cluster from the rqlite GitHub repository. It then applies this configuration using `kubectl` to create and deploy the rqlite StatefulSet, ensuring persistent storage and stable network identities for the nodes. ```bash curl -s https://raw.githubusercontent.com/rqlite/kubernetes-configuration/master/statefulset-3-node.yaml -o rqlite-3-nodes.yaml kubectl apply -f rqlite-3-nodes.yaml ``` -------------------------------- ### Loading rqlite from SQLite dump via HTTP - bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Converts a SQLite database file (`restore.sqlite`) into a text dump (`restore.dump`) using `sqlite3`, and then loads this dump into rqlite using a POST request to the `/db/load` endpoint with `Content-type: text/plain`. ```bash ~ $ echo '.dump' | sqlite3 restore.sqlite > restore.dump ~ $ curl -XPOST localhost:4001/db/load -H "Content-type: text/plain" --data-binary @restore.dump ``` -------------------------------- ### Backup rqlite to File via CLI Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Execute a command in the rqlite CLI shell to create a hot backup of the database to a specified file on the client's machine. Requires the rqlite shell to be connected to a node. ```rqlite CLI 127.0.0.1:4001> .backup bak.sqlite3 backup file written successfully ``` -------------------------------- ### Compiling and Packaging SQLite Extensions Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/extensions/_index.md Commands to create a directory for compiled extensions, compile C source files into shared libraries (.so) using gcc, and create a zip archive containing the compiled extensions. Requires the extension source files (e.g., rot13.c, carray.c), gcc, and zip tools. ```Bash # Create a directory to store the compiled extensions mkdir ~/extensions # Compile the extensions as per https://www.sqlite.org/loadext.html gcc -g -fPIC -shared rot13.c -o ~/extensions/rot13.so gcc -g -fPIC -shared carray.c -o ~/extensions/carray.so # Create a zip file containing both extensions, stripping leading path elements. zip -j ~/extensions.zip ~/extensions/rot13.so ~/extensions/carray.so ``` -------------------------------- ### Issuing PRAGMA - rqlite CLI Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/API/api/_index.md Demonstrates how to use the rqlite command-line interface to execute a `PRAGMA compile_options` statement. This command retrieves information about how the SQLite library linked with rqlite was compiled, including enabled features and default settings. It requires an active rqlite node running locally on port 4001 and outputs a formatted table. ```rqlite CLI 127.0.0.1:4001> pragma compile_options +----------------------------+ | compile_options | +----------------------------+ | COMPILER=gcc-7.5.0 | +----------------------------+ | DEFAULT_WAL_SYNCHRONOUS=1 | +----------------------------+ | ENABLE_DBSTAT_VTAB | +----------------------------+ | ENABLE_FTS3 | +----------------------------+ | ENABLE_FTS3_PARENTHESIS | +----------------------------+ | ENABLE_JSON1 | +----------------------------+ | ENABLE_RTREE | +----------------------------+ | ENABLE_UPDATE_DELETE_LIMIT | +----------------------------+ | OMIT_DEPRECATED | +----------------------------+ | OMIT_SHARED_CACHE | +----------------------------+ | SYSTEM_MALLOC | +----------------------------+ | THREADSAFE=1 | +----------------------------+ ``` -------------------------------- ### Bootstrapping rqlite Cluster with bootstrap-expect (Docker) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/Automatic clustering/_index.md Runs an rqlite Docker container configured for automatic bootstrapping. The container waits for the specified number of peers (`-bootstrap-expect`) at the given join addresses (`-join`) to form a cluster. This command is identical for all nodes except for the potential external network configuration mapping the container hostnames/IPs. ```bash docker run rqlite/rqlite -bootstrap-expect 3 -join $HOST1:4002,$HOST2:4002,$HOST3:4002 ``` -------------------------------- ### Loading rqlite from SQLite file via HTTP - bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Loads data into rqlite directly from a SQLite database file (`restore.sqlite`) using a POST request to the `/db/load` endpoint. This is the recommended process for loading from a file. ```bash ~ $ curl -v -XPOST localhost:4001/db/load -H "Content-type: application/octet-stream" --data-binary @restore.sqlite ``` -------------------------------- ### Verifying loaded data via rqlite CLI - rqlite Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Connects to the rqlite node using the CLI and executes a `SELECT` query to confirm that the data from the loaded SQLite database or dump file is accessible. ```rqlite $ rqlite 127.0.0.1:4001> SELECT * FROM foo +----+-------+ | id | name | +----+-------+ | 1 | fiona | +----+-------+ ``` -------------------------------- ### Executing SQL Statements and Exiting rqlite Shell (SQL/Shell) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/cli/_index.md Execute standard SQL commands like `CREATE TABLE`, `INSERT INTO`, and `SELECT` directly within the rqlite interactive shell prompt. Use the `.quit` command or `quit` to exit the interactive session. ```SQL/Shell 127.0.0.1:4001> CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name TEXT) 0 row affected (0.000362 sec) 127.0.0.1:4001> INSERT INTO foo(name) VALUES("fiona") 1 row affected (0.000117 sec) 127.0.0.1:4001> SELECT * FROM foo +----+-------+ | id | name | +----+-------+ | 1 | fiona | +----+-------+ 127.0.0.1:4001> quit bye~ ``` -------------------------------- ### Restoring rqlite from SQLite file via CLI - rqlite Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Shows how to load data into an rqlite node from a SQLite database file using the rqlite command-line interface's `.restore` command, followed by a query to confirm successful data loading. ```rqlite ~ $ rqlite Welcome to the rqlite CLI. Enter ".help" for usage hints. 127.0.0.1:4001> .restore mydb.sqlite Database restored successfully 127.0.0.1:4001> SELECT * FROM foo +----+-------+ | id | name | +----+-------+ | 1 | fiona | +----+-------+ ``` -------------------------------- ### Dump rqlite Database as SQL Text via CLI Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md Use the .dump command in the rqlite CLI shell to export the database schema and data as a series of SQL statements into a text file. Requires the rqlite shell to be connected. ```rqlite CLI 127.0.0.1:4001> .dump bak.sql SQL text file written successfully ``` -------------------------------- ### Scaling rqlite StatefulSet Up (Bash) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Kubernetes/_index.md Scales the existing rqlite Kubernetes StatefulSet to increase the number of replicas (rqlite nodes) to 9. This command instructs Kubernetes to add more pods to the StatefulSet, expanding the cluster size. ```bash kubectl scale statefulsets rqlite --replicas=9 ``` -------------------------------- ### Bootstrapping rqlite Cluster via etcd KV (Docker) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/Automatic clustering/_index.md Runs an rqlite Docker container configured for etcd-based discovery. The container uses the etcd KV store at the specified endpoint(s) to find and join other nodes in the cluster. ```bash docker run rqlite/rqlite -disco-mode=etcd-kv -disco-config '{"endpoints":["example.com:2379"]}' ``` -------------------------------- ### Check rqlite Node Readiness - Bash Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/Monitoring rqlite/_index.md Determine if a rqlite node is ready to handle database requests and cluster operations by querying the /readyz endpoint. A successful check returns HTTP 200 OK. ```bash $ curl localhost:4001/readyz ``` -------------------------------- ### Bootstrapping rqlite Cluster via Consul KV (Docker) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/Automatic clustering/_index.md Runs an rqlite Docker container configured for Consul-based discovery. The container uses the Consul KV store at the specified address to find and join other nodes in the cluster. ```bash docker run rqlite/rqlite -disco-mode=consul-kv -disco-config '{"address":"example.com:8500"}' ``` -------------------------------- ### Defining Peer Configuration for Cluster Recovery (JSON) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Clustering/general-guidelines/_index.md This JSON array defines the configuration for nodes in a recovered rqlite cluster. Each object represents a node, specifying its unique 'id', its network 'address' (IP:port), and whether it is a 'non_voter'. This file ('peers.json') is placed in the node's data/raft directory on all remaining nodes before restarting to force a cluster recovery. ```json [ { "id": "1", "address": "10.1.0.1:8300", "non_voter": false }, { "id": "2", "address": "10.1.0.2:8300", "non_voter": false }, { "id": "3", "address": "10.1.0.3:8300", "non_voter": false } ] ``` -------------------------------- ### Automatic S3 Backup Configuration (S3-Compliant Path Style - MinIO) Source: https://github.com/rqlite/rqlite.io/blob/master/content/en/docs/Guides/backup/_index.md JSON configuration for backing up rqlite to an S3-compliant provider like MinIO that uses path-style requests by default. Requires specifying the 'endpoint' and setting 'force_path_style' to true in the 'sub' object, along with credentials, region, bucket, and path. ```json { "version": 1, "type": "s3", "interval": "5m", "vacuum": false, "sub": { "access_key_id": "$ACCESS_KEY_ID", "secret_access_key": "$SECRET_ACCESS_KEY_ID", "endpoint": "https://s3.minio.example.com", "region": "us-east-1", "bucket": "rqlite-kq7z9xg", "path": "backups/db.sqlite3.gz", "force_path_style": true } } ```