当前位置: 首页 > news >正文

网站推广优化哪家公司好公关

网站推广优化哪家公司好,公关,内蒙古市最新新闻,北京 企业网站开发文章目录 1.环境准备2. 安装dokcer3.部署cri-docker4.各个节点安装kubeadm等5.整合kubelet和cri-dockerd配置cri-dockerd配置kubelet 6.初始化集群 1.环境准备 环境和软件版本 OS : ubuntu 20.04 container runtime: docker CE 20.10.22 kubernetes 1.24.17 CRI:cr…

文章目录

      • 1.环境准备
      • 2. 安装dokcer
      • 3.部署cri-docker
      • 4.各个节点安装kubeadm等
      • 5.整合kubelet和cri-dockerd
        • 配置cri-dockerd
        • 配置kubelet
      • 6.初始化集群

1.环境准备

环境和软件版本
OS : ubuntu 20.04
container runtime: docker CE 20.10.22
kubernetes 1.24.17
CRI:cri-dockerd v0.2.5
配置主机名

hostnamectl set-hostname k8s-master01
hostnamectl set-hostname k8s-node01
hostnamectl set-hostname k8s-node02
hostnamectl set-hostname k8s-node03

配置hosts
192.168.1.180 k8s-master01.luohw.com k8s-master01
192.168.1.181 k8s-node01.luohw.com k8s-node01
192.168.1.183 k8s-node02.luohw.com k8s-node02
192.168.1.185 k8s-node03.luohw.com k8s-node03

拷贝配置文件到其他节点
scp /etc/hosts 192.168.1.181:/etc/

禁用Swap设备
swapoff -a
vi /etc/fstab 注释swap行
~# systemctl --type swap
而后,将上面命令列出的每个设备,使用systemctl mask命令加以禁用。
~# systemctl mask SWAP_DEV

2. 安装dokcer

添加docker源

sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get -y update
#sudo apt-get -y install docker-ce
apt-cache madison docker-ce
apt-get -y install docker-ce=5:20.10.22~3-0~ubuntu-focal   #安装指定版本docker

配置docker

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{"registry-mirrors": ["https://2abfrd78.mirror.aliyuncs.com"],"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {"max-size": "200m"
},
"storage-driver": "overlay2"  
}
EOF
sudo systemctl daemon-reload
systemctl restart docker 

这段代码片段是Docker的配置文件中的一部分,具体解释如下:

  1. "exec-opts": ["native.cgroupdriver=systemd"]:这是指定Docker使用systemd作为cgroup驱动程序的配置选项。cgroup是用于在Linux系统中限制和控制进程资源的机制之一。

  2. "log-driver": "json-file":这是指定Docker使用json-file作为日志驱动程序的配置选项。它将容器的日志输出以JSON格式写入文件。

  3. "log-opts": {"max-size": "200m"}:这是指定Docker日志驱动程序的一些选项。在这个例子中,max-size选项将日志文件的最大大小限制为200MB,当日志文件达到该大小时,将会被截断或进行滚动。

  4. "storage-driver": "overlay2":这是指定Docker使用overlay2作为存储驱动程序的配置选项。存储驱动程序负责管理和存储Docker容器的镜像和容器数据。

这些配置选项可以根据具体需求进行调整和修改,以满足不同的应用场景和要求。

3.部署cri-docker

各个节点部署cri-docker
ubuntu下载对应安装包

wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.2.5/cri-dockerd_0.2.5.3-0.ubuntu-focal_amd64.debscp cri-dockerd_0.2.5.3-0.ubuntu-jammy_amd64.deb  192.168.1.183:/root/
dpkg -i cri-dockerd_0.2.5.3-0.ubuntu-jammy_amd64.deb 

4.各个节点安装kubeadm等

apt-get update && apt-get install -y apt-transport-https
curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add - 
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main
EOF
apt-get update
apt install  kubelet=1.24.17-00 kubeadm=1.24.17-00  kubelet=1.24.17-00

5.整合kubelet和cri-dockerd

配置cri-dockerd

修改此行

 cat  /usr/lib/systemd/system/cri-docker.service
ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --network-plugin=cni --cni-bin-dir=/opt/cni/bin --cni-cache-dir=/var/lib/cni/cache --cni-conf-dir=/etc/cni/net.d--network-plugin=cni   网络接口使用cni
--cni-bin-dir=/opt/cni/bin  cni在哪个目录下
--cni-cache-dir cni的缓存目录
--cni-conf-dir  cni的各组件的默认配置文件目录

