Changeset View
Changeset View
Standalone View
Standalone View
README.md
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | |||||
a running Postgresql database. | a running Postgresql database. | ||||
### Sample configuration | ### Sample configuration | ||||
A typical configuration `storage.yml` file is: | A typical configuration `storage.yml` file is: | ||||
``` | ``` | ||||
storage: | storage: | ||||
cls: local | cls: postgresql | ||||
db: "dbname=softwareheritage-dev user=<user> password=<pwd>" | db: "dbname=softwareheritage-dev user=<user> password=<pwd>" | ||||
objstorage: | objstorage: | ||||
cls: pathslicing | cls: pathslicing | ||||
root: /tmp/swh-storage/ | root: /tmp/swh-storage/ | ||||
slicing: 0:2/2:4/4:6 | slicing: 0:2/2:4/4:6 | ||||
``` | ``` | ||||
which means, this uses: | which means, this uses: | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
configuration. | configuration. | ||||
``` | ``` | ||||
storage: | storage: | ||||
cls: remote | cls: remote | ||||
url: http://localhost:5002/ | url: http://localhost:5002/ | ||||
``` | ``` | ||||
You could directly define a local storage with the following snippet: | You could directly define a postgresql storage with the following snippet: | ||||
``` | ``` | ||||
storage: | storage: | ||||
cls: local | cls: postgresql | ||||
db: service=swh-dev | db: service=swh-dev | ||||
objstorage: | objstorage: | ||||
cls: pathslicing | cls: pathslicing | ||||
root: /home/storage/swh-storage/ | root: /home/storage/swh-storage/ | ||||
slicing: 0:2/2:4/4:6 | slicing: 0:2/2:4/4:6 | ||||
``` | ``` | ||||
## Cassandra | |||||
As an alternative to PostgreSQL, swh-storage can use Cassandra as a database backend. | |||||
It can be used like this: | |||||
``` | |||||
storage: | |||||
cls: cassandra | |||||
hosts: | |||||
- localhost | |||||
objstorage: | |||||
cls: pathslicing | |||||
root: /home/storage/swh-storage/ | |||||
slicing: 0:2/2:4/4:6 | |||||
``` | |||||
The Cassandra swh-storage implementation supports both Cassandra >= 4.0-alpha2 | |||||
and ScyllaDB >= 4.4 (and possibly earlier versions, but this is untested). | |||||
While the main code supports both transparently, running tests | |||||
or configuring the schema requires specific code when using ScyllaDB, | |||||
douardda: maybe prefer 'environment variable' here (I find 'configuration variable' confusing, looks like… | |||||
Done Inline Actionsyes indeed vlorentz: yes indeed | |||||
enabled by setting the `SWH_USE_SCYLLADB=1` environment variable. |
maybe prefer 'environment variable' here (I find 'configuration variable' confusing, looks like something one has to put in the swh config file)