Giter Site home page Giter Site logo

go-micro-learning's Introduction

micro

实现功能

  • 链路跟踪
gateway-api -> api -> grpc
  • 日志
访问日志、业务日志: 增加 Trace-Id 字段
  • etcd配置中心
micro etcd配置库功能进行封装,动态更新配置增加HookFunc功能
  • 其他主要功能
熔断
prometheus监控
内部服务采用grpc通信

环境准备

  • jaeger部署
docker run -d --name jaeger -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 -p 5775:5775/udp -p 6831:6831/udp -p 6832:6832/udp -p 5778:5778 -p 16686:16686 -p 14268:14268 -p 9411:9411 jaegertracing/all-in-one:1.6
  • etcd部署

docker命令

docker run -d \
  -p 2379:2379 \
  -p 2380:2380 \
  -v /Users/fred/application/data/etcd:/etcd-data \
  --name etcd_gcr_v3.3.13 \
  quay.io/coreos/etcd:v3.3.13 \
  /usr/local/bin/etcd \
  --name s1 \
  --data-dir /etcd-data \
  --listen-client-urls http://0.0.0.0:2379 \
  --advertise-client-urls http://0.0.0.0:2379 \
  --listen-peer-urls http://0.0.0.0:2380 \
  --initial-advertise-peer-urls http://0.0.0.0:2380 \
  --initial-cluster s1=http://0.0.0.0:2380 \
  --initial-cluster-token tkn \
  --initial-cluster-state new

客户端命令:

export ETCDCTL_API=3
etcdctl --endpoints='127.0.0.1:2380' put  /gateway/config/log_config '{"log_file_name":"./logs/info.log","ac_file_name":"./logs/access.log","max_size":128,"max_backups":30,"max_a
ge":7,"log_level":"debug"}'

etcdctl --endpoints='127.0.0.1:2380' put  /gateway/config/redis_config '{"addr":"127.0.0.1:26379","password":"","timeout":2000,"dbNum":0,"enabled":true,"sentinel":{"enabled":fals
e,"master":"","nodes":""}}'

etcdctl --endpoints='127.0.0.1:2380' put  /gateway/config/db_config '{"driver":"mysql","url":"root:qwe123a@tcp(127.0.0.1:23306)/cmdb_dome?charset=utf8&parseTime=true&loc=Local","
enabled":true,"max_idle_connection":2,"max_open_connection":3}'

go-micro-learning's People

Stargazers

baker-yuan avatar sky(曾浩) avatar

Watchers

 avatar

Forkers

zenghao306 xyui

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.