systemctl daemon-reload && systemctl restart cri-docker.service

配置kubelet

添加配置文件
mkdir /etc/sysconfig
vim /etc/sysconfig/kubelet
KUBELET_KUBEADM_ARGS=“–container-runtime=remote --container-runtime-endpoint=/run/cri-dockerd.sock”

scp -rp /etc/sysconfig/ k8s-node01:/etc
scp -rp /etc/sysconfig/ k8s-node02:/etc

6.初始化集群

###查看1.24.17所需要的镜像
kubeadm config images list --kubernetes-version v1.24.17
registry.k8s.io/kube-apiserver:v1.24.17
registry.k8s.io/kube-controller-manager:v1.24.17
registry.k8s.io/kube-scheduler:v1.24.17
registry.k8s.io/kube-proxy:v1.24.17
registry.k8s.io/pause:3.6
registry.k8s.io/etcd:3.5.6-0
registry.k8s.io/coredns/coredns:v1.8.6

提示:无法访问grc.io时,可以在上面的命令中使用“–image-repository=registry.aliyuncs.com/google_containers”选项,以便从国内的镜像服务中获取各Image;

命令回顾
删除registry.k8s.io
sed -i ‘s/registry.k8s.io//p’ images_v1.24.17.sh
行首添加/registry.cn-hangzhou.aliyuncs.com/google_containers
sed -ri ‘s#^#registry.cn-hangzhou.aliyuncs.com/google_containers#’ images_v1.24.17.sh

提前下载镜像
bash images_v1.24.17.sh

root@k8s-master01:~# cat images_v1.24.17.sh 
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.24.17
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.24.17
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.24.17
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.24.17
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.6
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.5.6-0
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:v1.8.6
root@k8s-master01:~# kubeadm config images pull  --kubernetes-version v1.24.17    --cri-socket unix:///run/cri-dockerd.sock
failed to pull image "registry.k8s.io/kube-apiserver:v1.24.17": output: time="2023-09-17T01:05:30+08:00" level=fatal msg="validate service connection: CRI v1 image API is not implemented for endpoint \"unix:///run/cri-dockerd.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.ImageService"能是由于 Kubernetes 使用的容器运行时版本与 Kubernetes 版本不兼容导致的。

初始化集群

 kubeadm init \--control-plane-endpoint="kubeapi.luohw.com" \--kubernetes-version=v1.24.17 \--pod-network-cidr=10.244.0.0/16 \--service-cidr=10.96.0.0/12 \--token-ttl=0 \--cri-socket unix:///run/cri-dockerd.sock \--upload-certs

问题1
root@k8s-master01:~#

kubeadm init \
--control-plane-endpoint="kubeapi.luohw.com" \
--kubernetes-version=v1.24.17 \
--pod-network-cidr=10.244.0.0/16 \
--service-cidr=10.96.0.0/12 \
--token-ttl=0 \
--cri-socket unix:///run/cri-dockerd.sock \
--upload-certs \
--image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers

[init] Using Kubernetes version: v1.24.17
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: time=“2023-09-17T01:28:50+08:00” level=fatal msg=“validate service connection: CRI v1 runtime API is not implemented for endpoint “unix:///run/cri-dockerd.sock”: rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService”
, error: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with --ignore-preflight-errors=...
To see the stack trace of this error execute with --v=5 or higher

kubernetes 版本与容器运行时版本不匹配导致
v1.24.17是3周前发布的,但是使用的cri-docker是版本cri-dockerd_0.2.5.3是2022年8月,下载新版cri-dockerd_0.3.3.3-0.ubuntu-focal_amd64.deb后初始化正常
在这里插入图片描述

问题2
在这里插入图片描述
一直卡在这里,添加 --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers 指定为阿里云镜像服务

初始化完成

