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 to be present (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 2
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
An app deployed by this charm can be related to charm-haproxy:
juju deploy <cockroachdb-charm-src-dir> --config default-zone-replicas=3 --config system-data-replicas=3 -n 3
juju deploy <haproxy-charm-src-dir>
juju relate haproxy cockroachdb
Currently the WEB UI is not exposed to an HTTP load-balancer (only postgres protocol connections over TCP are).
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.