Go-micro: default mdns registry doesn't work correctly for me

Created on 13 Mar 2019  路  5Comments  路  Source: asim/go-micro

when i used default registry, the client grpc result this error:

{"level":"error","msg":"{\"id\":\"go.micro.client\",\"code\":500,\"detail\":\"error selecting node node: not found\",\"status\":\"Internal Server Error\"}","time":"2019-03-12T13:29:35+08:00"}

i changed to consul, it's ok
i'm only add a registry into micro.NewService

before

s.service = micro.NewService(
        micro.Name("go.micro.grpc.node"),
        micro.RegisterTTL(time.Second*30),
        micro.RegisterInterval(time.Second*15),
    )

after

    reg := consul.NewRegistry()
    s.service = micro.NewService(
        micro.Name("go.micro.grpc.node"),
        micro.RegisterTTL(time.Second*30),
        micro.RegisterInterval(time.Second*15),
        micro.Registry(reg),
    )

does some issues in mdns?
or anything wrong with my code?

Most helpful comment

for me, the macOS firewall was the issue. After turning it off, everything started to work

All 5 comments

U should set a env called "MICRO_REGISTRY=mdns" for ur service in docker containner, or U can learn it from this example in right way:
https://github.com/wuYin/shippy
https://wuyin.io/tags/%E5%BE%AE%E6%9C%8D%E5%8A%A1/

use consul to fix

so weird, is also not working for me. Basic example

for me, the macOS firewall was the issue. After turning it off, everything started to work

I too was having the same problem on mac, then I turned off the firewall and it started working fine.

Was this page helpful?
0 / 5 - 0 ratings