https://www.gravatar.com/avatar/925f106f8657f9f31645440a0a538227?s=240&d=mp

docker&compose安装

docker-compose我认为是单机管理容器的最佳方案,如果要多机 docker安装sudo apt-get remove docker docker-engine docker.io containerd runc # curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun curl -fsSL https://get.docker.com | bash -s

filebeat

安装#deb curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.15.2-amd64.deb sudo dpkg -i filebeat-7.15.2-amd64.deb #rpm curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.15.2-x86_64.rpm sudo rpm -vi filebeat-7.15.2-x86_64.rpm 设置路径: /var/filebeat/filebeat.yml output.elasticsearch:hosts:["myEShost

go安装

GOVER=1.17.2 wget golang.google.cn/dl/go${GOVER}.linux-amd64.tar.gz tar -xzf go${GOVER}.linux-amd64.tar.gz mv ./go /usr/local/go echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile source /etc/profile rm golang.google.cn/dl/go${GOVER}.linux-amd64.tar.gz #腾讯外网 go env -w GOPROXY=https://mirrors.cloud.tencent.com/go/ #腾讯内网 go env -w GOPROXY=http://mirrors.tencentyun.com/go/ #七牛镜像 go env -w GOPROXY=https://goproxy.cn,direct export GOPROXY=http://mirrors.tencentyun.com/go/

go请求http

go提供了一个http包,可以通过这个包方便的进行http请求 import ( "fmt" "io/ioutil" "net/http" "strings" ) // http.Get func httpGet() { resp, err := http.Get("http://www.baidu.com") if err != nil { fmt.Println(err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) } func httpPost() { resp, err := http.Post("http://www.baidu.com",