I run etcd by this command (no more other configuration)
./etcd-v3.2.12-linux-amd64/etcd
package main
import (
"context"
"fmt"
"github.com/coreos/etcd/clientv3"
)
func main() {
cli, err := clientv3.New(clientv3.Config{
Endpoints: []string{"http://127.0.0.1:2379"},
})
if err != nil {
fmt.Println(err)
return
}
_, err = cli.Put(context.TODO(), "abc", "123")
if err != nil {
fmt.Println(err)
return
}
fmt.Println("put succ")
}
./etcd-v3.2.12-linux-amd64/etcdctl get abc
Error: 100: Key not found (/abc) [6]
more details more details more details more details more details more details more details more details more details more details more details more details more details more details more detailsmore details more details more details more details more details more details more details more details more details more details more details more details more details more details more details