$ yum search openstack Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.bupt.edu.cn * epel: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.bupt.edu.cn * updates: mirrors.bupt.edu.cn ============================================ N/S matched: openstack ============================================ ansible-openstack-modules.noarch : Unofficial Ansible modules for managing Openstack centos-release-openstack-queens.noarch : OpenStack from the CentOS Cloud SIG repo configs centos-release-openstack-rocky.noarch : OpenStack from the CentOS Cloud SIG repo configs centos-release-openstack-stein.noarch : OpenStack from the CentOS Cloud SIG repo configs centos-release-openstack-train.noarch : OpenStack from the CentOS Cloud SIG repo configs diskimage-builder.noarch : Image building tools for OpenStack golang-github-rackspace-gophercloud-devel.noarch : The Go SDK for Openstack http://gophercloud.io php-opencloud.noarch : PHP SDK for OpenStack/Rackspace APIs php-opencloud-doc.noarch : Documentation for PHP SDK for OpenStack/Rackspace APIs python2-oslo-sphinx.noarch : OpenStack Sphinx Extensions and Theme for Python 2
Name and summary matches only, use "search all" for everything.
# Failed to set locale, defaulting to C # vim /etc/profile # 输入 export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 export LC_COLLATE=C export LC_CTYPE=en_US.UTF-8
yum
yum 命令卡住
1 2 3 4
# 问题出在 Amazon Linux 2,所有 yum 命令卡住 ps aux | grep yum
kill -9 <pid> # kill 所有 yum 进程
其他问题
Failed to download metadata for repo ‘appstream’
1 2 3 4 5 6 7
# 保存 CentOS Linux 8 - AppStream 9.5 B/s | 38 B 00:03 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist # 解决 dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos -y dnf distro-sync -y
# up / down ip link set dev ens7 up # up ip link set dev ens7 down # down
路由
1 2 3 4 5 6 7 8 9 10 11
# 展示路由配置 ip route show # 添加路由 ip route add <network_ip>/<cidr> via <gateway_ip> dev <network_card_name> ## 示例 ip route add 192.168.6.0/24 dev eth0 ip route add default # 删除路由 ip route del default # 删除默认路由
[Service] Type=notify ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --network-plugin= ExecReload=/bin/kill -s HUP $MAINPID TimeoutSec=0 RestartSec=2 Restart=always # Note that StartLimit* options were moved from "Service" to "Unit"in systemd 229. # Both the old, and new location are accepted by systemd 229 and up, so using the old location # to make them work for either version of systemd. StartLimitBurst=3 # Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230. # Both the old, and new name are accepted by systemd 230 and up, so using the old name to make # this option work for either version of systemd. StartLimitInterval=60s # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity # Comment TasksMax if your systemd version does not support it. # Only systemd 226 and above support this option. TasksMax=infinity Delegate=yes KillMode=process
[Install] WantedBy=multi-user.target
1 2 3 4 5 6 7 8 9 10 11 12 13
# cri-docker.socket [Unit] Description=CRI Docker Socket for the API PartOf=cri-docker.service
root@k8s-master-1:/home/ubuntu# export KUBECONFIG=/etc/kubernetes/admin.conf root@k8s-master-1:/home/ubuntu# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master-1 Ready control-plane 5m55s v1.24.1
ubuntu@k8s-master-1:~$ kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master-1 Ready control-plane 4m52s v1.24.1
回滚操作
1 2 3 4 5 6
kubeadm reset [glags]
preflight Run reset pre-flight checks update-cluster-status Remove this node from the ClusterStatus object. remove-etcd-member Remove a local etcd member. cleanup-node Run cleanup node.
配置网络
这一步很关键,如不能正确配置集群网络,pod 间可能无法通讯,kubectl proxy 无法正常访问(通常表现为 pod 运行正常,但提示连接拒绝)。以 flannel 为例,首先安装 flannel。
this means that the api server cannot be connected. could be caused by a number of things (including firewall).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
root@k8s-master-1:~# service docker status ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2022-06-08 16:30:32 UTC; 34min ago TriggeredBy: ● docker.socket Docs: https://docs.docker.com Main PID: 1039 (dockerd) Tasks: 23 Memory: 134.1M CGroup: /system.slice/docker.service └─1039 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Jun 08 17:04:52 k8s-master-1 dockerd[1039]: time="2022-06-08T17:04:52.874831490Z" level=error msg="Handler for POST /v1.40/images/create returned error: Get \"https://k8s.gcr.io/v2/\": context deadline exceeded" Jun 08 17:04:58 k8s-master-1 dockerd[1039]: time="2022-06-08T17:04:58.867350258Z" level=warning msg="Error getting v2 registry: Get \"https://k8s.gcr.io/v2/\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)" ...
设置 --image-repository可以拉下来镜像,但还是会在启动 control plane 时超时。
1 2
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s [kubelet-check] Initial timeout of 40s passed.