Micro 安装

下载micro

$ go get -u -v github.com/go-log/log

$ go get -u -v github.com/gorilla/handlers

$ go get -u -v github.com/gorilla/mux

$ go get -u -v github.com/gorilla/websocket

$ go get -u -v github.com/mitchellh/hashstructure

$ go get -u -v github.com/nlopes/slack

$ go get -u -v github.com/pborman/uuid

$ go get -u -v github.com/pkg/errors

$ go get -u -v github.com/serenize/snaker

# hashicorp_consul.zip包解压在github.com/hashicorp/consul

$ unzip hashicorp_consul.zip -d github.com/hashicorp/consul

# miekg_dns.zip 包解压在github.com/miekg/dns

$ unzip miekg_dns.zip -d github.com/miekg/dns

$ go get github.com/micro/micro


编译安装micro

$ cd $GOPATH/src/github.com/micro/micro

$ go build -o micro main.go

$ sudo cp micro /bin/

插件安装

go get -u -v github.com/golang/protobuf/{proto,protoc-gen-go}

go get -u -v github.com/micro/protoc-gen-micro

关于github下载慢的问题

vim /etc/hosts

192.30.253.112 github.com

151.101.185.194 github.global.ssl.fastly.net

reboot


micro基本演示

创建微服务命令说明

创建2个服务

启动consul进行监管

consul agent -dev                 这是开发网络


对srv服务进行的操作

你可能感兴趣的:(Micro 安装)