Command line reference¶
One binary, lokadb, runs the proxy, the tunnel and every administrative command. This page is generated from the program's own help text, so it matches the version the site was built from. lokadb COMMAND -h prints the flags of one command; DSN flags also accept a file or an environment variable instead of a password on the command line (configuration).
Overview¶
usage:
lokadb proxy -config lokadb.json [-record workload.json]
lokadb check -db DSN (-spec spec.json | -org-table TABLE [-write-spec F] | -tenant-column COL [-write-spec F]) [-workload F[,F]] [-app-role R[,R]] [-proxy-config F]
[-customer DSN [-customer-app DSN] [-customer-schema S] [-org N]] [-direct-forms forms.sql]
[-profile fdw|fdw+direct|direct] [-json]
exit code: 0 ready, 2 needs review, 3 blocked, 4 not supported by lokadb yet, 5 invalid spec, 1 the check failed
[-ci [-baseline accepted.json]] [-write-baseline F]: exit 0 nothing new, 6 new items (CI of the application)
lokadb relay -config relay.json
lokadb runner -config runner.json (LokaDB Cloud's runner: takes jobs from the service, runs them here)
lokadb issuer -config issuer.json (signs agent certificates for the relays: the CA key lives only here)
lokadb agent -relay HOST:PORT -ca F -state DIR -token-file F -db HOST:PORT [-cloud-listen ADDR [-cloud-allow A[,A]]] [-status-listen ADDR] [-status-url URL -status-token-file F] [-enroll-only]
lokadb token -cp DSN -org N [-ttl 15m]
lokadb revoke -cp DSN -org N [-serial S]
lokadb agents -cp DSN
lokadb org-endpoint -cp DSN -org N (-listen ADDR [-tls require] [-change-port] | -remove) (relays serve the organization without a restart)
lokadb certs -dir DIR -relay-host relay
lokadb org-profile -db DSN -org N [-customer-app DSN -direct-role ROLE] [-control-plane DSN -key FILE [-drop-fdw-credentials]] fdw|fdw+direct|direct (the organization's routing profile, switched under its pause)
lokadb org-credentials -db DSN -control-plane DSN -key FILE -org N -kind direct|owner -dsn DSN|- (the organization's credentials for the proxy, sealed in the control plane)
lokadb org-add -db DSN -tenant UUID [-org N] (the number of an organization numbered by uuid: every command with -org takes it, or -tenant UUID)
lokadb enable -db DSN -spec spec.json [-patch patch.json] -owner ROLE [-prepare] [-lock-timeout 5s]
(-prepare first on large tables: online; enable then switches in a short lock)
lokadb routing apply -db DSN -spec spec.json [-patch patch.json] (routing declarations after enable)
lokadb move-cleanup -db DSN (what killed moves left: capture triggers, log, slots; refused while a move runs)
lokadb move-org -db DSN -spec spec.json -owner ROLE -org N -customer DSN [-customer-app DSN] [-customer-schema S] [-publisher DSN] [-cp DSN]
[-lock-timeout 5s] [-max-pause 10s] [-retain-source] [-mode auto|logical|trigger] [-fetch-size 1000]
[-batch-rows 10000] [-max-split-pause 10m] [-copy-timeout 24h] [-catchup-timeout 2h] [-catchup-stall 10m] [-drop-returned] [-allow-customer-replication] [-dry-run [-sample 10s]]
lokadb repoint -db DSN -org N -customer-app DSN -proxy-config F [-customer-schema S] [-direct DSN] [-owner DSN] [-key F] [-lock-timeout 5s]
(the organization's database moved: same rows, new address or credentials)
lokadb move-back -db DSN -spec spec.json -org N -customer DSN [-dry-run] [-lock-timeout 5s] [-max-pause 10s] [-bridge 60s]
lokadb move-back -db DSN -spec spec.json -org N -abandon -confirm-org N (its database is lost: back EMPTY)
lokadb disable -db DSN -spec spec.json [-dry-run] [-grace 60s] [-lock-timeout 5s] [-attempts 5] (undo enable; every organization moved back first)
lokadb schema-diff -db DSN [-org N[,N]] [-customer N=DSN]... [-proxy-config F] [-json]
lokadb schema-sync -db DSN (-org N[,N] | -all) [-customer N=DSN]... [-proxy-config F] [-drop-extra] [-json]
the organizations' copies of the LokaDB tables against the cloud's; exit code 0 same, 2 differences left, 1 failed
lokadb refs-diff -db DSN [-org N[,N]] [-cloud] [-json]
lokadb refs-sync -db DSN (-org N[,N] | -all [-cloud]) [-delete-stale] [-max-sequence-jump 100000] [-json]
the refs tables against the rows the organizations have (rows written there past the cloud)
lokadb COMMAND -h (the flags of one command)
lokadb agent¶
Usage of agent:
-ca string
CA certificate that signs the relay certificate
-cloud-allow string
comma-separated IPs, CIDRs or host names allowed to use -cloud-listen (default: the -db host, loopback and this host's own addresses)
-cloud-listen string
local address forwarded to the cloud database (optional)
-db string
organization database host:port (the only place cloud streams go)
-enroll string
relay enrollment address host:port (default: relay host, port 7444)
-enroll-only
enroll if needed, then exit
-max-conns int
connections to -db open at once (default 200, negative: no limit)
-relay string
relay tunnel address host:port[,host:port...] (the only outbound connections; one session to each relay)
-server-name string
name in the relay certificates (default: the host of each -relay address)
-sessions int
sessions (TCP connections) to every relay, 1-8: the organization's connections spread over them (default 1)
-state string
directory for the agent's key and certificate (default "/var/lib/lokadb-agent")
-status-listen string
local address that serves GET /status (state, relays, certificate, time to -db; counters only)
-status-token-file string
file with the agent's secret for -status-url
-status-url string
LokaDB service URL that gets the status every 60 s (POST, with the secret of -status-token-file); LOKADB_AGENT_STATUS=off stops it
-token-file string
file with a one-time enrollment token
lokadb agents¶
Usage of agents:
-change-port
allow a new -listen for an organization that already has one (org-endpoint; update its FDW server too)
-cp string
control plane (registry) database DSN
-listen string
address the relays listen on for the organization, inside the cloud network (org-endpoint)
-org string
organization id
-remove
stop serving the organization: its port closes and its agent is disconnected (org-endpoint)
-serial string
revoke only the agent of this certificate: its whole renewal chain (revoke)
-tls string
"require": the relays let through only connections that negotiate TLS with the organization's database (org-endpoint)
-ttl duration
token lifetime (token) (default 15m0s)
lokadb certs¶
Usage of certs:
-dir string
output directory (default "certs")
-force
replace an existing CA (every agent then needs a new certificate)
-orgs string
comma-separated organization ids for static client certificates (normally none: agents enroll)
-relay-host string
relay host name (default "relay")
lokadb check¶
Usage of check:
-app-role string
comma-separated roles whose pg_stat_statements are the application (default: all but the role running the check)
-baseline string
with -ci: the accepted items (JSON, made by -write-baseline)
-ci
fail (exit 6) on what -baseline has not accepted; print only that
-count-limit int
data checks count tables of up to this many rows exactly, bigger ones from a sample (0: 1000000, -1: always exactly)
-customer string
DSN of the organization's own database: is it ready for move-org
-customer-app string
DSN of the role move-org -customer-app gets (with -customer): can it own the moved tables
-customer-schema string
the schema move-org -customer-schema gets (default: public if it can take the tables, else lokadb)
-db string
admin DSN of the cloud database
-direct-forms string
with -profile fdw+direct and -workload: save the recorded transaction forms as SQL for psql (lokadb.direct_learnt: direct from the first run; lokadb.direct_cloud_first: the cloud's way, no refusal)
-json
print the report as JSON
-org int
organization to be moved (with -customer)
-org-candidates
print the tables that look like the organizations table, best first, as JSON, and exit
-org-table string
the organizations table the tables are discovered by: every table that points at its key (without -spec; recommended)
-patch string
routing declarations (JSON, as -suggest writes them) to judge the workload with, as if applied
-profile string
estimate this routing profile on the workload: fdw, fdw+direct, direct (with -org: against the organization's current one)
-proxy-config string
the proxy's config: its fanout policy decides which queries are refused (default: reject)
-proxy-hosts string
comma-separated IPs or CIDRs of the proxy and the relay: the only addresses the application's role should reach the cloud database from (cloud_direct_access)
-rtt float
estimate the latency of a moved organization's recorded transactions at this round trip time to its database, ms (fdw and fdw+direct)
-spec string
tables spec (JSON); without it the tables are discovered by -org-table or -tenant-column
-suggest string
save the routing declarations the report suggests to this file (a patch for -patch, enable and routing apply)
-tenant string
the organization by its uuid instead of -org (block 18: its number from org-add)
-tenant-column string
organization column the tables are discovered by (without -spec): every table with a column of this name
-workload string
comma-separated workload recordings of the proxy (proxy -record)
-write-baseline string
save every current item as accepted to this file (reasons of -baseline kept)
-write-spec string
save the discovered spec to this file
lokadb disable¶
Usage of disable:
-attempts int
how many times disable tries for the tables' lock (default 5)
-db string
admin DSN of the cloud database
-dry-run
count the rows disable would copy (its pause grows with them), change nothing
-grace duration
how long the refs tables and schema lokadb stay for proxies with old metadata (2 x their reload interval) (default 1m0s)
-lock-timeout duration
max wait for a lock; the tables' lock is tried again (-attempts) (default 5s)
-spec string
tables spec (JSON) enable was given
lokadb enable¶
Usage of enable:
-allow-customer-replication
with -mode logical: accept that the organization's database, for the time of the move, can read the change stream of the WHOLE cloud database (the subscription's role has the REPLICATION attribute); only if the cloud and the organization's database have one owner (move-org)
-batch-rows int
rows per transaction when the organization is split out of DEFAULT (move-org) (default 10000)
-catchup-stall duration
the catch-up gives up once the log left to apply has not got shorter for this long: changes come faster than they reach the organization's database (move-org; 0: only -catchup-timeout) (default 10m0s)
-catchup-timeout duration
max time for the organization's database to catch up with the cloud after the copy (move-org) (default 2h0m0s)
-copy-timeout duration
max time of the initial copy into the organization's database (move-org) (default 24h0m0s)
-cp string
control plane DSN: opens the relay's window to the cloud database for the move (move-org)
-customer string
DSN of the organization's own database (move-org)
-customer-app string
DSN of the role the cloud keeps for the organization's database: owns the moved tables, used by postgres_fdw and the proxy (move-org; default: -customer)
-customer-schema string
schema of the organization's tables in its database (move-org; default: public if it can take them, else lokadb, made by move-org and owned by -customer-app)
-db string
admin DSN of the cloud database
-direct-role string
the role the proxy's direct path uses in the organization's database (move-org, fdw+direct: it gets DML on the moved tables)
-drop-returned
move-org: drop the copy an earlier move-back left of this organization in its database (DROP TABLE, no CASCADE); without it the copy is moved aside to a schema of its own, lokadb_returned_<org>_<date>, and the move says how to drop it
-dry-run
move-org: change nothing; estimate whether the trigger mode's catch-up keeps up with the organization's writes (round trips from here to both databases, the writes over -sample)
-fetch-size int
rows postgres_fdw reads per round trip from the organization's database (move-org) (default 1000)
-lock-timeout duration
max wait for the write lock at switch time (move-org; enable after -prepare, and -prepare's short catalog changes) (default 5s)
-max-pause duration
max write pause while the last changes arrive (move-org) (default 10s)
-max-split-pause duration
max pause of the organization while it is split out of DEFAULT; past it the split stops and its rows stay there (move-org) (default 10m0s)
-mode string
how to copy the organization's rows (move-org): logical (subscription in its database), trigger (change capture in the cloud: no wal_level=logical, no subscription, no role that reads the change stream), auto (= trigger; logical needs -mode logical -allow-customer-replication) (default "auto")
-org int
organization id (move-org)
-owner string
role that owns the application tables
-patch string
routing declarations to add to the spec (as the extended lokadb check -suggest writes them)
-prepare
enable: prepare online (refs tables, organization columns of child tables, FKs, key indexes; can be stopped and run again); then enable without it switches in a short lock
-profile string
the moved organization's routing profile (move-org; default: fdw+direct when the proxy has the direct path's credentials of it, see -proxy-config, else fdw with a warning)
-proxy-config string
the proxy's config (move-org): its customers_app or control plane tell whether the direct path can be taken, so fdw+direct is set
-publisher string
cloud database DSN as seen from the customer database (move-org; default: -db)
-retain-source
keep the detached cloud partitions as <table>__o<N>_source (move-org)
-sample duration
move-org -dry-run: how long to count the organization's writes (default 10s)
-spec string
tables spec (JSON)
-tenant string
the organization by its uuid instead of -org (move-org; block 18: its number from org-add)
lokadb issuer¶
Usage of issuer:
-config string
config file (default "issuer.json")
lokadb move-back¶
Usage of move-back:
-abandon
the organization's database is lost: bring the organization back EMPTY (needs -confirm-org)
-bridge duration
how long proxies with old metadata may still address the foreign partition (2 x their reload interval) (default 1m0s)
-confirm-org int
with -abandon: the organization id again
-customer string
DSN of the organization's database: its admin, or the cloud's role there (then the copy may run under a pause of the organization: see -dry-run)
-db string
admin DSN of the cloud database
-dry-run
say which way back (capture or pause) and how many rows, change nothing
-lock-timeout duration
max wait for the write lock at switch time (default 5s)
-max-pause duration
max write pause while the last changes are applied (default 10s)
-org int
organization id
-spec string
tables spec (JSON)
-tenant string
the organization by its uuid instead of -org (block 18: its number from org-add)
lokadb move-cleanup¶
Usage of move-cleanup:
-db string
admin DSN of the cloud database
lokadb move-org¶
Usage of move-org:
-allow-customer-replication
with -mode logical: accept that the organization's database, for the time of the move, can read the change stream of the WHOLE cloud database (the subscription's role has the REPLICATION attribute); only if the cloud and the organization's database have one owner (move-org)
-batch-rows int
rows per transaction when the organization is split out of DEFAULT (move-org) (default 10000)
-catchup-stall duration
the catch-up gives up once the log left to apply has not got shorter for this long: changes come faster than they reach the organization's database (move-org; 0: only -catchup-timeout) (default 10m0s)
-catchup-timeout duration
max time for the organization's database to catch up with the cloud after the copy (move-org) (default 2h0m0s)
-copy-timeout duration
max time of the initial copy into the organization's database (move-org) (default 24h0m0s)
-cp string
control plane DSN: opens the relay's window to the cloud database for the move (move-org)
-customer string
DSN of the organization's own database (move-org)
-customer-app string
DSN of the role the cloud keeps for the organization's database: owns the moved tables, used by postgres_fdw and the proxy (move-org; default: -customer)
-customer-schema string
schema of the organization's tables in its database (move-org; default: public if it can take them, else lokadb, made by move-org and owned by -customer-app)
-db string
admin DSN of the cloud database
-direct-role string
the role the proxy's direct path uses in the organization's database (move-org, fdw+direct: it gets DML on the moved tables)
-drop-returned
move-org: drop the copy an earlier move-back left of this organization in its database (DROP TABLE, no CASCADE); without it the copy is moved aside to a schema of its own, lokadb_returned_<org>_<date>, and the move says how to drop it
-dry-run
move-org: change nothing; estimate whether the trigger mode's catch-up keeps up with the organization's writes (round trips from here to both databases, the writes over -sample)
-fetch-size int
rows postgres_fdw reads per round trip from the organization's database (move-org) (default 1000)
-lock-timeout duration
max wait for the write lock at switch time (move-org; enable after -prepare, and -prepare's short catalog changes) (default 5s)
-max-pause duration
max write pause while the last changes arrive (move-org) (default 10s)
-max-split-pause duration
max pause of the organization while it is split out of DEFAULT; past it the split stops and its rows stay there (move-org) (default 10m0s)
-mode string
how to copy the organization's rows (move-org): logical (subscription in its database), trigger (change capture in the cloud: no wal_level=logical, no subscription, no role that reads the change stream), auto (= trigger; logical needs -mode logical -allow-customer-replication) (default "auto")
-org int
organization id (move-org)
-owner string
role that owns the application tables
-patch string
routing declarations to add to the spec (as the extended lokadb check -suggest writes them)
-prepare
enable: prepare online (refs tables, organization columns of child tables, FKs, key indexes; can be stopped and run again); then enable without it switches in a short lock
-profile string
the moved organization's routing profile (move-org; default: fdw+direct when the proxy has the direct path's credentials of it, see -proxy-config, else fdw with a warning)
-proxy-config string
the proxy's config (move-org): its customers_app or control plane tell whether the direct path can be taken, so fdw+direct is set
-publisher string
cloud database DSN as seen from the customer database (move-org; default: -db)
-retain-source
keep the detached cloud partitions as <table>__o<N>_source (move-org)
-sample duration
move-org -dry-run: how long to count the organization's writes (default 10s)
-spec string
tables spec (JSON)
-tenant string
the organization by its uuid instead of -org (move-org; block 18: its number from org-add)
lokadb org-add¶
Usage of org-add:
-db string
admin DSN of the cloud database
-org int
the number to give it (default: the next free one)
-tenant string
the organization's value in the organization column (a uuid)
lokadb org-credentials¶
Usage of org-credentials:
-claim-legacy
the rows stored before 26.10 (no cloud named in them) of -db's database are this cloud's: seal them for it
-control-plane string
DSN of the control plane database (the proxy's control_plane)
-db string
admin DSN of the cloud database (its name is the proxy's database)
-dsn string
the credentials: a DSN of the organization's database, or - to read it from stdin
-key string
the proxy's credentials_key file
-key-old string
-reseal: the old key file (credentials_key_old)
-kind string
direct (the direct path's role, customers_app) or owner (the moved tables' owner, customers)
-list
list what is stored (no secrets)
-org int
organization id
-reseal
key rotation: seal with -key every row sealed with -key-old
-tenant string
the organization by its uuid instead of -org
lokadb org-endpoint¶
Usage of org-endpoint:
-change-port
allow a new -listen for an organization that already has one (org-endpoint; update its FDW server too)
-cp string
control plane (registry) database DSN
-listen string
address the relays listen on for the organization, inside the cloud network (org-endpoint)
-org string
organization id
-remove
stop serving the organization: its port closes and its agent is disconnected (org-endpoint)
-serial string
revoke only the agent of this certificate: its whole renewal chain (revoke)
-tls string
"require": the relays let through only connections that negotiate TLS with the organization's database (org-endpoint)
-ttl duration
token lifetime (token) (default 15m0s)
lokadb org-profile¶
Usage of org-profile:
-control-plane string
direct, and leaving it: DSN of the control plane holding the organization's credentials (lokadb org-credentials)
-customer-app string
fdw+direct: DSN of the moved tables' owner in the organization's database (move-org's -customer-app)
-db string
admin DSN of the cloud database
-direct-role string
fdw+direct: the role the proxy's direct path uses there (customers_app); it gets DML on the organization's tables
-drop-fdw-credentials
direct: drop the cloud's user mappings of the organization's server (the cloud no longer reaches its database)
-key string
direct, and leaving it: the proxy's credentials_key file
-key-old string
during a key rotation: the proxy's credentials_key_old file (rows not resealed yet)
-lock-timeout duration
max wait for the organization's pause per attempt (default 5s)
-org int
organization id
-tenant string
the organization by its uuid instead of -org (block 18: its number from org-add)
lokadb proxy¶
Usage of proxy:
-config string
config file (default "lokadb.json")
-record string
record the workload into this file for lokadb check (overrides "record" in the config)
lokadb refs-diff¶
Usage of refs-diff:
-all
refs-sync: every moved organization (without it -org is required: the sync changes the cloud's refs tables)
-cloud
also every organization in the cloud (moved back, or never moved): its refs against its rows there (refs-sync: with -all)
-db string
admin DSN of the cloud database
-delete-stale
refs-sync: also delete the ids of rows the organization no longer has
-json
print the report as JSON
-max-sequence-jump int
refs-sync: the most it moves a cloud sequence on by itself (the organization's ids are its own data) (default 100000)
-org string
comma-separated organizations (refs-diff: default every moved one)
lokadb refs-sync¶
Usage of refs-sync:
-all
refs-sync: every moved organization (without it -org is required: the sync changes the cloud's refs tables)
-cloud
also every organization in the cloud (moved back, or never moved): its refs against its rows there (refs-sync: with -all)
-db string
admin DSN of the cloud database
-delete-stale
refs-sync: also delete the ids of rows the organization no longer has
-json
print the report as JSON
-max-sequence-jump int
refs-sync: the most it moves a cloud sequence on by itself (the organization's ids are its own data) (default 100000)
-org string
comma-separated organizations (refs-diff: default every moved one)
lokadb relay¶
Usage of relay:
-config string
config file (default "relay.json")
lokadb repoint¶
Usage of repoint:
-customer-app string
the organization's database at its new address, as the cloud's role there (postgres_fdw uses it)
-customer-schema string
schema of the organization's tables there (default: unchanged)
-db string
admin DSN of the cloud database
-direct string
the direct path role's DSN to store in the control plane (default: the stored one at the new host, port and database)
-key string
the credentials key file (default: the proxy config's credentials_key)
-key-old string
the previous key file (default: the proxy config's credentials_key_old)
-lock-timeout duration
max wait for the organization's pause (default 5s)
-org int
organization id
-owner string
the owner's DSN to store in the control plane (default: the stored one at the new host, port and database)
-proxy-config string
the proxy's config (required): its customers_app, customers and control plane are the organization's other addresses, which must reach the new database too
-tenant string
the organization by its uuid instead of -org (block 18: its number from org-add)
lokadb revoke¶
Usage of revoke:
-change-port
allow a new -listen for an organization that already has one (org-endpoint; update its FDW server too)
-cp string
control plane (registry) database DSN
-listen string
address the relays listen on for the organization, inside the cloud network (org-endpoint)
-org string
organization id
-remove
stop serving the organization: its port closes and its agent is disconnected (org-endpoint)
-serial string
revoke only the agent of this certificate: its whole renewal chain (revoke)
-tls string
"require": the relays let through only connections that negotiate TLS with the organization's database (org-endpoint)
-ttl duration
token lifetime (token) (default 15m0s)
lokadb routing¶
usage:
lokadb proxy -config lokadb.json [-record workload.json]
lokadb check -db DSN (-spec spec.json | -org-table TABLE [-write-spec F] | -tenant-column COL [-write-spec F]) [-workload F[,F]] [-app-role R[,R]] [-proxy-config F]
[-customer DSN [-customer-app DSN] [-customer-schema S] [-org N]] [-direct-forms forms.sql]
[-profile fdw|fdw+direct|direct] [-json]
exit code: 0 ready, 2 needs review, 3 blocked, 4 not supported by lokadb yet, 5 invalid spec, 1 the check failed
[-ci [-baseline accepted.json]] [-write-baseline F]: exit 0 nothing new, 6 new items (CI of the application)
lokadb relay -config relay.json
lokadb runner -config runner.json (LokaDB Cloud's runner: takes jobs from the service, runs them here)
lokadb issuer -config issuer.json (signs agent certificates for the relays: the CA key lives only here)
lokadb agent -relay HOST:PORT -ca F -state DIR -token-file F -db HOST:PORT [-cloud-listen ADDR [-cloud-allow A[,A]]] [-status-listen ADDR] [-status-url URL -status-token-file F] [-enroll-only]
lokadb token -cp DSN -org N [-ttl 15m]
lokadb revoke -cp DSN -org N [-serial S]
lokadb agents -cp DSN
lokadb org-endpoint -cp DSN -org N (-listen ADDR [-tls require] [-change-port] | -remove) (relays serve the organization without a restart)
lokadb certs -dir DIR -relay-host relay
lokadb org-profile -db DSN -org N [-customer-app DSN -direct-role ROLE] [-control-plane DSN -key FILE [-drop-fdw-credentials]] fdw|fdw+direct|direct (the organization's routing profile, switched under its pause)
lokadb org-credentials -db DSN -control-plane DSN -key FILE -org N -kind direct|owner -dsn DSN|- (the organization's credentials for the proxy, sealed in the control plane)
lokadb org-add -db DSN -tenant UUID [-org N] (the number of an organization numbered by uuid: every command with -org takes it, or -tenant UUID)
lokadb enable -db DSN -spec spec.json [-patch patch.json] -owner ROLE [-prepare] [-lock-timeout 5s]
(-prepare first on large tables: online; enable then switches in a short lock)
lokadb routing apply -db DSN -spec spec.json [-patch patch.json] (routing declarations after enable)
lokadb move-cleanup -db DSN (what killed moves left: capture triggers, log, slots; refused while a move runs)
lokadb move-org -db DSN -spec spec.json -owner ROLE -org N -customer DSN [-customer-app DSN] [-customer-schema S] [-publisher DSN] [-cp DSN]
[-lock-timeout 5s] [-max-pause 10s] [-retain-source] [-mode auto|logical|trigger] [-fetch-size 1000]
[-batch-rows 10000] [-max-split-pause 10m] [-copy-timeout 24h] [-catchup-timeout 2h] [-catchup-stall 10m] [-drop-returned] [-allow-customer-replication] [-dry-run [-sample 10s]]
lokadb repoint -db DSN -org N -customer-app DSN -proxy-config F [-customer-schema S] [-direct DSN] [-owner DSN] [-key F] [-lock-timeout 5s]
(the organization's database moved: same rows, new address or credentials)
lokadb move-back -db DSN -spec spec.json -org N -customer DSN [-dry-run] [-lock-timeout 5s] [-max-pause 10s] [-bridge 60s]
lokadb move-back -db DSN -spec spec.json -org N -abandon -confirm-org N (its database is lost: back EMPTY)
lokadb disable -db DSN -spec spec.json [-dry-run] [-grace 60s] [-lock-timeout 5s] [-attempts 5] (undo enable; every organization moved back first)
lokadb schema-diff -db DSN [-org N[,N]] [-customer N=DSN]... [-proxy-config F] [-json]
lokadb schema-sync -db DSN (-org N[,N] | -all) [-customer N=DSN]... [-proxy-config F] [-drop-extra] [-json]
the organizations' copies of the LokaDB tables against the cloud's; exit code 0 same, 2 differences left, 1 failed
lokadb refs-diff -db DSN [-org N[,N]] [-cloud] [-json]
lokadb refs-sync -db DSN (-org N[,N] | -all [-cloud]) [-delete-stale] [-max-sequence-jump 100000] [-json]
the refs tables against the rows the organizations have (rows written there past the cloud)
lokadb COMMAND -h (the flags of one command)
lokadb runner¶
Usage of runner:
-config string
runner config (default "/etc/lokadb/runner.json")
lokadb schema-diff¶
Usage of schema-diff:
-all
schema-sync: every moved organization (without it -org is required: the sync changes the organizations' databases)
-customer value
N=DSN: organization N's database at this DSN instead of its FDW server's address and user mapping (repeatable)
-db string
admin DSN of the cloud database
-drop-extra
schema-sync: also drop the columns, indexes and constraints the organization has and the cloud has not
-json
print the report as JSON
-org string
comma-separated organizations (schema-diff: default every moved one)
-proxy-config string
the proxy's config: its customers of this database, as -customer
lokadb schema-sync¶
Usage of schema-sync:
-all
schema-sync: every moved organization (without it -org is required: the sync changes the organizations' databases)
-customer value
N=DSN: organization N's database at this DSN instead of its FDW server's address and user mapping (repeatable)
-db string
admin DSN of the cloud database
-drop-extra
schema-sync: also drop the columns, indexes and constraints the organization has and the cloud has not
-json
print the report as JSON
-org string
comma-separated organizations (schema-diff: default every moved one)
-proxy-config string
the proxy's config: its customers of this database, as -customer
lokadb token¶
Usage of token:
-change-port
allow a new -listen for an organization that already has one (org-endpoint; update its FDW server too)
-cp string
control plane (registry) database DSN
-listen string
address the relays listen on for the organization, inside the cloud network (org-endpoint)
-org string
organization id
-remove
stop serving the organization: its port closes and its agent is disconnected (org-endpoint)
-serial string
revoke only the agent of this certificate: its whole renewal chain (revoke)
-tls string
"require": the relays let through only connections that negotiate TLS with the organization's database (org-endpoint)
-ttl duration
token lifetime (token) (default 15m0s)