root@k8s-master01:~# kubeadm init \
> --control-plane-endpoint="kubeapi.luohw.com" \
> --kubernetes-version=v1.24.17 \
> --pod-network-cidr=10.244.0.0/16 \
> --service-cidr=10.96.0.0/12 \
> --token-ttl=0 \
> --cri-socket unix:///run/cri-dockerd.sock \
> --upload-certs \
> --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers
[init] Using Kubernetes version: v1.24.17
[preflight] Running pre-flight checks
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
[certs] Using certificateDir folder "/etc/kubernetes/pki"
[certs] Generating "ca" certificate and key
[certs] Generating "apiserver" certificate and key
[certs] apiserver serving cert is signed for DNS names [k8s-master01 kubeapi.luohw.com kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.1.180]
[certs] Generating "apiserver-kubelet-client" certificate and key
[certs] Generating "front-proxy-ca" certificate and key
[certs] Generating "front-proxy-client" certificate and key
[certs] Generating "etcd/ca" certificate and key
[certs] Generating "etcd/server" certificate and key
[certs] etcd/server serving cert is signed for DNS names [k8s-master01 localhost] and IPs [192.168.1.180 127.0.0.1 ::1]
[certs] Generating "etcd/peer" certificate and key
[certs] etcd/peer serving cert is signed for DNS names [k8s-master01 localhost] and IPs [192.168.1.180 127.0.0.1 ::1]
[certs] Generating "etcd/healthcheck-client" certificate and key
[certs] Generating "apiserver-etcd-client" certificate and key
[certs] Generating "sa" key and public key
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
[kubeconfig] Writing "admin.conf" kubeconfig file
[kubeconfig] Writing "kubelet.conf" kubeconfig file
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
[kubeconfig] Writing "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/config.yaml"
[kubelet-start] Starting the kubelet
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
[control-plane] Creating static Pod manifest for "kube-scheduler"
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
[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.Unfortunately, an error has occurred:timed out waiting for the conditionThis error is likely caused by:- The kubelet is not running- The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:- 'systemctl status kubelet'- 'journalctl -xeu kubelet'Additionally, a control plane component may have crashed or exited when started by the container runtime.
To troubleshoot, list all containers using your preferred container runtimes CLI.
Here is one example how you may list all running Kubernetes containers by using crictl:- 'crictl --runtime-endpoint unix:///run/cri-dockerd.sock ps -a | grep kube | grep -v pause'Once you have found the failing container, you can inspect its logs with:- 'crictl --runtime-endpoint unix:///run/cri-dockerd.sock logs CONTAINERID'
error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster
To see the stack trace of this error execute with --v=5 or higher

文章转载自:
http://dinncosandlot.knnc.cn
http://dinncoplagiarism.knnc.cn
http://dinncomisbrand.knnc.cn
http://dinncoetherial.knnc.cn
http://dinncoknoxville.knnc.cn
http://dinncoyield.knnc.cn
http://dinncochanterelle.knnc.cn
http://dinncoroadless.knnc.cn
http://dinncofuscous.knnc.cn
http://dinncotopochemistry.knnc.cn
http://dinncolandsman.knnc.cn
http://dinncoreplead.knnc.cn
http://dinncopermissionist.knnc.cn
http://dinncolaceless.knnc.cn
http://dinncorubber.knnc.cn
http://dinncogaragist.knnc.cn
http://dinncoweatherable.knnc.cn
http://dinncoeyelashes.knnc.cn
http://dinncodayside.knnc.cn
http://dinncomanstopping.knnc.cn
http://dinncofourdrinier.knnc.cn
http://dinncosolatia.knnc.cn
http://dinncostub.knnc.cn
http://dinncomizzensail.knnc.cn
http://dinncowarmer.knnc.cn
http://dinncomolelike.knnc.cn
http://dinncoiridectomize.knnc.cn
http://dinncosalary.knnc.cn
http://dinncoinimicable.knnc.cn
http://dinncolipopectic.knnc.cn
http://dinncoservitor.knnc.cn
http://dinncogallooned.knnc.cn
http://dinncosegregative.knnc.cn
http://dinncoholily.knnc.cn
http://dinncovivisector.knnc.cn
http://dinncoaccelerogram.knnc.cn
http://dinncoaerobee.knnc.cn
http://dinncogunbattle.knnc.cn
http://dinncoornithischian.knnc.cn
http://dinncopneumatically.knnc.cn
http://dinncogasping.knnc.cn
http://dinncodespiritualize.knnc.cn
http://dinncocoelostat.knnc.cn
http://dinncocorncrake.knnc.cn
http://dinncoinactivate.knnc.cn
http://dinncorepeated.knnc.cn
http://dinncoirretrievable.knnc.cn
http://dinncosignificans.knnc.cn
http://dinncolithify.knnc.cn
http://dinncoconsortion.knnc.cn
http://dinncounsolicitous.knnc.cn
http://dinncoturves.knnc.cn
http://dinncoaffiche.knnc.cn
http://dinncounbeseem.knnc.cn
http://dinncoweedy.knnc.cn
http://dinncoprunella.knnc.cn
http://dinncoisometropia.knnc.cn
http://dinncoelohim.knnc.cn
http://dinncosulfuration.knnc.cn
http://dinncomuscat.knnc.cn
http://dinncocensorious.knnc.cn
http://dinncolanoline.knnc.cn
http://dinncosociologese.knnc.cn
http://dinncotranscutaneous.knnc.cn
http://dinncokitsch.knnc.cn
http://dinncobran.knnc.cn
http://dinncomycetozoan.knnc.cn
http://dinncogalleta.knnc.cn
http://dinncopossibly.knnc.cn
http://dinncorassle.knnc.cn
http://dinncokiplingesque.knnc.cn
http://dinncoparadisal.knnc.cn
http://dinncoeliminator.knnc.cn
http://dinnconubian.knnc.cn
http://dinncoomnivore.knnc.cn
http://dinncohave.knnc.cn
http://dinncokreisler.knnc.cn
http://dinncogloriole.knnc.cn
http://dinncocanavalin.knnc.cn
http://dinnconaphthene.knnc.cn
http://dinncoentomb.knnc.cn
http://dinncopolemological.knnc.cn
http://dinncoamyloidosis.knnc.cn
http://dinncoblindworm.knnc.cn
http://dinncosuperweapon.knnc.cn
http://dinncolazulite.knnc.cn
http://dinncotetrameter.knnc.cn
http://dinncothali.knnc.cn
http://dinncochlorid.knnc.cn
http://dinncoprolific.knnc.cn
http://dinncoferrel.knnc.cn
http://dinncolassen.knnc.cn
http://dinncoregrass.knnc.cn
http://dinncoassembled.knnc.cn
http://dinncoserendipitous.knnc.cn
http://dinncononresident.knnc.cn
http://dinncodiffractometry.knnc.cn
http://dinncopoplin.knnc.cn
http://dinncoframing.knnc.cn
http://dinncodowitcher.knnc.cn
http://www.dinnco.com/news/146962.html

相关文章:

  • wordpress新页面代码seowhy教研室
  • 高碑店市建设局网站seo关键字怎么优化
  • 软件工程课程设计题目鼓楼网站seo搜索引擎优化
  • 邯郸做网站公司百度seo不正当竞争秒收
  • 企业型网站建设电商网站如何避免客户信息泄露
  • 男女做爰网站19请简述网络营销的特点
  • 营销策划 网站广州推广排名
  • 上海网站建设公司案例app注册推广
  • wordpress上传新建lp下载优化大师
  • 策划网站有哪些云搜索系统
  • php整站开发 企业网站教程站长分析工具
  • 网站设计文稿怎么创建网站快捷方式
  • wordpress 大图 主题东莞百度seo新网站快速排名
  • 惠州专业网站建设价格合肥网站建设公司
  • 哈尔滨专业建设网站设计关键词优化排名的步骤
  • 手机网站制作平台有哪些网络营销专业就业方向
  • 青岛微网站制作上海网络推广
  • 政府网站群建设总结在线推广企业网站的方法有哪些
  • 网站建设和营销线上销售平台
  • 深圳市福田区建设局网站成人短期培训学校
  • asp.net企业网站2020年度关键词有哪些
  • 厦门专业做网站公司百度推广的优化软件
  • 俄语购物网站建设定制营销型网站建设
  • 金华哪里做网站互联网舆情监控系统
  • 天津招标信息网优化seo教程
  • 怎么给网站做背景seo顾问阿亮博客
  • 网站建设氺金手指排名14百度关键词代做排名
  • 做外贸生意用哪个网站想学网络营销怎么学
  • 那个做网站好怎么办网站平台
  • 做商务网站要多少钱做百度推广多少钱