Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
90 lines
3.6 KiB
Markdown
90 lines
3.6 KiB
Markdown
# core
|
||
|
||
## Clustering
|
||
|
||
R9T replicates its metadata (buckets, objects, tags, multipart uploads) with Raft (Apache Ratis).
|
||
Object data is stored as immutable blobs under `<workdir>/.blobs`; every node pulls the blobs it is missing
|
||
from the other nodes.
|
||
|
||
| Variable | Default | Description |
|
||
|---|---|---|
|
||
| `DEV_DINAUER_R9T_RAFT_NODES` | empty | Comma separated `host:raftPort` list of all nodes. Empty runs a silent single node cluster. |
|
||
| `DEV_DINAUER_R9T_RAFT_SELF` | hostname | The entry of `DEV_DINAUER_R9T_RAFT_NODES` that is this node (host or `host:port`). |
|
||
| `DEV_DINAUER_R9T_RAFT_PORT` | `9870` | Raft port of a single node cluster (bound to `127.0.0.1`). |
|
||
| `DEV_DINAUER_R9T_RAFT_ADVERTISED_URL` | `http://<host>:<http port>` | URL other nodes use to fetch blobs from this node. |
|
||
| `DEV_DINAUER_R9T_RAFT_MIN_REPLICAS` | `2` | A PUT returns once this many nodes hold the blob (capped at the cluster size). |
|
||
| `DEV_DINAUER_R9T_RAFT_REPLICATION_TIMEOUT` | `PT60S` | How long a PUT waits for `MIN_REPLICAS` before answering `503`. |
|
||
| `DEV_DINAUER_R9T_RAFT_TIMEOUT` | `PT15S` | Timeout for metadata writes and linearizable reads. |
|
||
| `DEV_DINAUER_R9T_RAFT_RECONCILE_INTERVAL` | `PT1M` | Interval of the background job that pulls missing blobs and deletes orphans. |
|
||
|
||
Example for three nodes:
|
||
|
||
```shell script
|
||
DEV_DINAUER_R9T_RAFT_NODES=r9t-1:9870,r9t-2:9870,r9t-3:9870
|
||
DEV_DINAUER_R9T_RAFT_SELF=r9t-1:9870
|
||
```
|
||
|
||
All nodes must share the same credentials, the HTTP port and the Raft port must be reachable between nodes.
|
||
The node list is fixed when a cluster is first started: a node refuses to start if the configured list differs from
|
||
the membership stored in `<workdir>/.raft`. Turning an existing single node into a cluster is not supported yet.
|
||
|
||
Data written by versions before clustering (one directory per bucket with xattr metadata) is not read anymore,
|
||
start with an empty workdir.
|
||
|
||
This project uses Quarkus, the Supersonic Subatomic Java Framework.
|
||
|
||
If you want to learn more about Quarkus, please visit its website: <https://quarkus.io/>.
|
||
|
||
## Running the application in dev mode
|
||
|
||
You can run your application in dev mode that enables live coding using:
|
||
|
||
```shell script
|
||
./mvnw quarkus:dev
|
||
```
|
||
|
||
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at <http://localhost:8080/q/dev/>.
|
||
|
||
## Packaging and running the application
|
||
|
||
The application can be packaged using:
|
||
|
||
```shell script
|
||
./mvnw package
|
||
```
|
||
|
||
It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory.
|
||
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.
|
||
|
||
The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`.
|
||
|
||
If you want to build an _über-jar_, execute the following command:
|
||
|
||
```shell script
|
||
./mvnw package -Dquarkus.package.jar.type=uber-jar
|
||
```
|
||
|
||
The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`.
|
||
|
||
## Creating a native executable
|
||
|
||
You can create a native executable using:
|
||
|
||
```shell script
|
||
./mvnw package -Dnative
|
||
```
|
||
|
||
Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
|
||
|
||
```shell script
|
||
./mvnw package -Dnative -Dquarkus.native.container-build=true
|
||
```
|
||
|
||
You can then execute your native executable with: `./target/core-1.0.0-SNAPSHOT-runner`
|
||
|
||
If you want to learn more about building native executables, please consult <https://quarkus.io/guides/maven-tooling>.
|
||
|
||
## Related Guides
|
||
|
||
- REST ([guide](https://quarkus.io/guides/rest)): Build RESTful web services and APIs using Jakarta REST (formerly JAX-RS)
|