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

nsqadmin use DNS to search #691

Closed
gzliudan opened this issue Dec 2, 2015 · 2 comments
Closed

nsqadmin use DNS to search #691

gzliudan opened this issue Dec 2, 2015 · 2 comments
Labels

Comments

@gzliudan
Copy link

gzliudan commented Dec 2, 2015

When I test NSQ in LAN, I found nsqadmin use DNS to search host first which is not wanted, and the web server can't display topic information when I visit http://192.168.0.56:4171/topics/test:
UPSTREAM_ERROR: Failed to query any nsqd: Get http://master56:4151/stats?format=json: dial tcp: i/o timeout

[root@master56 ~]# nsqadmin --lookupd-http-address=192.168.0.56:4161
[nsqadmin] 2015/12/02 09:18:24.374850 nsqadmin v0.3.6 (built w/go1.5.1)
[nsqadmin] 2015/12/02 09:18:24.375169 HTTP: listening on [::]:4171
[nsqadmin] 2015/12/02 09:18:40.606327 200 GET / (192.168.0.103:52183) 1.236145ms
[nsqadmin] 2015/12/02 09:18:40.666930 200 GET /static/base.css (192.168.0.103:52184) 13.714008ms
[nsqadmin] 2015/12/02 09:18:40.667144 200 GET /static/bootstrap.min.css (192.168.0.103:52183) 14.295617ms
[nsqadmin] 2015/12/02 09:18:40.667629 200 GET /static/main.js (192.168.0.103:52186) 13.273116ms
[nsqadmin] 2015/12/02 09:18:40.667819 200 GET /static/vendor.js (192.168.0.103:52185) 13.722146ms
[nsqadmin] 2015/12/02 09:18:40.830069 CI: querying nsqlookupd http://192.168.0.56:4161/topics
[nsqadmin] 2015/12/02 09:18:40.831091 200 GET /api/topics (192.168.0.103:52183) 1.087458ms
[nsqadmin] 2015/12/02 09:18:40.832210 200 GET /static/nsq_blue.png (192.168.0.103:52185) 430.752µs
[nsqadmin] 2015/12/02 09:18:56.818582 CI: querying nsqlookupd http://192.168.0.56:4161/lookup?topic=test
[nsqadmin] 2015/12/02 09:18:56.820026 CI: querying nsqd http://master56:4151/stats?format=json
[nsqadmin] 2015/12/02 09:18:58.820320 ERROR: failed to get topic metadata - Failed to query any nsqd: Get http://master56:4151/stats?format=json: dial tcp: i/o timeout
[nsqadmin] 2015/12/02 09:18:58.820429 502 GET /api/topics/test (192.168.0.103:52185) 2.001910974s

@gzliudan
Copy link
Author

gzliudan commented Dec 2, 2015

After I add a host record to /etc/hosts, this problem disappear. But I think it should use /etc/hostname first, then /etc/hosts, then DNS

@jehiah
Copy link
Member

jehiah commented Dec 2, 2015

@gzliudan nsqd by default broadcasts it's address as the hostname. In your case that's master56. If that is not resolvable in your case you can make it resolvable by adding it to the /etc/hosts on the machine running nsqadmin and on any nsq clients that need to connect to it, or change your hostname to something resolvable, or set --broadcast-address to the IP where nsqd can be reached.

@jehiah jehiah added the question label Dec 2, 2015
@jehiah jehiah closed this as completed Dec 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants