Connect to Knox via CLI

Overview

You can connect to Knox via a command line interface (CLI) to manage various sides of the Knox deployment. Its focus is to configure the security artifacts for the gateway instance and topologies (e.g. setting the master secret).

To use the Knox CLI, invoke the knoxcli.sh script located in the /usr/lib/knox/bin/ directory on a Knox host:

$ sudo bash knoxcli.sh [options]

For example, to check the Knox version, execute the command below:

$ sudo bash knoxcli.sh version

The expected output is:

Apache Knox: 2.0.0 (eec965455cfdad95a898a4f4100836e3527f26e4)

You can find the full list of available commands in the Knox documentation.

Work with topologies

To get a list of topologies, use the command below:

$ sudo bash knoxcli.sh list-topologies

The output should be similar to:

List of files available in the topologies directory
/usr/lib/knox/conf/topologies
admin
homepage
knoxsso
manager
metadata
test-topology

The result of this command can help you provide the correct cluster argument for other commands.

For example, to redeploy the admin topology, you can run:

$ sudo bash knoxcli.sh redeploy admin
Found a mistake? Seleсt text and press Ctrl+Enter to report it