Giter Site home page Giter Site logo

consul-sample's Introduction

consul-sample

关于Consul

配置ACL令牌

使用consul.exe agent -config-file=server1.json 启动服务后,输入consul.exe acl bootstrap获取初始化的管理员令牌,然后把配置的default_policy改为deny

集群配置

参考consul-server下的json配置文件,启动命令:consul.exe agent -config-file=server1.json

客户端连接

ASP.NET Core

参考目录dotnet-client

golang

参考目录go-client

灰度发布(金丝雀发布)

两种方案:

  1. 官方方案

不太推荐,配置文件需要使用cli或http手写,不支持ui页面修改,比较麻烦

  1. 基于tag的方案

简单,单独弄一个环境部署灰度发布的服务(例如弄一个1c2g的服务器,环境变量加上ENV:GRAY), 所有服务在Consul注册时先判断当前是否为灰度环境,是的话tag加一个{"env":"gray"}的标签,然后把一部分用户设置为灰度用户,这些用户在访问服务时时优先调用灰度服务,这样就可以用测试账号先提前测试灰度服务,在测试通过后发布到正式的生产环境

参考资料

  1. client mode configuration
  2. consul单机集群配置
  3. Consul官方配置文件文档

consul-sample's People

Contributors

li-zheng-hao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.