zoukankan      html  css  js  c++  java
  • traefik+etcd构建grpc微服务demo

    1.下载安装traefik

       

    https://github.com/containous/traefik/releases

    2.下载安装etcd3

    https://github.com/coreos/etcd/releases

    3.配置traefik,监控etcd的k-v,traefik使用文档地址 https://docs.traefik.io/master/user-guide/grpc/

    [etcd]
    prefix = "/myservice"
    watch=true
    endpoint = "127.0.0.1:2379"
    #APIV3=true
    useAPIV3 = true
    [entryPoints]
      [entryPoints.http]
        address = ":8001"  //http1,htp2的入口地址
        compress = true
      [entryPoints.bar]
        address = ":8081"
    [api]
      entryPoint = "bar" //admin的入口地址
      dashboard = true
      debug = true

    4.将服务信息写入ETCD 

    put /myservice/backends/backend1/servers/server1/url h2c://backend.local:8080
    
    put /myservice/frontends/frontend1/backend backend1
    
    put /myservice/frontends/frontend1/routes/test_1/rule PathPrefix:/proto.HelloHttp/SayHello

    5.启动 SayHello的GRPC服务

    6.启动traefik 

  • 相关阅读:
    HDU 3547 DIY Cube
    POJ 2975 Nim
    POJ 1678 I Love this Game!
    POJ 2234 Matches Game
    POJ 3537 Crosses and Crosses
    POJ 3710 Christmas Game
    POJ 1704 Georgia and Bob
    HDU 3923 Invoker
    POJ 2154 Color
    PLM更新自定义CLASS
  • 原文地址:https://www.cnblogs.com/fwdqxl/p/9279583.html
Copyright © 2011-2022 走看看