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 

  • 相关阅读:
    关于nginx稳定版1.20.1 4层负载 stream模块失效
    Docker 容器内分析 java程序占用 cpu 高问题排查分析
    分组排序查第一第二的差值
    【album】语音合成技术
    8.juery
    7.dom
    6.对象
    5.函数
    4.数组
    3.JS
  • 原文地址:https://www.cnblogs.com/fwdqxl/p/9279583.html
Copyright © 2011-2022 走看看