HarperDB CLI
Last updated
Last updated
The HarperDB command line interface (CLI) is used to administer .
To install HarperDB with CLI prompts, run the following command:
Alternatively, HarperDB installations can be automated with environment variables or command line arguments; . Note, when used in conjunction, command line arguments will override environment variables.
Environment Variables
Command Line Arguments
To start HarperDB after it is installed, run the following command:
To stop HarperDB once it is running, run the following command:
To restart HarperDB once it is running, run the following command:
To check the version of HarperDB that is installed run the following command:
To renew the HarperDB generated self-signed certificates, run:
To copy a HarperDB database with compaction (to eliminate free-space and fragmentation), use
For example, to copy the default database:
To display all available HarperDB CLI commands along with a brief description run:
To display the status of the HarperDB process, the clustering hub and leaf processes, the clustering network and replication statuses, run:
HarperDB uses a transactional commit process that ensures that data on disk is always transactionally consistent with storage. This means that HarperDB maintains database integrity in the event of a crash. It also means that you can use any standard volume snapshot tool to make a backup of a HarperDB database. Database files are stored in the hdb/database directory. As long as the snapshot is an atomic snapshot of these database files, the data can be copied/moved back into the database directory to restore a previous backup (with HarperDB shut down) , and database integrity will be preserved. Note that simply copying an in-use database file (using cp
, for example) is not a snapshot, and this would progressively read data from the database at different points in time, which yields unreliable copy that likely will not be usable. Standard copying is only reliable for a database file that is not in use.
Some of the API operations are available through the CLI, this includes most operations that do not require nested parameters. To call the operation use the following convention: <api-operation> <parameter>=<value>
. By default, the result will be formatted as YAML, if you would like the result in JSON pass: json=true
.
Some examples are:
harperdb set_configuration logging_level=error
harperdb deploy_component project=my-cool-app package=https://github.com/HarperDB/application-template
harperdb get_components
harperdb search_by_id database=dev table=dog ids='["1"]' get_attributes='["*"]' json=true
harperdb search_by_value table=dog search_attribute=name search_value=harper get_attributes='["id", "name"]'
harperdb sql sql='select * from dev.dog where id="1"'