Asadm -h localhost doesn't work in version 0.1.17


#1

As the subject says asadm -h localhost doesn’t work on version 0.1.17 it fails with the following error:

[root@c7 ~]# asadm -h localhost
Seed:        [('localhost', 3000, None)]
Config_file: /root/.aerospike/astools.conf, /etc/aerospike/astools.conf
Aerospike Interactive Shell, version 0.1.17

ERROR: Not able to connect any cluster with [('localhost', 3000, None)].

This is on CentOS 7, I haven’t tried other distributions. An even bigger problem is that when you install the RPM of this latest version it adds the following line in /etc/aerospike/astools.conf:

[global]
host = "localhost:3000,[::1]:cluster_a:3000"

which means that it will use localhost by default when you type asadm so it fails as well.

Using asadm -h 127.0.0.1 works without issues, and older versions work both with localhost and 127.0.0.1.


#2

only configuration setting part is different in asadm-0.1.17. Remaining working and connecting to cluster is same. As per your output, configuration are set correctly. Now it should connect cluster if older versions of asadm are able to connect on same machine. Also noticed that astools.conf file is not the one which installed by tools package. This is file from asadm git repo. Did you try git code before?

We tried but not able to reproduce this issue at our end. Can you please try clean installation again (uninstall tools, delete astools.conf and install tools). After that try asadm with localhost. If its still not working then try with --no-config-file option, in this way it will work same as older version (without reading anything from conf file). Also please try any other tool (for ex. aql) with localhost just to check working with localhost.


#3

I found out what is the issue, and it has nothing to do with the configuration. The problem is that on hosts which have IPv6 enabled asadm -h localhost doesn’t work, while on hosts which have IPv6 disabled it works.

Our aerospike.conf only has this configured:

network {
    service {
        address any
        port 3000
    }
    ...
}

and when I look at on what address is Aerospike listening it’s only listening on IPv4:

# ss -ntlp | grep asd
LISTEN     0      128          *:3000                     *:*                   users:(("asd",pid=29860,fd=23))
LISTEN     0      128          *:3001                     *:*                   users:(("asd",pid=29860,fd=19))
LISTEN     0      128          *:3002                     *:*                   users:(("asd",pid=29860,fd=21))
LISTEN     0      128          *:3003                     *:*                   users:(("asd",pid=29860,fd=27))

My guess is that localhost is by default resolved to an IPv6 local address to which asadm cannot connect.

Regarding the astools.conf the file is part of aerospike-tools-3.15.3.2-1.el7.x86_64.rpm which is the latest version of the package. If I remember correctly if I install aerospike-tools from the Github repo, it doesn’t install that config file, but the package does.

I would recommend that you update astools.conf to use 127.0.0.1 instead of localhost in the config file, or make it so that it resolves localhost into an IPv4 address.


#4

So its localhost issue. Your first comment, you mentioned that old asadm is working with localhost. I thought you tried it on the same box.

Actually all tools default host value is localhost. Just to keep consistent with that we keep default values in conf file.


#5

Sorry, I wrote it bad the first time, localhost doesn’t work in 0.1.16 with IPv6 enabled. At that time I didn’t even try with IPv6 disabled.

It’s strange that localhost is the default value, because when I just type asadm it works in both cases (without a config file of course).


#6

Have you managed to reproduce this issue? This can be a problem on all hosts with IPv6 enabled.


#7

@Hemant_Patre, unless I am missing something, it appears that the default is ‘127.0.0.1’.


#8

127.0.0.1 is the default, but the problem is that the latest aerospike-tools RPM ships with /etc/aerospike/astools.conf which has the following configured:

[cluster]
host = "localhost:cluster_a:3000"

So by default it uses localhost, instead of 127.0.0.1.


#9

We have already fixed this issue internally. We have commented all entries in conf file. So no new parameter will get assigned through conf without users knowledge. And default values will continue to work as old behaviour. host default is 127.0.0.1. These changes will be published in next release once done with all testing.