Go-micro: I can't set registry with consul

Created on 29 Oct 2019  路  5Comments  路  Source: asim/go-micro

However, I updated the micro runtime to v1.14. Then, I can't not run the micro web/api/proxy with the param --registry=consul.
What can I?

question

Most helpful comment

Consul was deprecated. You can see why here https://micro.mu/blog/2019/10/04/deprecating-consul.html.

To continue to use consul please import it from go-plugins

import _ "github.com/micro/go-plugins/registry/consul"

All 5 comments

Consul was deprecated. You can see why here https://micro.mu/blog/2019/10/04/deprecating-consul.html.

To continue to use consul please import it from go-plugins

import _ "github.com/micro/go-plugins/registry/consul"

All right, I have modified the compose file like this:
and it worked.

version: "3.7"

services:
  etcd:
    image: 'bitnami/etcd:latest'
    environment:
      - ALLOW_NONE_AUTHENTICATION=yes
      - ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
    ports:
      - 2379:2379
      - 2380:2380
    networks:
      - micro-net
  api:
    command: --registry=etcd --registry_address=etcd:2379 --register_interval=5 --register_ttl=10  api --address=0.0.0.0:8080
    image: microhq/micro
    ports:
      - "8080:8080"
    networks:
      - micro-net

  proxy:
    command: --registry=etcd --registry_address=etcd:2379 --register_interval=5 --register_ttl=10 proxy --address=0.0.0.0:8081
    image: microhq/micro
    ports:
      - "8081:8081"
    networks:
      - micro-net
  web:
    deploy:
      replicas: 3
    command:  --registry=etcd --registry_address=etcd:2379 --register_interval=5 --register_ttl=10 web --address=0.0.0.0:8082
    image: microhq/micro
    ports:
      - "8082:8082"
    networks:
      - micro-net

networks:
  micro-net:
    external: true

Well, this is a demo for studying the micro-go. Do you mind giving me some suggestion about deploying micro-go and customer api/srv service in the production env with docker stack.

Consul was deprecated. You can see why here https://micro.mu/blog/2019/10/04/deprecating-consul.html.

To continue to use consul please import it from go-plugins

import _ "github.com/micro/go-plugins/registry/consul"

thank you 锛乶ow锛孖 can sleep well

help much. I think docs need to be updated

I have the same problem, how did you solve the problem?
when i run
micro --registry=consul --registry_address=127.0.0.1:8500 api --handler=rpc ;
I got error "Registry consul not found"

Was this page helpful?
0 / 5 - 0 ratings