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

Using Redis to discovery tool problems #71

Closed
chameleonbr opened this issue Nov 29, 2017 · 3 comments
Closed

Using Redis to discovery tool problems #71

chameleonbr opened this issue Nov 29, 2017 · 3 comments
Labels

Comments

@chameleonbr
Copy link

chameleonbr commented Nov 29, 2017

Hello I'm using cote with Redis to discovery.
When I use in the same machine, all works ok, but when I use 2 or more machines nothing works.
Looking pub messages inside redis I see the IP address field 127.0.0.1, I thought that should be the network address 10.14.0.44 or 10.14.1.163 at this case. What's wrong?

responder1 ip 10.14.0.44
1511981478.601845 [0 10.14.0.44:38922] "publish" "cote" "{\"event\":\"hello\",\"pid\":\"dc136bc2-c818-4e00-a215-044348875b2d\",\"iid\":\"22d137fd-4ee9-437d-9920-d74f10078da9\",\"hostName\":\"HPDEV\",\"data\":{\"isMaster\":false,\"isMasterEligible\":true,\"weight\":-0.1511976109907,\"address\":\"127.0.0.1\",\"advertisement\":{\"name\":\"Estabelecimentos:Responder\",\"key\":\"$$Estabelecimentos\",\"axon_type\":\"rep\",\"port\":8005,\"type\":\"service\"},\"id\":\"22d137fd-4ee9-437d-9920-d74f10078da9\",\"processId\":\"dc136bc2-c818-4e00-a215-044348875b2d\",\"processCommand\":\"projects/mpre_estabs\"}}"

responder2 ip 10.14.1.163
1511982019.531203 [0 10.14.1.163:37152] "publish" "cote" "{\"event\":\"hello\",\"pid\":\"1a8d3288-c8aa-4218-b683-eb36f7c1b562\",\"iid\":\"9ff0f993-d8c7-4bc1-a272-86f04b05a658\",\"hostName\":\"ecelepar16853\",\"data\":{\"isMaster\":false,\"isMasterEligible\":true,\"weight\":-0.1511981997474,\"address\":\"127.0.0.1\",\"advertisement\":{\"name\":\"Estabelecimentos:Responder\",\"key\":\"$$Estabelecimentos\",\"axon_type\":\"rep\",\"port\":8002,\"type\":\"service\"},\"id\":\"9ff0f993-d8c7-4bc1-a272-86f04b05a658\",\"processId\":\"1a8d3288-c8aa-4218-b683-eb36f7c1b562\",\"processCommand\":\"menorpreco_estabelec/index.js\"}}
@chameleonbr chameleonbr changed the title Using Redis to discovery tool Using Redis to discovery tool problems Nov 29, 2017
@dashersw
Copy link
Owner

@chameleonbr the problem stems from the IP resolution, which doesn't work as expected in Kubernetes, for example.

I have just released cote 0.16.0, which supports an environment variable DISCOVERY_HOSTNAME. If you run your services with this environment variable set, all the services will report the hostname you give to them. You should mostly be setting the hostname automatically based on the actual hostname (of a Docker container, for example), but manual setting will also work.

@chameleonbr
Copy link
Author

Hi, I've tried to use this env var, but seems not worked, I've used the useHostNames:true too, but nothing works.

@dashersw
Copy link
Owner

dashersw commented Dec 1, 2017

@chameleonbr can you share more info about your environment? Do you have a setup that I can replicate and test?

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