Go etcd dependency problem is finally solved. . .

Hello everyone, I am fried fish. In the past few years, I have been exposed to a bunch of microservice-related components very frequently: grpc + grpc-gateway + etcd + protobuf + protoc-gen-go. At first, everything was fine, and we gradually followed up with new versions. No, the moth is here. The development leaders (or companies) […]

Distributed lock (3)–Distributed lock implementation based on Etcd

Preface The distributed lock implemented based on Redis has strong performance and many functions. However, due to the characteristics of Redis itself, the distributed lock implemented based on Redis It may not be unique, so it cannot be applied in scenarios that require distributed locks to be absolutely unique. For this reason, distributed locks can […]

Kubernetes Special Topic-12, ETCD

Kubernetes topic-12, ETCD ETCD special topic Section 1 Kubeadm builds kubernetes cluster etcd cluster in static pod form etcd cluster usage scenarios Section 3 Viewing ETCD cluster status information Section 4 ETCD cluster backup and restore Troubleshooting Section 3 ETCD cluster performance problem diagnosis Section 4 ETCD cluster performance optimization ETCD topic Section 1 Kubeadm […]

Centos7 installation etcd

Download and unzip the installation package from Github wget https://github.com/coreos/etcd/releases/download/v3.4.10/etcd-v3.4.10-linux-amd64.tar.gz tar xzvf etcd-v3.4.10-linux-amd64.tar.gz mv etcd-v3.4.10-linux-amd64 /opt/etcd After decompression are some documents and two binary files etcd and etcdctl. etcd is the server side, etcdctl is the client side. In the test environment, to start a single-node etcd service, just run the etcd command. ./etcd Configuration […]

Kubernetes Etcd unavailable log: NOSPACE problem fixed

The etcd cluster space exceeded the quota in two k8s clusters on the same day. When kubectl get cs, it was found that all etcd returned 503 errors. Check etcd alarms and found that NO SPACE information and etcdctl –endpoints=${ETCD_ENDPOINT} –cert=${ETCD_CERTFILE} –key=${ETCD_KEYFILE} –cacert=${ETCD_CAFILE} endpoint status DB SIZE in is greater than 2GiB. Version Information kubernetes […]

k8s etcd startup error

Background An unexpected power outage in the computer’s hibernation state causes the virtual machine to directly enter a shutdown state. Question kubectl command error [root@master01 ~]#kubectl get node The connection to the server master01.kktb.org:6443 was refused – did you specify the right host or port? kubelet service error Oct 15 08:39:37 master01.kktb.org kubelet[747]: E1015 08:39:37.251784 […]

Personal interpretation of distributed lock source code implemented by etcd

1 Prerequisite introduction 1.1 Distributed lock type Active polling type: This model is somewhat similar to the active polling + cas optimistic locking model in go’s sync.Mutex. The lock-retrieving party will continue to attempt to acquire the distributed lock. If the lock is already occupied, it will continue to do so. Initiate retries until the […]

etcd failure-recovering backend from snapshot error: failed to find database snapshot file

1. Problem description The server crashed unexpectedly and k8s could not be started. Checking the kubelet log showed that node “master” was not found. Checking the etcd log reported an error as follows: Obviously the database file is damaged [root@master01 ~]# journalctl -u etcd -f … Oct 08 19:13:40 master01 etcd[66468]: recovering backend from snapshot […]

Deploy etcd cluster and apisix service based on k8s cluster containerization

Preliminary preparation Create StorageClass, support dynamic pvc creation, StorageClass uses nfs-client, and uses Huawei Cloud sfs as the data persistence storage directory. etcd deployment steps Role authentication (rabc.yaml) kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: nfs-client-provisioner-runner rules: 2. apiGroups: [“”] resources: [“persistentvolumes”] verbs: [“get”, “list”, “watch”, “create”, “delete”] 3. apiGroups: [“”] resources: [“persistentvolumeclaims”] verbs: [“get”, “list”, […]

2. k8s etcd self-signed certificate

1. Download and install, etcd issues certificate [master, each node] ①. Download the cfssl command tool #Download to /usr/local/bin/cfssl<br>curl -L https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 -o /usr/local/bin/cfssl ②. Download cfssljson [Get json output from cfssl] #Download to /usr/local/bin/cfssljson<br>curl -L https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64 -o /usr/local/bin/cfssljson ③. Install cfssl-certinfo [View certificate information] #Download to /usr/local/bin/cfssljson<br>curl -L https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64 -o /usr/local/bin/cfssl-certinfo ④. Copy cfssl, cfssljson\cfssl-certinfot […]