This charm provides means to deploy and operate cockroachdb - a scalable, cloud-native SQL database with built-in clustering support.
The charm requires Juju 2.7.5 or above (see LP: #1865229).
In order to deploy CockroachDB in a single-node mode, set replication factors to 1 explicitly.
juju deploy <charm-src-dir> --config default-zone-replicas=1 --config system-data-replicas=1
CockroachDB will use a replication factor of 3 unless explicitly specified.
juju deploy <charm-src-dir>
juju add-unit cockroachdb -n 3
HA with an explicit amount of replicas.
juju deploy <charm-src-dir> --config default-zone-replicas=3 --config system-data-replicas=3 -n 3
juju ssh cockroachdb/0
cockroach sql
The web UI is accessible at https://<unit-ip>:8080
The charm uses a workaround for LP: #1859769 for single-node deployments by saving a cluster ID in a local state before the peer relation becomes available.