kzdgt Blog

路在脚下,心向远方

部署etcd

部署etcd

安装部署 docker pull bitnami/etcd docker run -d --name etcd-server \ --network mynet2 \ --publish 2379:2379 \ --publish 2380:2380 \ --env ALLOW_NONE_AUTHENTICATION=yes \ --env ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379 \ bitnami/etcd:latest go get go.etcd.io/etcd/client/v3 put和get,以及watch操作 package main import ( "context" "fmt" "go.etcd.io/etcd/client/v3" "net" "strings" "time" ) var cli *clientv3.Client func main() { var err error cli,