ipv4/ip_forward contents are not set to 1 echo “1” > /proc/sys/net/ipv4/ip_forward [ERROR DirAvailable–var-lib-etcd...]: /var/lib/etcd is not empty rm -rf /var/lib/etcd failed to load Kubelet config file /var/lib/kubelet
]: /etc/kubernetes/manifests/etcd.yaml already exists [ERROR Port-10250]: Port 10250 is in use...2379]: Port 2379 is in use [ERROR Port-2380]: Port 2380 is in use [ERROR DirAvailable--var-lib-etcd...]: /var/lib/etcd is not empty [preflight] If you know what you are doing, you can make a check non-fatal.../lib/kubelet" [reset] deleting contents of stateful directories: [/var/lib/etcd /var/lib/kubelet /etc.../cni/net.d /var/lib/dockershim /var/run/kubernetes] [reset] deleting contents of config directories:
/kubelet/ /var/lib/kubelet-bak 删除 kubelet 客户端证书: ➜ rm /var/lib/kubelet/pki/kubelet-client* 然后在 master1...y 现在我们使用下面的命令来重新初始化控制平面节点,但是最重要的一点是要使用 etcd 的数据目录,可以通过 --ignore-preflight-errors=DirAvailable--var-lib-etcd...➜ kubeadm init --config kubeadm.yaml --ignore-preflight-errors=DirAvailable--var-lib-etcd [init] Using...Kubernetes version: v1.22.8 [preflight] Running pre-flight checks [WARNING DirAvailable--var-lib-etcd...]: /var/lib/etcd is not empty [preflight] Pulling images required for setting up a Kubernetes cluster
kube-system get cm kubeadm-config -o yaml' [kubelet-start] Writing kubelet configuration to file "/var.../lib/kubelet/config.yaml" [kubelet-start] Writing kubelet environment file with flags to file "/var/lib...]: /etc/kubernetes/manifests/etcd.yaml already exists [ERROR Port-10250]: Port 10250 is in use...2379]: Port 2379 is in use [ERROR Port-2380]: Port 2380 is in use [ERROR DirAvailable--var-lib-etcd...]: /var/lib/etcd is not empty [preflight] If you know what you are doing, you can make a check non-fatal
,恢复数据需要恢复到etcd的数据目录,目录一般都是在 /var/lib/etcd ,先停etcd服务,然后把数据目录删除,进行数据恢复,最后启动etcd服务。.../lib/kubelet/* -name cache* /var/lib/kubelet/pods/29767367-c535-491d-b1c0-beaaff531849/plugins/kubernetes.io...~empty-dir/cache-volume /var/lib/kubelet/pods/29767367-c535-491d-b1c0-beaaff531849/volumes/kubernetes.io...~empty-dir/cache-volume cd /var/lib/kubelet/pods/29767367-c535-491d-b1c0-beaaff531849/volumes/kubernetes.io...~empty-dir/cache-volume root@k8s-node3:/var/lib/kubelet/pods/29767367-c535-491d-b1c0-beaaff531849/volumes
-1.el7.x86_64.rpm MASTER_ADDRESS=$1 sed -i 's/User=etcd//g' /usr/lib/systemd/system/etcd.service echo...==============' cat /etc/etcd/etcd.conf #[member] ETCD_NAME=default ETCD_DATA_DIR="/var/lib/etcd.../lib/kubelet mkdir -p /var/log/kubernetes echo '===================Config kubelet... ===============...logs" will not work if you set this flag. # NODE_PORT="--port=10250" # --hostname-override="": If non-empty...KUBE_CFG_DIR}/proxy file===================" cat ${KUBE_CFG_DIR}/proxy # --hostname-override="": If non-empty
2379]: Port 2379 is in use [ERROR Port-2380]: Port 2380 is in use [ERROR DirAvailable--var-lib-etcd...]: /var/lib/etcd is not empty [preflight] If you know what you are doing, you can make a check non-fatal.../ca" certificate and key [certs] Generating "etcd/server" certificate and key [certs] etcd/server serving...scheduler.conf" kubeconfig file [kubelet-start] Writing kubelet environment file with flags to file "/var.../lib/kubelet/kubeadm-flags.env" [kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet
resources: {} volumeMounts: - mountPath: /var/lib/etcd name: etcd-data -.../lib/etcd/ 3、启动新etcd节点,指定–data-dir=/var/lib/etcd/ etcd节点扩展 节点名 IP 备注 infra0 172.16.154.81 初始节点,k8s的master.../lib/etcd/ 注:执行上述命令需要机器上有etcdctl 上述命令执行成功会将快照中的数据存放到/var/lib/etcd目录中 3、在infra1节点启动etcd 将如下yaml放入/etc...节点加入集群重复上述操作;注意在加入集群之前,将之前/var/lib/etcd/的数据删除。...rm /var/lib/etcd/ -rf # 因为这是个扩展节点,需要同步etcd0的数据,所以把它自己数据删掉 vim ..
/var/lib/etcd/ && mkdir -p /etc/etcd/ 4、编辑节点node-3配置文件 注: 重要的事情说三遍:修改/etc/etcd/etcd.conf文件要先删除/var...重要的事情说三遍:修改/etc/etcd/etcd.conf文件要先删除/var/lib/etcd目录下保存的数据,再重新启用 服务,不然失败。...重要的事情说三遍:修改/etc/etcd/etcd.conf文件要先删除/var/lib/etcd目录下保存的数据,再重新启用 服务,不然失败 。...="etcd03" #2.设置数据保存的目录 ETCD_DATA_DIR="/var/lib/etcd" #3.用于监听其他etcd member的url ETCD_LISTEN_PEER_URLS...cd /var/lib/etcd && rm -rf * 注3:集群ip地址变化后,除了修改/etc/etcd/etcd.conf 文件并重新启用服务外,还需要删除/var/lib/etcd目 录下保存的数据
mkdir -p /etc/etcd vim /etc/etcd/etcd.conf # [member] ETCD_NAME=etcd1 ETCD_DATA_DIR="/var/lib/etcd" ETCD_LISTEN_PEER_URLS...://192.168.1.11:2379" 创建etcd.service配置文件 etcd.service的变量都是引用etcd配置文件中 mkdir /var/lib/etcd vim /usr/lib...:2380,etcd3=https://192.168.1.13:2380 \ --initial-cluster-state=new \ --data-dir=/var/lib/etcd Restart...etcd.conf与/var/lib/systemd/system/etcd.service两个配置文件,且etcd.service引用了etcd.conf重定义的变量。...//192.168.1.13:2380 \ --initial-cluster-state=new \ --data-dir=/var/lib/etcd Restart=on-failure RestartSec
]# cp -ar /data/etcd/ /var/lib/ [root@node1 ~]# ll /var/lib/etcd/ total 0 drwx------. 4 root root 29...v3.3.12 ETCD_DATA_DIR=/var/lib/etcd 3.修改启动参数 [root@node1 ~]# vim /usr/local/bin/etcd #!...\ -v /etc/ssl/certs:/etc/ssl/certs:ro \ -v /etc/ssl/etcd/ssl:/etc/ssl/etcd/ssl:ro \ -v /var/lib.../etcd:/var/lib/etcd:rw \ --memory=0 \ --blkio-weight=1000 \ --name=etcd1 \ quay.io/coreos/etcd...ssl/etcd/ssl:ro -v /var...
和etcd容器 备份当前数据 mv /etc/kubernetes/manifests /etc/kubernetes/manifests.bak mv /var/lib/etcd /var/lib/etcd.bak...$ ansible etcd -m shell -a "mv /var/lib/etcd/default.etcd /var/lib/etcd/default.etcd.bak" 数据恢复 (需要拷贝当前的备份数据到其余的节点...--initial-advertise-peer-urls=https://192.168.56.11:2380 --data-dir=/var/lib/etcd/default.etcd # etcd...--initial-advertise-peer-urls=https://192.168.56.12:2380 --data-dir=/var/lib/etcd/default.etcd # etcd...--initial-advertise-peer-urls=https://192.168.56.13:2380 --data-dir=/var/lib/etcd/default.etcd 启动etcd
旧ETCD环境数据备份 备份V2: etcdctl backup --data-dir /var/lib/etcd --backup-dir /opt/etcdv2 注:此处的数据目录为: /var/...数据目录下 unzip /opt/etcdv2 && mv /opt/etcdv2/member /var/lib/etcd/infra1.etcd/ 2.启动新节点(new-01节点) 因为备份的数据中...# configure file for etcd.service # [member] ETCD_NAME=infra1 ETCD_DATA_DIR="/var/lib/etcd/infra1.etcd...file for etcd.service # [member] ETCD_NAME=infra2 ETCD_DATA_DIR="/var/lib/etcd/infra2.etcd" ETCD_LISTEN_PEER_URLS...ETCD_DATA_DIR="/var/lib/etcd/infra3.etcd" ETCD_LISTEN_PEER_URLS="http://10.94.19.181:2380" ETCD_LISTEN_CLIENT_URLS
/lib/etcd/ ExecStart=/home/anakin/bin/etcd \ --name=192.168.32.131 \ --listen-client-urls=http://.../lib/etcd Restart=on-failure RestartSec=5 LimitNOFILE=65536 [Install] WantedBy=multi-user.target 然后执行以下命令...: cp etcd.service /lib/systemd/system/ systemctl enable etcd.service mkdir -p /var/lib/etcd service etcd...[Install] WantedBy=multi-user.target 然后执行和启动etcd类似的命令 cp kube-apiserver.service /lib/systemd/system/.../run/calico:/var/run/calico \ -v /lib/modules:/lib/modules \ -v /run/docker/plugins:/run/docker/plugins
写在前面 在传统的运维部署中,需求增量上线的时,会备份应用和应用数据,保证升级失败也可以回滚,同时,定期数据备份也是容灾的一种手段,如K8s中etcd的定期快照备份,当K8s集群和etcd集群因为不可控原因全部死掉之后...,除非有etcd备份,否则只能重置集群环境了。.../lib/mysql] └─$mysql -uroot Welcome to the MariaDB monitor....4 rows in set (0.00 sec) MariaDB [(none)]> use test Database changed MariaDB [test]> show tables; Empty...lib/mysql" db=mysql [ !
在server81节点服务器,配置etcd的service文件 参数说明: 1、指定 etcd 的工作目录为 /var/lib/etcd,数据目录为 /var/lib/etcd,需在启动服务前创建这两个目录...; 在配置中的命令是这条: WorkingDirectory=/var/lib/etcd/ 2、为了保证通信安全,需要指定 etcd 的公私钥(cert-file和key-file)、Peers 通信的公私钥和...=infra1 ETCD_DATA_DIR="/var/lib/etcd" ETCD_LISTEN_PEER_URLS="https://172.16.5.81:2380" ETCD_LISTEN_CLIENT_URLS...=infra2 ETCD_DATA_DIR="/var/lib/etcd" ETCD_LISTEN_PEER_URLS="https://172.16.5.86:2380" ETCD_LISTEN_CLIENT_URLS...=infra3 ETCD_DATA_DIR="/var/lib/etcd" ETCD_LISTEN_PEER_URLS="https://172.16.5.87:2380" ETCD_LISTEN_CLIENT_URLS
ETCD 简介 ETCD 是用于共享配置和服务发现的分布式,一致性的KV存储系统。ETCD是CoreOS公司发起的一个开源项目,授权协议为Apache。...服务 $ systemctl stop etcd 移除所有 ETCD 存储目录下数据 $ mv /var/lib/etcd/default.etcd /var/lib/etcd/default.etcd.bak...\ --initial-advertise-peer-urls https://192.168.1.36:2380 \ --data-dir=/var/lib/etcd/default.etcd...https://192.168.1.37:2380 \ --data-dir=/var/lib/etcd/default.etcd # k8s-master3 机器上操作 $ ETCDCTL_API...\ --data-dir=/var/lib/etcd/default.etcd 上面三台 ETCD 都恢复完成后,依次登陆三台机器启动 ETCD $ systemctl start etcd 三台
# 删除etcd相关文件 rm -rf /var/lib/etcd/* rm -rf /etc/default/etcd # 设置时区 ln -snf /usr/share/zoneinfo/Asia... <<EOF ETCD_NAME=$name ETCD_DATA_DIR="/var/lib/etcd/" ETCD_LISTEN_PEER_URLS="http://$ETCD_Server:2380.../passwd|grep etcd|wc -l\` -eq 0 ];then mkdir -p /var/lib/etcd && useradd -g 217 -u 111 etcd -d /var/lib...chown -R etcd:etcd /var/lib/etcd systemctl restart etcd.service #netstat -anpt | grep 2379 # 查看版本 etcdctl...如果需要清空etcd的值,使用以下命令 rm -rf /var/lib/etcd/member/* 重启etcd service etcd restart 查看etcd的所有的值,其中 --endpoints
://0.0.0.0:2379" ETCD_DATA_DIR="/var/lib/etcd/" ETCD_ADVERTISE_CLIENT_URLS="http://192.168.29.102:2379...k8s 启动文件 # etcd cat >/lib/systemd/system/etcd.service [Unit] Description=Etcd Server Documentation.../lib/kubelet cat >/var/lib/kubelet/kubeconfig apiVersion: v1 kind: Config users: - name: kubelet.../lib/kubelet/kubeconfig" EOF # proxy cat >proxy KUBE_PROXY_ARGS="" EOF # 3、启动文件 cat >/lib...After=docker.service # Requires=docker.service # 先安装docker启动了再启动worker [Service] WorkingDirectory=/var
领取专属 10元无门槛券
手把手带您无忧上云