Skip to main content
Loading

Aerospike Admin (asadm)

Aerospike Admin is an interactive Python utility used for getting summary info for the current health of a cluster, administering the access control list (ACL), managing user defined functions (UDFs), managing secondary indexes (sindex), changing dynamic configurations, and tuning commands across the cluster.

Aerospike Admin is provided by the Aerospike-Tools package, which is bundled within our various Server Packages. You can also get it from the Aerospike-Admin repository.

Install

To install Aerospike Admin, either install the Aerospike-Tools package, which is bundled in our Server Packages or clone, build, and install from the GitHub Repository.

Configurations

Asadm can be configured by using tools configuration files. Run asadm --help for more information about asadm specific configuration parameters. Please see Aerospike Tools Configuration for more details.

Getting Help

  1. Run asadm --help to learn about arguments that may be needed for your environment.
  2. To start the interactive shell run asadm -h [HOST_IP].
    • From 0.1.5 onwards asadm supports IPv6 address for server 3.10 and above.
  3. To start the interactive shell in Collectinfo-analyzer mode run asadm -c -f <collectinfopath> (Introduced: 0.1.8).
    • -f accepts path of single collectinfo file or collectinfo directory path.
  4. To start the interactive shell in Log-analyzer mode run asadm -l.
    • -f is used to set Aerospike logs, with optional server logs at runtime.
  5. From the prompt run help to see a complete list of supported commands.
  6. Non-interactive execution (Introduced: 0.1.1):
    • To execute inline command/s run asadm -e [; separated commands]. Please use -c for Collectinfo-analyzer and -l for Log-analyzer commands.
    • To execute command/s from file run asadm -e [COMMAND_FILE_PATH]. Please use -c for Collectinfo-analyzer and -l for Log-analyzer commands.
    • Please see Command File Format for details.
    • To get output in file run asadm -e [COMMANDS] -o [OUTPUT_FILE_PATH]
    • To use privileged commands run asadm --enable -e [commands]

Command Organization

Commands are organized into a hierarchy where similar commands share a common parent. Each command may support one or more modifiers which can limit the command to a specific set of nodes, namespace, configuration, or metric parameters.

All commands will sort output based on the node name that asadm chooses for the node. The node name is Fully Qualified Domain Name (FQDN) or IP if the FQDN cannot be resolved.

Command Shortcuts

All commands support shortest-prefix execution and tab completion, except enable; at the Admin> prompt, typing i<tab> will complete to info and sh<tab> will suggest shell and show. You can execute commands using their shortest unambiguous prefix for example to run info you could type i and for info network you could type i net, while i n would be ambiguous with info namespace and info network.

Admin> i net
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Network Information (2020-12-18 18:15:50 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cluster| Node| Node ID| IP| Build|Migrations|~~~~~~~~~~~~~~~~~~Cluster~~~~~~~~~~~~~~~~~~|Client| Uptime
| | | | | |Size| Key|Integrity| Principal| Conns|
bob-cluster-a| 10-0-0-1.heln.qwest.net:3000| BB9010016AE4202| 10.0.0.1:3000|E-4.9.0.18| 0.000 | 2|C3F2BCB417C3|True |BB9020016AE4202| 4|00:04:59
bob-cluster-a| 10-0-0-2.heln.qwest.net:3000|*BB9020016AE4202| 10.0.0.2:3000|E-4.9.0.18| 0.000 | 2|C3F2BCB417C3|True |BB9020016AE4202| 3|00:04:59
Number of rows: 2

Admin> i n
ERR: Ambiguous command: 'n' may be namespace or network.

Modifiers

There are currently four modifiers that commands may support.

  • diff: Diff shows the difference between the configurations in all nodes of the cluster.

    • Only show config command supports diff
    • Example: Show differences in service configurations
      show config service diff
  • for: for shows the output for specific namespaces, sets, or datacenters:

    • show statistics namespace, show statistics sets, show statistics bins, show statistics sindex, show config namespace, and show distribution commands support for modifier.
      • Example: Show distribution for namespace that has the substring test
        show distribution for test
    • show latencies command supports the for modifier for server 3.9 and above.
      • Example: Show latency for namespace that has substrings test or bar
        show latencies for test bar
    • show statistics set can accept two patterns after ‘for’, first for namespace and second for set.
      • Example: Show statistics for set that has substring ABCD or ends with XYZ for a namespace that starts with test
        show statistics set for ^test.* ABCD .*XYZ$
    • show statistics sindex can accept two patterns after ‘for’, first for namespace and second for sindex.
      • Example: Show statistics for sindex named ABCD for namespace test
        show statistics sindex for test ^ABCD$
    • show statistics xdr dc and show config xdr dc can accept multiple for modifiers to filter by datacenter.
      • Example: Show statistics for XDR datacenters DC1 and DC2
        show statistics xdr dc for DC1 DC2
    • show statistics xdr namespace and show config xdr namespace can accept two patterns after ‘for’, first for namespace and second for datacenter.
      • Example: Show statistics for XDR namespace test on DC1
        show statistics xdr namespace for test DC1
    • show stop-writes can accept two patterns after ‘for’, first for namespace and second for set.
      • Example: Show configured stop-writes for namespace test and set testset.
        show stop-writes for test testset
  • like: Like shows the output containing any word listed after 'like'. This is useful for show statistics and show config commands.

    • Example: Show namespace statistics with substring object
      show statistics namespace like object
  • with: With specifies a list of nodes to be used with the given command. It works only in Live Cluster mode.

    • You can use the node's IP, FQDN, or Node ID.
    • If multiple nodes share the same IP then IP:PORT is used instead of IP.
    • Use the * wildcard to search for prefix matches.
    • Example: To set aggr logging context to info for nodes prefixed with 10.0.
      Admin+> manage config logging file /var/log/aerospike/aerospike.log param aggr to info with 10.0.*
      ~Set Logging Param aggr to info~
      Node|Response
      10.0.0.1:3000|ok
      10.0.0.2:3000|ok
      10.0.0.3:3000|ok
      Number of rows: 3

Modes

There are currently three modes asadm supports.

  • Live-cluster: This is the default mode for asadm, used to get summary information for the current health of a running cluster, executing dynamic configurations, administering the access control list (acl), adding and removing user-defined functions (udf), creating and deleting secondary indexes (sindex), setting the roster, and viewing and canceling jobs. For a tutorial on commands to use in this mode see the Live Cluster Mode Commands.
  • Collectinfo-analyzer: In this mode, asadm works offline by replaying a snapshot or snapshots stored in a collectinfo archive instead of a running cluster. The collectinfo command creates the collectinfo archive in Live-cluster mode. You can enable this mode by setting the -c parameter. For a tutorial on commands to use in this mode see Collectinfo-analyzer Mode Commands.
  • Log-analyzer: In this mode, asadm works offline on aerospike server log files instead of running cluster. We can enable this mode by setting -l parameter. For a tutorial on commands to use in this mode see the Log-analyzer Mode Commands.

Command File Format

We can execute multiple commands from file by using -e option. This command file has the following syntax rules:

  • Commands should end with ;.
  • Commands can be separated on multiple lines.
  • File should have commands for single mode.
  • For single-line comments use //
  • For multiple-line comments use /* … */. /* should be start of line and */ should be end of line.

Example:

show config;
info namespace;
// This is a single-line comment
show
statistics;
/* This is a multiple-line comment - line 1
This is multiple-line comment - line 2 */
show statistics like obj;