Aerospike Admin (asadm)
Aerospike Admin (asadm) is an interactive Python utility that gets summary info for the current health of a cluster, administers the access control list (ACL), manages user defined functions (UDFs) and secondary indexes (sindexes), changes dynamic configurations, and tunes commands across the cluster.
Asadm is a component of the Aerospike-Tools package, which is bundled within our various Server Packages. You can also get it from the Aerospike-Admin repository.
Install
Install asadm as part of 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.
See Aerospike Tools Configuration for more details.
Getting Help
- Run
asadm --help
to learn about arguments that may be needed for your environment. - 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.
- From 0.1.5 onwards
- 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.
- From the prompt run
help
to see a complete list of supported commands. - Non-interactive execution (Introduced: 0.1.1):
- To execute inline command/s run
asadm -e [; separated commands]
. Use-c
for Collectinfo-analyzer commands. - To execute command/s from file run
asadm -e [COMMAND_FILE_PATH]
. Use-c
for Collectinfo-analyzer commands. - 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]
- To execute inline command/s run
The log analysis feature of asadm
is deprecated. Use show latencies
in asadm
to see live latencies. You can also use the Aerospike Grafana dashboards if you have Prometheus installed, or the AGI stack in AeroLab to further explore log files.
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 supportsdiff
- Example: Show differences in service configurations
show config service diff
- Only
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
, andshow distribution
commands supportfor
modifier.- Example: Show distribution for namespace that has the substring
test
show distribution for test
- Example: Show distribution for namespace that has the substring
show latencies
command supports thefor
modifier.- Example: Show latency for namespace that has substrings
test
orbar
show latencies for test bar
- Example: Show latency for namespace that has substrings
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 withXYZ
for a namespace that starts withtest
show statistics set for ^test.* ABCD .*XYZ$
- Example: Show statistics for set that has substring
show statistics sindex
can accept two patterns after ‘for’, first for namespace and second for sindex.- Example: Show statistics for sindex named
ABCD
for namespacetest
show statistics sindex for test ^ABCD$
- Example: Show statistics for sindex named
show statistics xdr dc
andshow config xdr dc
can accept multiplefor
modifiers to filter by datacenter.- Example: Show statistics for XDR datacenters
DC1
andDC2
show statistics xdr dc for DC1 DC2
- Example: Show statistics for XDR datacenters
show statistics xdr namespace
andshow config xdr namespace
can accept two patterns after ‘for’, first for namespace and second for datacenter.- Example: Show statistics for XDR namespace
test
on DC1show statistics xdr namespace for test DC1
- Example: Show statistics for XDR namespace
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 settestset
.show stop-writes for test testset
- Example: Show configured stop-writes for namespace
like: Like shows the output containing any word listed after 'like'. This is useful for
show statistics
andshow config
commands.- Example: Show namespace statistics with substring
object
show statistics namespace like object
- Example: Show namespace statistics with substring
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
Asadm supports three modes:
- Live-cluster: This default mode for asadm summarizes information for the current health of a running cluster:
- executing dynamic configurations
- administering the access control list (ACL)
- adding and removing user-defined functions (UDFs)
- creating and deleting secondary indexes (sindexes)
- setting the roster
- viewing and canceling jobs For more information 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. To enable this mode, set the-c
parameter. For more information on commands to use in this mode, see Collectinfo-analyzer Mode Commands. - Log-analyzer: In this mode, asadm works offline on Aerospike database log files instead of a running cluster. Enable this mode by setting the
-l
parameter. For more information on commands to use in this mode, see the Log-analyzer Mode Commands.
On Kubernetes clusters, the akoctl
tool collectinfo
command gathers Kubernetes-specific logs and configuration. It complements the information collected by asadm
.
See the akoctl
section on the Kubernetes Operator command line tool page for details about the collectinfo
command.
Command File Format
Execute multiple commands from a file with the -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
/* … */
.
For example, to see the number of nodes in a cluster, run asadm -e info
from the command line.
Example command file:
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;