CrateDB Cluster Information

A bundle of information inquiry utilities, for diagnostics and more.

Install

pip install --upgrade 'cratedb-toolkit'

Tip

Alternatively, use the Docker image per ghcr.io/crate/cratedb-toolkit. For more information about installing CrateDB Toolkit, see Installation.

Synopsis

Define CrateDB database cluster address per command-line option. Choose one of both alternatives.

ctk cfr --cratedb-http-url "https://username:password@localhost:4200/?schema=ext" jobstats collect
ctk cfr --cratedb-sqlalchemy-url "crate://username:password@localhost:4200/?schema=ext&ssl=true" jobstats collect

Define CrateDB database cluster address per aa. Choose one of both alternatives.

export CRATEDB_HTTP_URL=https://username:password@localhost:4200/?schema=ext
export CRATEDB_SQLALCHEMY_URL=crate://username:password@localhost:4200/?schema=ext&ssl=true

Note

For some commands, both options might not be available yet, just one of them.

One shot commands

Display system and database cluster information.

ctk info cluster

Display database cluster job information.

ctk info jobs

Display database cluster log messages.

ctk info logs

Display the most recent entries of the sys.jobs_log table, optionally polling it for updates by adding --follow. For more information, see ctk tail.

ctk tail -n 3 sys.jobs_log

HTTP API

Install.

pip install --upgrade 'cratedb-toolkit[service]'

Expose collected status information.

ctk info serve

Consume cluster information via HTTP.

http http://127.0.0.1:4242/info/all

Make the service listen on a specific address.

ctk info serve --listen 0.0.0.0:8042

Note

The --reload option is suitable for development scenarios where you intend to have the changes to the code become available while editing, in near real-time.

ctk info --debug serve --reload