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. Optionally you may obtain it through the Aerospike-Admin repository.

Install

To install Aerospike Admin either install the Aerospike-Tools package which is bundled in our Server Packages or clone 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 parameter is used to set aerospike log. Also we can add server logs at runtime.
  5. From the Admin> 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 run 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 or filter the output of a command.

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 cluster.

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

    • Aerospike Server version 5.0 and later: show statistics xdr and info xdr support the for modifier with a datacenter specification. The command does string matching against the names of all datacenters.
      • Example: Show stats for datacenter names that have the substring NEW. Assume there are the following datacenters: NEWYORK, RENEW, and PARIS. The following command would return statistics for NEWYORK and RENEW.
        show statistics xdr for NEW
    • 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 has substring test
        show distribution for test
    • show latencies command supports for modifier if server version is 3.9 and above
      • Example: Show latency for namespace has substring 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 has substring ABCD or ends with XYZ for namespace 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$"
  • like: Like shows the output containing any word listed after 'like'.

    • Example: Show namespace stats which has 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.
    • A prefix match is also supported by using the * character.
    • 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 default mode for asadm. This is used to get summary info 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 on collectinfo instead of running cluster. We can enable this mode by setting -c parameter. For a tutorial on commands to use in this mode see the Collectinfo-analyzer Mode Commands.
    • Compatibility: collectinfo file/folder created by asadm
  • Log-analyzer: In this mode, asadm works 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 should be as below:

  • Command should end with ;.
  • Command can be splitted on multiple lines.
  • File should have commands for single mode.
  • For single line comment use //
  • For multiple line comment use /* … */. /* should be start of line and */ should be end of line.

Example:

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