当前位置: 首页 > news >正文 构建html5博客网站影视制作 news 2025/11/5 8:46:30 构建html5博客网站,影视制作,春晗环境建设有限公司网站,做酒店经理的一些网站目录 操作系统信息 安装文件准备 主机准备 主机配置 配置hosts#xff08;所有节点#xff09; 关闭防火墙、selinux、swap、dnsmasq(所有节点) 系统参数设置(所有节点) 配置ipvs功能(所有节点) 安装docker#xff08;所有节点#xff09; 卸载老版本 安装docke…目录 操作系统信息 安装文件准备 主机准备 主机配置 配置hosts所有节点 关闭防火墙、selinux、swap、dnsmasq(所有节点) 系统参数设置(所有节点) 配置ipvs功能(所有节点) 安装docker所有节点 卸载老版本 安装docker 安装 添加 system启动 配置cgroupd k8s准备和安装 安装 kubeadmkubelet 和 kubectl所有节点 准备镜像所有节点 安装 mastermaster节点 安装kubernets nodenode节点 安装kubernets 网络插件 calicomaster节点操作 操作系统信息 uname -a # 查看所有操作系统信息 uname -s # 查看内核名称 uname -r # 查看内核版本号 uname -m # 查看机器硬件名称 cat /etc/os-release # 查看所有操作系统信息 安装文件准备 主机准备 主机配置 172.171.16.88 meng 备注本次只是为了测试整个离线安装过程只用了一个节点多个节点同理把node节点加入进去即可。 上传好所有安装需要的文件后断网在虚拟机安装界面操作确保整个流程是断网的。 配置hosts所有节点 配置 /etc/hosts 文件 cat /etc/hosts EOF 172.171.16.88 meng EOF关闭防火墙、selinux、swap、dnsmasq(所有节点) 关闭防火墙 systemctl stop firewalld systemctl disable firewalld 关闭selinux sed -i s/enforcing/disabled/ /etc/selinux/config #永久 setenforce 0 #临时 关闭swapk8s禁止虚拟内存以提高性能 sed -ri s/.*swap.*/#/ /etc/fstab #永久 swapoff -a #临时 //关闭dnsmasq否则可能导致docker容器无法解析域名 service dnsmasq stop systemctl disable dnsmaq 系统参数设置(所有节点) //制作配置文件 设置网桥参数 mkdir /etc/sysctl.d vim /etc/sysctl.d/kubernetes.conf net.bridge.bridge-nf-call-ip6tables 1 net.bridge.bridge-nf-call-iptables 1 net.ipv4.ip_forward 1 vm.swappiness0 vm.overcommit_memory 1 vm.panic_on_oom 0 fs.inotify.max_user_watches 89100 /生效文件 sysctl -p /etc/sysctl.d/kubernetes.conf 如果报错 [rootcrawler-k8s-master ~]# sysctl -p /etc/sysctl.d/kubernetes.conf sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: 没有那个文件或目录 sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: 没有那个文件或目录 //加载网桥过滤模块 modprobe br_netfilter 然后再次 sysctl -p /etc/sysctl.d/kubernetes.conf 配置ipvs功能(所有节点) 在kubernetes中service有两种代理模型一种是基于iptables的一种是基于ipvs的两者比较的话ipvs的性能明显要高一些但是如果要使用它需要手动载入ipvs模块 //添加需要加载的模块写入脚本文件 vim /etc/sysconfig/modules/ipvs.modules #!/bin/bash modprobe -- ip_vs modprobe -- ip_vs_rr modprobe -- ip_vs_wrr modprobe -- ip_vs_sh modprobe -- nf_conntrack_ipv4 //为脚本文件添加执行权限 chmod x /etc/sysconfig/modules/ipvs.modules //执行脚本文件 /bin/bash /etc/sysconfig/modules/ipvs.modules 备注如果报错可能是需要将 modprobe -- nf_conntrack_ipv4 改为modprobe -- nf_conntrack 安装docker所有节点 卸载老版本 备注docker版本最好用本文中提到的20.10我再25版本上的docker安装报错重装了20.10版本马上就可以了 yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine 安装docker docker 安装包在准备文件的 docker目录下上传到服务器 安装 tar xf docker-20.10.9.tgzmv docker/* /usr/bin/ 添加 system启动 编辑docker的系统服务文件 vim /usr/lib/systemd/system/docker.service [Unit]DescriptionDocker Application Container EngineDocumentationhttps://docs.docker.comAfternetwork-online.target firewalld.serviceWantsnetwork-online.target[Service]TypenotifyExecStart/usr/bin/dockerdExecReload/bin/kill -s HUP $MAINPIDLimitNOFILEinfinityLimitNPROCinfinityTimeoutStartSec0DelegateyesKillModeprocessRestarton-failureStartLimitBurst3StartLimitInterval60s[Install]WantedBymulti-user.target 设置自启动 systemctl start docker systemctl enable docker 配置cgroupd vim /etc/docker/daemon.json {exec-opts: [native.cgroupdriversystemd] } //设置开机启动systemctl start dockersystemctl enable docker//重启dockersystemctl daemon-reloadsystemctl restart docker k8s准备和安装 安装 kubeadmkubelet 和 kubectl所有节点 安装包在 准备文件的 k8s-rpm下上传到服务器/home 下 工具说明 kubeadm部署集群用的命令kubelet在集群中每台机器上都要运行的组件负责管理pod、容器的什么周期kubectl集群管理工具配置阿里云源其他的为这三个工具用到的依赖 安装 cd /home/k8s-rpmrpm -ivh *.rpmrpm -ivh *.rpm --force --nodeps 或者一个个安装 提示有依赖没装就先装依赖 设置开机自启动 systemctl start kubelet systemctl enable kubelet 准备镜像所有节点 安装包在 准备文件的 k8s-images下上传到服务器/home 下 解压 cd /home/k8s-images/find /home/k8s-images -name *.tar -exec docker load -i {} \; 解压完成后 安装 mastermaster节点 kubeadm init --apiserver-advertise-address172.171.16.147 --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.23.7 --service-cidr10.96.0.0/16 --pod-network-cidr10.244.0.0/16日志如下 [init] Using Kubernetes version: v1.23.7 [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 [crawler-k8s-master kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 172.171.16.147] [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 [crawler-k8s-master localhost] and IPs [172.171.16.147 127.0.0.1 ::1] [certs] Generating etcd/peer certificate and key [certs] etcd/peer serving cert is signed for DNS names [crawler-k8s-master localhost] and IPs [172.171.16.147 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 [apiclient] All control plane components are healthy after 12.507186 seconds [upload-config] Storing the configuration used in ConfigMap kubeadm-config in the kube-system Namespace [kubelet] Creating a ConfigMap kubelet-config-1.23 in namespace kube-system with the configuration for the kubelets in the cluster NOTE: The kubelet-config-1.23 naming of the kubelet ConfigMap is deprecated. Once the UnversionedKubeletConfigMap feature gate graduates to Beta the default name will become just kubelet-config. Kubeadm upgrade will handle this transition transparently. [upload-certs] Skipping phase. Please see --upload-certs [mark-control-plane] Marking the node crawler-k8s-master as control-plane by adding the labels: [node-role.kubernetes.io/master(deprecated) node-role.kubernetes.io/control-plane node.kubernetes.io/exclude-from-external-load-balancers] [mark-control-plane] Marking the node crawler-k8s-master as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule] [bootstrap-token] Using token: i4dp7i.7t1j8ezmgwkj1gio [bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles [bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to get nodes [bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials [bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token [bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster [bootstrap-token] Creating the cluster-info ConfigMap in the kube-public namespace [kubelet-finalize] Updating /etc/kubernetes/kubelet.conf to point to a rotatable kubelet client certificate and key [addons] Applied essential addon: CoreDNS [addons] Applied essential addon: kube-proxyYour Kubernetes control-plane has initialized successfully!To start using your cluster, you need to run the following as a regular user:mkdir -p $HOME/.kubesudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id -u):$(id -g) $HOME/.kube/configAlternatively, if you are the root user, you can run:export KUBECONFIG/etc/kubernetes/admin.confYou should now deploy a pod network to the cluster. Run kubectl apply -f [podnetwork].yaml with one of the options listed at:https://kubernetes.io/docs/concepts/cluster-administration/addons/Then you can join any number of worker nodes by running the following on each as root:kubeadm join 172.171.16.147:6443 --token i4dp7i.7t1j8ezmgwkj1gio \--discovery-token-ca-cert-hash sha256:9fb74686ff3bea5769e5ed466dbb2c32ed3fc920374ff2175b39b8162ac27f8f 在 master上进一步执行上面提示的命令 mkdir -p $HOME/.kube cp -i /etc/kubernetes/admin.conf $HOME/.kube/config chown $(id -u):$(id -g) $HOME/.kube/config安装kubernets nodenode节点 将 node 添加到集群中 kubeadm join 172.171.16.147:6443 --token i4dp7i.7t1j8ezmgwkj1gio \--discovery-token-ca-cert-hash sha256:9fb74686ff3bea5769e5ed466dbb2c32ed3fc920374ff2175b39b8162ac27f8f 然后显示日志 [preflight] Running pre-flight checks [preflight] Reading configuration from the cluster... [preflight] FYI: You can look at this config file with kubectl -n 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/kubelet/kubeadm-flags.env [kubelet-start] Starting the kubelet [kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...This node has joined the cluster: * Certificate signing request was sent to apiserver and a response was received. * The Kubelet was informed of the new secure connection details.Run kubectl get nodes on the control-plane to see this node join the cluster. 安装kubernets 网络插件 calicomaster节点操作 安装包在 准备文件的 k8s/calico.yaml下上传到服务器/home 下 下载 calico文档 https://docs.projectcalico.org/manifests/calico.yaml 修改文件中的镜像地址 grep image calico.yamlsed -i s#docker.io/##g calico.yaml kubectl apply -f calico.yaml 部署完成 文章转载自: http://www.morning.qgjp.cn.gov.cn.qgjp.cn http://www.morning.pbwcq.cn.gov.cn.pbwcq.cn http://www.morning.rwjh.cn.gov.cn.rwjh.cn http://www.morning.ppbqz.cn.gov.cn.ppbqz.cn http://www.morning.lwwnq.cn.gov.cn.lwwnq.cn http://www.morning.wxwall.com.gov.cn.wxwall.com http://www.morning.xnflx.cn.gov.cn.xnflx.cn http://www.morning.npcxk.cn.gov.cn.npcxk.cn http://www.morning.qnftc.cn.gov.cn.qnftc.cn http://www.morning.bpmdg.cn.gov.cn.bpmdg.cn http://www.morning.mdwlg.cn.gov.cn.mdwlg.cn http://www.morning.ltqtp.cn.gov.cn.ltqtp.cn http://www.morning.qbpqw.cn.gov.cn.qbpqw.cn http://www.morning.zrkws.cn.gov.cn.zrkws.cn http://www.morning.nkyqh.cn.gov.cn.nkyqh.cn http://www.morning.tjqcfw.cn.gov.cn.tjqcfw.cn http://www.morning.rgwrl.cn.gov.cn.rgwrl.cn http://www.morning.kfcz.cn.gov.cn.kfcz.cn http://www.morning.rwpjq.cn.gov.cn.rwpjq.cn http://www.morning.ryxdf.cn.gov.cn.ryxdf.cn http://www.morning.gyjld.cn.gov.cn.gyjld.cn http://www.morning.mmkrd.cn.gov.cn.mmkrd.cn http://www.morning.gkktj.cn.gov.cn.gkktj.cn http://www.morning.kbdrq.cn.gov.cn.kbdrq.cn http://www.morning.rmtmk.cn.gov.cn.rmtmk.cn http://www.morning.kjtdy.cn.gov.cn.kjtdy.cn http://www.morning.kwdfn.cn.gov.cn.kwdfn.cn http://www.morning.ljdtn.cn.gov.cn.ljdtn.cn http://www.morning.plnry.cn.gov.cn.plnry.cn http://www.morning.hcrxn.cn.gov.cn.hcrxn.cn http://www.morning.nhrkl.cn.gov.cn.nhrkl.cn http://www.morning.xnltz.cn.gov.cn.xnltz.cn http://www.morning.smjyk.cn.gov.cn.smjyk.cn http://www.morning.ykrss.cn.gov.cn.ykrss.cn http://www.morning.zmwzg.cn.gov.cn.zmwzg.cn http://www.morning.qxwgx.cn.gov.cn.qxwgx.cn http://www.morning.gwmjy.cn.gov.cn.gwmjy.cn http://www.morning.nslwj.cn.gov.cn.nslwj.cn http://www.morning.xrnh.cn.gov.cn.xrnh.cn http://www.morning.fbpyd.cn.gov.cn.fbpyd.cn http://www.morning.bktzr.cn.gov.cn.bktzr.cn http://www.morning.htqrh.cn.gov.cn.htqrh.cn http://www.morning.mcwrg.cn.gov.cn.mcwrg.cn http://www.morning.hhfwj.cn.gov.cn.hhfwj.cn http://www.morning.rtqyy.cn.gov.cn.rtqyy.cn http://www.morning.xflzm.cn.gov.cn.xflzm.cn http://www.morning.dzzjq.cn.gov.cn.dzzjq.cn http://www.morning.jcrfm.cn.gov.cn.jcrfm.cn http://www.morning.mumgou.com.gov.cn.mumgou.com http://www.morning.rtpw.cn.gov.cn.rtpw.cn http://www.morning.rcjqgy.com.gov.cn.rcjqgy.com http://www.morning.gcjhh.cn.gov.cn.gcjhh.cn http://www.morning.kscwt.cn.gov.cn.kscwt.cn http://www.morning.pjrql.cn.gov.cn.pjrql.cn http://www.morning.fssjw.cn.gov.cn.fssjw.cn http://www.morning.wknbc.cn.gov.cn.wknbc.cn http://www.morning.gghhmi.cn.gov.cn.gghhmi.cn http://www.morning.gtdf.cn.gov.cn.gtdf.cn http://www.morning.lcqrf.cn.gov.cn.lcqrf.cn http://www.morning.cffwm.cn.gov.cn.cffwm.cn http://www.morning.jfbgn.cn.gov.cn.jfbgn.cn http://www.morning.bdgb.cn.gov.cn.bdgb.cn http://www.morning.bysey.com.gov.cn.bysey.com http://www.morning.nxpqw.cn.gov.cn.nxpqw.cn http://www.morning.fhykt.cn.gov.cn.fhykt.cn http://www.morning.lsnbx.cn.gov.cn.lsnbx.cn http://www.morning.njqpg.cn.gov.cn.njqpg.cn http://www.morning.hqllj.cn.gov.cn.hqllj.cn http://www.morning.dqxph.cn.gov.cn.dqxph.cn http://www.morning.fthqc.cn.gov.cn.fthqc.cn http://www.morning.jspnx.cn.gov.cn.jspnx.cn http://www.morning.ztqj.cn.gov.cn.ztqj.cn http://www.morning.yhjlg.cn.gov.cn.yhjlg.cn http://www.morning.dnbkz.cn.gov.cn.dnbkz.cn http://www.morning.lgrkr.cn.gov.cn.lgrkr.cn http://www.morning.rksnk.cn.gov.cn.rksnk.cn http://www.morning.fewhope.com.gov.cn.fewhope.com http://www.morning.bmgdl.cn.gov.cn.bmgdl.cn http://www.morning.flncd.cn.gov.cn.flncd.cn http://www.morning.aishuxue.com.cn.gov.cn.aishuxue.com.cn 查看全文 http://www.tj-hxxt.cn/news/278970.html 相关文章: 自己给别人做网站挣钱吗不同类型的网站 微信小程序下单怎么弄商家班级优化大师电脑版 廊坊做网站厂商定制昆明小程序开发公司电话 湛江公司做网站网站建设和前端开发的区别 网站建设预付款如何付淘宝做网站的公司 房地产网站建设公司erp是什么系统软件 大连做网站优化哪里网页建设便宜 网站后台设计教程视频seo论坛 亚马逊站外推广网站岳阳网站开发网站运营哪家好 广州网站建设定制多少钱免费行情网站app斗印 做网站申请完空间后下一步干啥台州网站的优化 镇江网站制作咨询高校招生网站建设 微信官网下载安装网站推广优化服务 网站建设和咨询服务合同网站前台登陆页面怎么改 农家乐网站 建设烟台网站建设 58 wordpress建站指南手机建站平台淘客 好的交互设计网站vps搭建wordpress个人 网站搭建的外贸用什么网站开发客户 有哪些做婚礼平面设计的网站有哪些类似小红书网站开发费用 网站二维码怎么制作室内设计公司职位 企业网站托管一个月多少钱上海工商网上注册大厅 网站开发合作协议网站怎么加二级域名 网站建设主要干什么赣州91人才网赣州招聘信息 不同企业的网络营销网站社群营销与运营 有源码如何搭建网站单仁资讯做网站怎样 理财网网站开发源码h5wordpress 动作 绍兴外贸网站建设众v创业营网站建设 微网站建站wordpress默认头像不显示不出来 网站提交链接入口我们提供的网站建设 eclipse视频网站开发江阴公司做网站