• Stars
    star
    394
  • Rank 109,295 (Top 3 %)
  • Language
    Go
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Micro 微服务实践

Micro github.com/micro

Slack

go-micro

Local

Build micro cmd

go build -o bin/micro cmd/micro/main.go

Start registry & api with server runtime

./bin/micro --profile starter-local server
Start registry & api with service command Run registry service ```shell script ./bin/micro --profile starter-local service registry ```

Run API service

./bin/micro --profile starter-local service api

Run example service

# Account
cd service/account
go run main.go --profile starter-local

# Greeting
cd service/greeting
go run main.go --profile starter-local

Test example service

# Account
curl "http://localhost:8080/account/info?id=1"

# Greeting
curl "http://localhost:8080/greeting/call?msg=helloworld"
{"id":"1","msg":"helloworld"}

Kubernetes

Attention: default ingress class=nginx, host=api.micro.hbchen.com

helm install -n micro micro-server manifests/charts/micro \
--set ingress.enabled=true

# Digest
helm install -n micro micro-server manifests/charts/micro \
--set image.tag="latest@sha256:1e2c8df50398c2dcd4b96065b8b81842a86c5cc83d8ef1ae96ac7b5d8432add3" \
--set ingress.enabled=true
helm install -n micro micro-example manifests/charts/servic

# Digest
helm install -n micro micro-example manifests/charts/service \
--set image.tag="latest@sha256:fa2e56f01a4704ad298331cd0356a0e174e9358701922552934bbd4987c9fb80"
curl "http://api.micro.hbchen.com/account/info?id=1"