FAQ - How do I run asadm that require enable permissions from the command line?

The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.

FAQ: How do I run asadm that require enable permissions from the command line?

Detail

On newer versions of asadm, certain commands require you to escalate your privileges up to enable level before they can be run. If doing this from within asadm, you simply type enable and you can then run the required command, but if you run it from the command line you will not get the opportunity to escalate privileges to enable mode, resulting in the following error:

$ asadm -e "asinfo -v 'set-config:context=namespace;id=test;enable-benchmarks-read=true'"
Seed:        [('127.0.0.1', 3000, None)]
Config_file: /root/.aerospike/astools.conf, /etc/aerospike/astools.conf
ERROR: User must be in privileged mode to issue "asinfo" commands.
       Type "enable" to enter privileged mode.

Answer

You can switch to enable mode from the command line by prepending your asinfo command with enable:

$ asadm -e "enable;asinfo -v 'set-config:context=namespace;id=test;enable-benchmarks-read=true'"
Seed:        [('127.0.0.1', 3000, None)]
Config_file: /root/.aerospike/astools.conf, /etc/aerospike/astools.conf

~~~ enable ~~~

~~~ asinfo -v 'set-config:context=namespace;id=test;enable-benchmarks-read=true' ~~~
a0139619a5bb:3000 (172.17.0.3) returned:
ok

Keywords

ASADM ENABLE COMMAND LINE CLI ASINFO

Timestamp

September 2021