Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

address in config not working #4404

Closed
perklet opened this issue Jul 16, 2018 · 7 comments
Closed

address in config not working #4404

perklet opened this issue Jul 16, 2018 · 7 comments

Comments

@perklet
Copy link

perklet commented Jul 16, 2018

Overview of the Issue

When defining services in /etc/consul.d, address attribute of a service is not working.

Reproduction Steps

/etc/consul.d/redis.json :

{
    "services": [
        {
            "name": "redis.db",
            "tags": ["db"],
            "address": "10.1.1.2",
            "port": 6379
        }
    ]
}

consul command:

consul agent -server -ui -client=0.0.0.0 -data-dir=/var/consul -bind={{ GetInterfaceIP "eth0" }} -config-dir=/etc/consul.d/

after consul reload, the port part DID change, however, the address is always node's IP

Consul info for both Client and Server

Client info
output from client 'consul info' command here
Server info
output from server 'consul info' command here

Operating system and Environment details

Ubuntu 16.04, consul 1.2.1

Log Fragments

Jul 17 07:10:44 ip-10-1-1-1 consul[12109]:     2018/07/17 07:10:44 [INFO] agent: Reloading configuration...
Jul 17 07:10:44 ip-10-1-1-1 consul[12109]:     2018/07/17 07:10:44 [WARN] agent: Service name "redis.db" will not be discoverable via DNS due to invalid characters. Valid characters
Jul 17 07:10:44 ip-10-1-1-1 consul[12109]:     2018/07/17 07:10:44 [INFO] agent: Synced service "redis.db"
@mkeeler
Copy link
Member

mkeeler commented Jul 26, 2018

@yifeikong What are you doing to determine the address has not changed? Is it a health check that isn't using the new address or another end point?

@pearkes pearkes added type/question Not an "enhancement" or "bug". Please post on discuss.hashicorp waiting-reply Waiting on response from Original Poster or another individual in the thread labels Jul 26, 2018
@perklet
Copy link
Author

perklet commented Jul 27, 2018

I define the service address as '10.1.1.2:6379' as in the redis.json file on host 10.1.1.1, however, in the consul ui, the service is alway marked as ‘10.1.1.1:6379’

@mkeeler
Copy link
Member

mkeeler commented Jul 27, 2018

@yifeikong If you curl <agent address>/v1/catalog/service/redis.db does it produce the correct address. If so this might be a caching issue in the UI.

@perklet
Copy link
Author

perklet commented Jul 28, 2018

No, the api also gives error

@johncowen
Copy link
Contributor

Hi all,

It sounds like this isn't the issue if the API is not returning what you expect, but just incase, we did have an issue with showing service IP addresses in the UI where we were showing the Node IP instead of the Service IP (which sounds like what you describe here), this is fixed in #4410

That fix will be in the next release.

Thanks,

@perklet
Copy link
Author

perklet commented Jul 31, 2018

Yes, this is exactly what I'm experiencing, thanks.

You may close the issue now.

@johncowen
Copy link
Contributor

Hey @yifeikong ,

Thanks!

Just to finish up, if anyone else comes across this, the UI fix discussed above has been released and is in the 1.2.2 version of Consul.

@johncowen johncowen removed type/question Not an "enhancement" or "bug". Please post on discuss.hashicorp waiting-reply Waiting on response from Original Poster or another individual in the thread labels Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants