Skip to content

Installing eractl

Estimated time to read: 3 minutes

Experimental-feature notice

This page discusses experimental features. Experimental features are still in progress, and you may encounter bugs or unexpected behavior when using them.

If you experience an issue or want to know more about this feature's status, reach out to us at Era Software.

eractl is a CLI tool for working with the EraSearch API. The tasks you can accomplish with eractl today include:

  • Managing EraSearch RBAC entities, including:
    • Creating admin, read-only, write-only, and read-write roles and API keys
    • Creating role mappings
    • Listing roles
    • Listing role mappings
    • Listing API keys
  • Listing indexes
  • Performing a system healthcheck

Installation

The eractl CLI is available in both a binary as well as container formats. Please reach out to [email protected] for more information.

Linux

Linux binaries are available for 64-bit systems and are provided by Era Software support. Please reach out to [email protected] if you would like access to the eractl binaries.

After downloading the binary, install it with the command:

sudo install -o root -g root -m 0755 eractl /usr/local/bin/eractl

Note

If you don't have root access on your machine, you can still install eractl to ~/.local/bin directory (or run it from wherever you downloaded it to):

chmod +x eractl
mkdir -p ~/.local/bin
mv ./eractl ~/.local/bin/eractl
# and then append (or prepend) ~/.local/bin to $PATH
export PATH="${PATH}:~/.local/bin"

To verify eractl is installed correctly, run the command:

eractl --help

Which should print the CLI usage information:

usage: eractl [-h] {rbac,list-indices,healthcheck} ...

A CLI utility for EraSearch (era.co)

If that command worked, then you're all set!

Docker

Warning

You will need access to the private Era Software container registry in order to retrieve the eractl container images. If you don't have access, please reach out to [email protected].

The eractl CLI is available from the Era Software container registry and can be retrieved with the command:

docker pull us.gcr.io/eradb-registry/eractl:latest

Tip

eractl frequently writes files locally for safety/backup purposes. When running from a container, be sure to expose a volume to the /app container directory. For example:

docker run --rm -it -v $(pwd):/app us.gcr.io/eradb-registry/eractl:latest

The $(pwd):/app argument will ensure that any files written locally (for example, when generating API credentials) are not lost if the container is removed.

When running from container, pass commands as arguments to docker run. For example, to issue the eractl list-indices command, use:

docker run --rm -v $(pwd):/app us.gcr.io/eradb-registry/eractl:latest list-indices

To pass environment variables to eractl, use the -e Docker CLI argument:

docker run --rm \
    -v $(pwd):/app \
    -e ERACTL_URL=http://erasearch.example.com \
    -e ERACTL_API_KEY=XXXXX \
    us.gcr.io/eradb-registry/eractl:latest \
    list-indices

Commands

  • eractl list-indices - List available indexes
  • eractl healthcheck - Perform a quick healthcheck
  • eractl rbac - Commands for managing RBAC entities
    • eractl rbac create-admin - Create an administative role and generate an API key for it
    • eractl rbac create-read - Create a read-only role and generate an API key for it
    • eractl rbac create-write - Create a read-only role and generate an API key for it
    • eractl rbac create-read-write - Create a read-only role and generate an API key for it
    • eractl rbac list-keys - List created API keys
    • eractl rbac list-roles - List created roles
    • eractl rbac list-role-mappings - List created role mappings
  • eractl --help - Print help message and exit

Getting Help

If you run into any problems or have any questions, please don't hesitate to reach out to [email protected].


Last update: October 6, 2022