Using asadm "with" modifier to return exact match

From my experience with asadm, the argument of the with modifier appears to be used as a substring match instead of a direct match when gathering affected nodes.

When we do operations like quiescing, more than the intended node is affected. For example, given the 3 node cluster with node IDs 123, 12 & 1, running the below command will quiesce all three nodes instead of just the one with node ID 1.

asinfo -v "quiesce:" with 1

Is there a way to get a direct match with the with operator? I tried using regex but I don’t think it’s supported. Should I be using a different operator?

Relevant documentation: https://www.aerospike.com/docs/tools/asadm/user_guide/#modifiers

This is definitely something we should improve, thanks for reporting.

The ‘with’ modifier accepts both node_ids or the ‘Node’ (node name) as seen from asadm.

example:

Admin> i net
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Network Information (2020-03-30 23:43:09 UTC)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          Node|         Node ID|             IP|                    Build|Migrations|~~~~~~~~~~~~~~~~~~Cluster~~~~~~~~~~~~~~~~~~|Client|  Uptime
                              |                |               |                         |          |Size|         Key|Integrity|      Principal| Conns|        
174-22-0-1.heln.qwest.net:3000| BB9010016AE4202|174.22.0.1:3000|E-4.9.0.0-pre-35-gac9fa88|   0.000  |   2|36A33732EE67|True     |BB9030016AE4202|     5|01:06:02
174-22-0-3.heln.qwest.net:3000|*BB9030016AE4202|174.22.0.3:3000|E-4.9.0.0-pre-35-gac9fa88|   0.000  |   2|36A33732EE67|True     |BB9030016AE4202|     5|01:06:01
Number of rows: 2

Admin> asinfo -v "STATUS" with 1
174-22-0-1.heln.qwest.net:3000 (174.22.0.1) returned:
OK

174-22-0-3.heln.qwest.net:3000 (174.22.0.3) returned:
OK

Admin> asinfo -v "STATUS" with 174.22.0.1
174-22-0-1.heln.qwest.net:3000 (174.22.0.1) returned:
OK

Admin> asinfo -v "STATUS" with 174-22-0-1
174-22-0-1.heln.qwest.net:3000 (174.22.0.1) returned:
OK

Admin> asinfo -v "STATUS" with 174-22-0-1.heln.qwest.net:3000
174-22-0-1.heln.qwest.net:3000 (174.22.0.1) returned:
OK

If the IP address is also a subset of another then it would have to use the full “Node” name as it appears in info (see last example).

Thanks for your quick response. I’ll make use of the FQDN as suggested. Will the latter always be of <hostname>:3000 format?

The port 3000 is dependent on your service-port configuration.

Usually, but if the FQDN cannot obtained within the timeout, ipaddress:3000 will be used instead. The ipaddress will also work even if the FQDN is obtained.

That was really helpful. Thank you kporter.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.