Upgrading kubeadm clusters from v1.27.3 to v1.27.4

文章目录

    • 1. Before you begin
    • 2. Notes
    • 3. Master
      • 3.1 Login into the first node and upgrade the kubeadm tool only
      • 3.2 Verify the upgrade plan
      • 3.3 Drain the control plane node
      • 3.4 kubeadm upgrade
      • 3.5 Uncordon the control plane node
      • 3.6 Upgrade kubelet and kubectl
      • 3.7 Apply the upgrade plan to the other master nodes
    • 4. Worker
      • 4.1 Upgrade kubeadm on first worker node
      • 4.2 Login to a master node and drain first worker node
      • 4.3 Upgrade kubelet config on worker node
      • 4.4 Upgrade kubelet and kubectl
      • 4.5 Uncordon the worker node
    • 4.6 Check cluster

刚刚 kubernetes release 升级到 v1.27.4 了。相关 v1.27.4 升级内容请参考在这里,迫不及待想升级一下。
在这里插入图片描述

1. Before you begin

  • 快照
  • 业务应用备份数据

准备要升级的kubernetes 集群信息:

$ kubectl get node
NAME            STATUS     ROLES           AGE   VERSION
kube-master01   Ready   control-plane   42h   v1.27.3
kube-node01     Ready   <none>          42h   v1.27.3
kube-prom01     Ready   <none>          42h   v1.27.3

2. Notes

  • 如果您正在为任何kubelet执行次要版本升级,则必须首先清空您正在升级的节点(或多个节点)。在控制平面节点,它们可能正在运行CoreDNS Pod或其他关键工作负载。有关详细信息,请参见 Draining nodes。
  • 升级后所有容器都将重新启动,因为容器规范散列值已更改。
  • 要验证kubelet服务在kubelet升级后是否成功重启,可以执行systemctl status kubelet,或者使用journalctl -xeu kubelet查看服务日志。
  • 建议不要使用kubeadm upgrade--config标志和kubeadm configuration API类型来重新配置集群,这可能会导致意外结果。请按照重新配置kubeadm集群中的步骤操作

3. Master

3.1 Login into the first node and upgrade the kubeadm tool only

$dnf list kubeadm kubelet kubectl --showduplicates | sort -r |grep 1.27.4
kubelet.x86_64                       1.27.4-0                        kubernetes 
kubectl.x86_64                       1.27.4-0                        kubernetes 
kubeadm.x86_64                       1.27.4-0                        kubernetes 

$ dnf check-update kubeadm kubectl kubelet
Last metadata expiration check: 2:04:02 ago on Thu 20 Jul 2023 09:34:52 AM CST.

kubeadm.x86_64                                                                                  1.27.4-0                                                                                  kubernetes
kubectl.x86_64                                                                                  1.27.4-0                                                                                  kubernetes
kubelet.x86_64                                                                                  1.27.4-0                                                                                  kubernetes

$ dnf update -y kubeadm

输出:

[root@kube-prom01 ~]# dnf update -y kubeadm-1.27.4-0
Last metadata expiration check: 1:16:03 ago on Thu 20 Jul 2023 11:14:46 AM CST.
Dependencies resolved.
====================================================================================================================================================================================================
 Package                                       Architecture                                 Version                                          Repository                                        Size
====================================================================================================================================================================================================
Upgrading:
 kubeadm                                       x86_64                                       1.27.4-0                                         kubernetes                                        11 M

Transaction Summary
====================================================================================================================================================================================================
Upgrade  1 Package

Total download size: 11 M
Downloading Packages:
e9bba51c897d8e465298724f44da6e457097f87aaac71b18fd6539b9e3503995-kubeadm-1.27.4-0.x86_64.rpm                                                                        9.2 MB/s |  11 MB     00:01    
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                               9.2 MB/s |  11 MB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                            1/1 
  Running scriptlet: kubeadm-1.27.4-0.x86_64                                                                                                                                                    1/1 
  Upgrading        : kubeadm-1.27.4-0.x86_64                                                                                                                                                    1/2 
  Cleanup          : kubeadm-1.27.3-0.x86_64                                                                                                                                                    2/2 
  Running scriptlet: kubeadm-1.27.3-0.x86_64                                                                                                                                                    2/2 
  Verifying        : kubeadm-1.27.4-0.x86_64                                                                                                                                                    1/2 
  Verifying        : kubeadm-1.27.3-0.x86_64                                                                                                                                                    2/2 

Upgraded:
  kubeadm-1.27.4-0.x86_64                                                                                                                                                                           

Complete!

$ kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.4", GitCommit:"fa3d7990104d7c1f16943a67f11b154b71f6a132", GitTreeState:"clean", BuildDate:"2023-07-19T12:19:40Z", GoVersion:"go1.20.6", Compiler:"gc", Platform:"linux/amd64"}

3.2 Verify the upgrade plan

此命令检查您的群集是否可以升级,并获取您可以升级到的版本。它还显示了一个包含组件配置版本状态的表。

[root@kube-master01 ~]# kubeadm upgrade plan
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[preflight] Running pre-flight checks.
[upgrade] Running cluster health checks
[upgrade] Fetching available versions to upgrade to
[upgrade/versions] Cluster version: v1.27.3
[upgrade/versions] kubeadm version: v1.27.4
[upgrade/versions] Target version: v1.27.4
[upgrade/versions] Latest version in the v1.27 series: v1.27.4

Components that must be upgraded manually after you have upgraded the control plane with 'kubeadm upgrade apply':
COMPONENT   CURRENT       TARGET
kubelet     3 x v1.27.3   v1.27.4

Upgrade to the latest version in the v1.27 series:

COMPONENT                 CURRENT   TARGET
kube-apiserver            v1.27.3   v1.27.4
kube-controller-manager   v1.27.3   v1.27.4
kube-scheduler            v1.27.3   v1.27.4
kube-proxy                v1.27.3   v1.27.4
CoreDNS                   v1.10.1   v1.10.1
etcd                      3.5.7-0   3.5.7-0

You can now apply the upgrade by executing the following command:

	kubeadm upgrade apply v1.27.4

_____________________________________________________________________


The table below shows the current state of component configs as understood by this version of kubeadm.
Configs that have a "yes" mark in the "MANUAL UPGRADE REQUIRED" column require manual config upgrade or
resetting to kubeadm defaults before a successful upgrade can be performed. The version to manually
upgrade to is denoted in the "PREFERRED VERSION" column.

API GROUP                 CURRENT VERSION   PREFERRED VERSION   MANUAL UPGRADE REQUIRED
kubeproxy.config.k8s.io   v1alpha1          v1alpha1            no
kubelet.config.k8s.io     v1beta1           v1beta1             no
_____________________________________________________________________

3.3 Drain the control plane node


$ kubectl drain kube-master01 --ignore-daemonsets --delete-emptydir-data
node/kube-master01 cordoned
Warning: ignoring DaemonSet-managed Pods: kube-system/kube-proxy-q87zt
evicting pod kube-system/coredns-5d78c9869d-lz7h6
evicting pod kube-system/coredns-5d78c9869d-lwvp5
pod/coredns-5d78c9869d-lwvp5 evicted
pod/coredns-5d78c9869d-lz7h6 evicted
node/kube-master01 drained

3.4 kubeadm upgrade

注意:kubeadm upgrade也会自动更新它在此节点上管理的证书。要选择退出证书更新,可以使用标志–certificate-renewal=false。有关详细信息,请参阅证书管理指南。

[root@kube-master01 ~]# kubeadm upgrade  apply v1.27.4
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[preflight] Running pre-flight checks.
[upgrade] Running cluster health checks
[upgrade/version] You have chosen to change the cluster version to "v1.27.4"
[upgrade/versions] Cluster version: v1.27.3
[upgrade/versions] kubeadm version: v1.27.4
[upgrade] Are you sure you want to proceed? [y/N]: y
[upgrade/prepull] Pulling images required for setting up a Kubernetes cluster
[upgrade/prepull] This might take a minute or two, depending on the speed of your internet connection
[upgrade/prepull] You can also perform this action in beforehand using 'kubeadm config images pull'
[upgrade/apply] Upgrading your Static Pod-hosted control plane to version "v1.27.4" (timeout: 5m0s)...
[upgrade/etcd] Upgrading to TLS for etcd
[upgrade/staticpods] Preparing for "etcd" upgrade
[upgrade/staticpods] Current and new manifests of etcd are equal, skipping upgrade
[upgrade/etcd] Waiting for etcd to become available
[upgrade/staticpods] Writing new Static Pod manifests to "/etc/kubernetes/tmp/kubeadm-upgraded-manifests4157307796"
[upgrade/staticpods] Preparing for "kube-apiserver" upgrade
[upgrade/staticpods] Renewing apiserver certificate
[upgrade/staticpods] Renewing apiserver-kubelet-client certificate
[upgrade/staticpods] Renewing front-proxy-client certificate
[upgrade/staticpods] Renewing apiserver-etcd-client certificate
[upgrade/staticpods] Moved new manifest to "/etc/kubernetes/manifests/kube-apiserver.yaml" and backed up old manifest to "/etc/kubernetes/tmp/kubeadm-backup-manifests-2023-07-20-12-04-33/kube-apiserver.yaml"
[upgrade/staticpods] Waiting for the kubelet to restart the component
[upgrade/staticpods] This might take a minute or longer depending on the component/version gap (timeout 5m0s)
[apiclient] Found 1 Pods for label selector component=kube-apiserver
[upgrade/staticpods] Component "kube-apiserver" upgraded successfully!
[upgrade/staticpods] Preparing for "kube-controller-manager" upgrade
[upgrade/staticpods] Renewing controller-manager.conf certificate
[upgrade/staticpods] Moved new manifest to "/etc/kubernetes/manifests/kube-controller-manager.yaml" and backed up old manifest to "/etc/kubernetes/tmp/kubeadm-backup-manifests-2023-07-20-12-04-33/kube-controller-manager.yaml"
[upgrade/staticpods] Waiting for the kubelet to restart the component
[upgrade/staticpods] This might take a minute or longer depending on the component/version gap (timeout 5m0s)
[apiclient] Found 1 Pods for label selector component=kube-controller-manager
[upgrade/staticpods] Component "kube-controller-manager" upgraded successfully!
[upgrade/staticpods] Preparing for "kube-scheduler" upgrade
[upgrade/staticpods] Renewing scheduler.conf certificate
[upgrade/staticpods] Moved new manifest to "/etc/kubernetes/manifests/kube-scheduler.yaml" and backed up old manifest to "/etc/kubernetes/tmp/kubeadm-backup-manifests-2023-07-20-12-04-33/kube-scheduler.yaml"
[upgrade/staticpods] Waiting for the kubelet to restart the component
[upgrade/staticpods] This might take a minute or longer depending on the component/version gap (timeout 5m0s)
[apiclient] Found 1 Pods for label selector component=kube-scheduler
[upgrade/staticpods] Component "kube-scheduler" upgraded successfully!
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
[kubelet] Creating a ConfigMap "kubelet-config" in namespace kube-system with the configuration for the kubelets in the cluster
[upgrade] Backing up kubelet config file to /etc/kubernetes/tmp/kubeadm-kubelet-config1926833644/config.yaml
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[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
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy

[upgrade/successful] SUCCESS! Your cluster was upgraded to "v1.27.4". Enjoy!

[upgrade/kubelet] Now that your control plane is upgraded, please proceed with upgrading your kubelets if you haven't already done so.

3.5 Uncordon the control plane node

$ kubectl uncordon kube-master01
node/kube-master01 uncordoned

3.6 Upgrade kubelet and kubectl

#centos、rocky、rhel:
dnf update -y kubelet-1.27.4-0 kubectl-1.27.4-0 --disableexcludes=kubernetes

#ubuntu:
$ apt-mark unhold kubelet kubectl && \
apt-get update && apt-get install -y kubelet=1.27.4-0 kubectl=1.27.4-0 && \
apt-mark hold kubelet kubectl

输出:

[root@kube-master01 ~]# dnf update -y kubelet-1.27.4-0 kubectl-1.27.4-0 --disableexcludes=kubernetes
Last metadata expiration check: 2:44:01 ago on Thu 20 Jul 2023 09:34:52 AM CST.
Dependencies resolved.
====================================================================================================================================================================================================
 Package                                       Architecture                                 Version                                          Repository                                        Size
====================================================================================================================================================================================================
Upgrading:
 kubectl                                       x86_64                                       1.27.4-0                                         kubernetes                                        11 M
 kubelet                                       x86_64                                       1.27.4-0                                         kubernetes                                        20 M

Transaction Summary
====================================================================================================================================================================================================
Upgrade  2 Packages

Total download size: 31 M
Downloading Packages:
(1/2): 28f442261f1306377aa2704f9f87117d27850ca00f5c26130080a57ccdb38c9d-kubectl-1.27.4-0.x86_64.rpm                                                                 1.3 MB/s |  11 MB     00:08    
(2/2): 49e46174a716325c333a575df9c990b0e237616e7c78537580d7e14204eca1d0-kubelet-1.27.4-0.x86_64.rpm                                                                 1.9 MB/s |  20 MB     00:10    
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                               3.0 MB/s |  31 MB     00:10     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                            1/1 
  Running scriptlet: kubelet-1.27.4-0.x86_64                                                                                                                                                    1/1 
  Upgrading        : kubelet-1.27.4-0.x86_64                                                                                                                                                    1/4 
  Upgrading        : kubectl-1.27.4-0.x86_64                                                                                                                                                    2/4 
  Cleanup          : kubectl-1.27.3-0.x86_64                                                                                                                                                    3/4 
  Cleanup          : kubelet-1.27.3-0.x86_64                                                                                                                                                    4/4 
  Running scriptlet: kubelet-1.27.3-0.x86_64                                                                                                                                                    4/4 
  Verifying        : kubectl-1.27.4-0.x86_64                                                                                                                                                    1/4 
  Verifying        : kubectl-1.27.3-0.x86_64                                                                                                                                                    2/4 
  Verifying        : kubelet-1.27.4-0.x86_64                                                                                                                                                    3/4 
  Verifying        : kubelet-1.27.3-0.x86_64                                                                                                                                                    4/4 

Upgraded:
  kubectl-1.27.4-0.x86_64                                                                          kubelet-1.27.4-0.x86_64                                                                         

Complete!

重启 kubelet

sudo systemctl daemon-reload && sudo systemctl restart kubelet && systemctl status kubelet

注意:如果kubeadm升级计划显示任何需要手动升级的组件配置,用户必须通过--config命令行标志提供一个包含替换配置的配置文件,以便kubeadm upgrade apply。如果不这样做,将导致kubeadm upgrade apply退出并返回错误,并且不执行升级。

手动升级您的CNI提供程序插件:
您的容器网络接口(CNI)提供商可能有自己的升级说明。检查插件页面以找到您的CNI提供商,并查看是否需要其他升级步骤。
如果CNI提供程序作为DaemonSet运行,则在其他控制平面节点上不需要此步骤。

3.7 Apply the upgrade plan to the other master nodes

假如有三个 control-plane node

$ kubectl drain kube-master02 --ignore-daemonsets --delete-emptydir-data
$ ssh root@x.x.x.x
$ dnf update -y kubeadm-1.27.4-0  --disableexcludes=kubernetes
$ kubeadm upgrade node experimental-control-plane
$ kubectl uncordon kube-master02

#centos、rocky、rhel:
dnf update -y kubelet-1.27.4 kubectl-1.27.4 --disableexcludes=kubernetes

#ubuntu:
$ apt-mark unhold kubelet kubectl && \
apt-get update && apt-get install -y kubelet=1.27.4-0 kubectl=1.27.4-0 && \
apt-mark hold kubelet kubectl

#重启 kubelet
sudo systemctl daemon-reload && sudo systemctl restart kubelet && systemctl status kubelet

4. Worker

4.1 Upgrade kubeadm on first worker node

$ ssh worker@x.x.x.x

#ubuntu:
$ apt-mark unhold kubeadm && apt-get update && apt-get install -y kubeadm=1.27.4-00 && apt-mark hold kubeadm

#centos、rocky、rhel:
dnf list kubeadm kubelet kubectl --showduplicates | sort -r |grep 1.27.4
dnf update -y kubeadm-1.27.4-0

4.2 Login to a master node and drain first worker node

$ ssh root@x.x.x.x
$ kubectl drain <node-to-drain> --ignore-daemonsets
$ kubectl drain kube-prom01 --ignore-daemonsets

输出:

[root@kube-master01 ~]# kubectl drain kube-prom01 --ignore-daemonsets
node/kube-prom01 cordoned
Warning: ignoring DaemonSet-managed Pods: kube-system/kube-proxy-rb7k2
node/kube-prom01 drained

4.3 Upgrade kubelet config on worker node

$ ssh root@x.x.x.x
$ kubeadm upgrade node
或者
$ kubeadm upgrade node config --kubelet-version v1.27.4

输出:

[root@kube-prom01 ~]# kubeadm upgrade node
[upgrade] Reading configuration from the cluster...
[upgrade] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[preflight] Running pre-flight checks
[preflight] Skipping prepull. Not a control plane node.
[upgrade] Skipping phase. Not a control plane node.
[upgrade] Backing up kubelet config file to /etc/kubernetes/tmp/kubeadm-kubelet-config3537245876/config.yaml
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[upgrade] The configuration for this node was successfully updated!
[upgrade] Now you should go ahead and upgrade the kubelet package using your package manager.

4.4 Upgrade kubelet and kubectl

```bash

#centos、rocky、rhel:
dnf update -y kubelet-1.27.4 kubectl-1.27.4 --disableexcludes=kubernetes

#ubuntu:
$ apt-mark unhold kubelet kubectl && \
apt-get update && apt-get install -y kubelet=1.27.4-0 kubectl=1.27.4-0 && \
apt-mark hold kubelet kubectl

sudo systemctl daemon-reload && sudo systemctl restart kubelet && systemctl status kubelet

4.5 Uncordon the worker node

通过将节点标记为可调度,使其重新联机:
(master操作)

kubectl uncordon <node-to-uncordon>
kubectl uncordon kube-prom01

注意:其他 worker node 升级步骤同上

4.6 Check cluster

[root@kube-master01 ~]# kubectl get nodes
NAME            STATUS   ROLES           AGE   VERSION
kube-master01   Ready    control-plane   43h   v1.27.4
kube-node01     Ready    <none>          43h   v1.27.4
kube-prom01     Ready    <none>          43h   v1.27.4
[root@kube-master01 ~]# kubectl get pod -A
NAMESPACE     NAME                                    READY   STATUS    RESTARTS       AGE
kube-system   coredns-5d78c9869d-d6tjw                1/1     Running   0              46m
kube-system   coredns-5d78c9869d-l6qsw                1/1     Running   0              46m
kube-system   etcd-kube-master01                      1/1     Running   1 (138m ago)   43h
kube-system   kube-apiserver-kube-master01            1/1     Running   0              43m
kube-system   kube-controller-manager-kube-master01   1/1     Running   0              43m
kube-system   kube-proxy-862db                        1/1     Running   0              42m
kube-system   kube-proxy-gnpjp                        1/1     Running   0              7m50s
kube-system   kube-proxy-k7vpf                        1/1     Running   0              48s
kube-system   kube-scheduler-kube-master01            1/1     Running   0              42m
[root@kube-master01 ~]# kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.4", GitCommit:"fa3d7990104d7c1f16943a67f11b154b71f6a132", GitTreeState:"clean", BuildDate:"2023-07-19T12:20:54Z", GoVersion:"go1.20.6", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v5.0.1
Server Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.4", GitCommit:"fa3d7990104d7c1f16943a67f11b154b71f6a132", GitTreeState:"clean", BuildDate:"2023-07-19T12:14:49Z", GoVersion:"go1.20.6", Compiler:"gc", Platform:"linux/amd64"}
[root@kube-master01 ~]# kubelet --version
Kubernetes v1.27.4
[root@kube-master01 ~]# kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.4", GitCommit:"fa3d7990104d7c1f16943a67f11b154b71f6a132", GitTreeState:"clean", BuildDate:"2023-07-19T12:19:40Z", GoVersion:"go1.20.6", Compiler:"gc", Platform:"linux/amd64"}

参考:

  • Kubernetes Upgrade: The Definitive Guide to Do-It-Yourself
  • Upgrading kubeadm clusters

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/42540.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

自然语言处理: 第五章Attention注意力机制

自然语言处理: 第五章Attention注意力机制 理论基础 Attention&#xff08;来自2017年google发表的[1706.03762] Attention Is All You Need (arxiv.org) &#xff09;&#xff0c;顾名思义是注意力机制&#xff0c;字面意思就是你所关注的东西&#xff0c;比如我们看到一个非…

【计算机组成原理】24王道考研笔记——第二章 数据的表示和运算

第二章 数据的表示和运算 一、数值与编码 1.1 进制转换 任意进制->十进制&#xff1a; 二进制<->八进制、十六进制&#xff1a; 各种进制的常见书写方式&#xff1a; 十进制->任意进制&#xff1a;&#xff08;用拼凑法最快&#xff09; 真值&#xff1a;符合人…

嵌入式软件和硬件的安全性:保护连接世界的数字盾牌

引言&#xff1a; 随着嵌入式系统的广泛应用和物联网的快速发展&#xff0c;嵌入式软件和硬件的安全性问题越来越引起人们的关注。安全性是确保嵌入式系统能够抵御恶意攻击和数据泄露的关键。本文将深入探讨嵌入式软件和硬件的安全性问题&#xff0c;包括技术原理、应用场景、学…

Edge 中比较独特的调试技巧

背景 大家日常开发基本都会使用 Chrome&#xff0c;毕竟确实好用。但是基于 Chromium 的新版 Microsoft Edge 已于 2020 年 1 月 15 日发布。 Edge 目前的使用基本跟 Chrome 差不多了&#xff0c;但显然&#xff0c;Edge 团队不仅仅想当 Chrome 的备用。他们也提供了一些特有…

【C++】-模板进阶(让你更好的使用模板创建无限可能)

&#x1f496;作者&#xff1a;小树苗渴望变成参天大树&#x1f388; &#x1f389;作者宣言&#xff1a;认真写好每一篇博客&#x1f4a4; &#x1f38a;作者gitee:gitee✨ &#x1f49e;作者专栏&#xff1a;C语言,数据结构初阶,Linux,C 动态规划算法&#x1f384; 如 果 你 …

MySQL 8.0 OCP (1Z0-908) 考点精析-性能优化考点6:MySQL Enterprise Monitor之Query Analyzer

文章目录 MySQL 8.0 OCP (1Z0-908) 考点精析-性能优化考点6&#xff1a;MySQL Enterprise Monitor之Query AnalyzerMySQL Enterprise Monitor之Query AnalyzerQuery Response Time index (QRTi)例题例题1: Query Analyzer答案与解析1 参考 【免责声明】文章仅供学习交流&#x…

【本地电脑搭建Web服务器并用cpolar发布至公网

本地电脑搭建Web服务器并用cpolar发布至公网访问 随着互联网的快速发展&#xff0c;网络也成为我们生活中不可缺少的必要条件&#xff0c;为了能在互联网世界中有自己的一片天地&#xff0c;建立一个属于自己的网页就成为很多人的选择。但互联网行业作为资本密集的行业&#x…

一)Stable Diffusion使用教程:安装

目前AI绘画最火的当属Midjorney和Stable Diffusion&#xff0c;但是由于Midjourney没有开源&#xff0c;因此我们主要分享下Stable Diffusion&#xff0c;后面有望补上Midjourney教程。 本节主要讲解Stable Diffusion&#xff08;以下简述SD&#xff09;的下载和安装。 1&…

呼吸灯——FPGA

文章目录 前言一、呼吸灯是什么&#xff1f;1、介绍2、占空比调节示意图 二、系统设计1、系统框图2、RTL视图 三、源码四、效果五、总结六、参考资料 前言 环境&#xff1a; 1、Quartus18.0 2、vscode 3、板子型号&#xff1a;EP4CE6F17C8 要求&#xff1a; 将四个LED灯实现循环…

Redis源码篇 - Ziplist数据结构

Ziplist是一种内存优化的list存储结构&#xff0c;通过使用连续的内存空间存储&#xff0c;来减少内存碎片化&#xff0c;同时和链表的不同还有&#xff0c;它不存储前后指针&#xff0c;而是通过变长的字节存储前节点元素长度&#xff0c;通过计算长度来实现节点的查找。它是一…

Google 登录支付,Firebase 相关设置

登录sdk: https://developers.google.com/identity/sign-in/android/start?hlzh-cn 支付sdk: https://developers.google.com/pay/api/android/overview?hlzh-cn Firebase sdk: https://firebase.google.com/docs/android/setup?hlzh-cn 登录设置&#xff1a; 创建凭据&…

机器学习-线性代数-5-空间中的向量投影与最小二乘法

空间中的向量投影与最小二乘法 文章目录 空间中的向量投影与最小二乘法一、引入二、投影和投影的描述1、投影描述最近2、利用矩阵描述投影(1)向一维直线投影(2)向二维平面投影(3)向n维子空间投影的一般情况 三、最小二乘法1、重要的子空间(1)互补的子空间(2)正交的子空间(3)相互…

12.面板问题

面板问题 html部分 <h1>Lorem ipsum dolor sit, amet consectetur adipisicing.</h1><div class"container"><div class"faq"><div class"title-box"><h3 class"title">Lorem, ipsum dolor.<…

(转载)神经网络遗传算法函数极值寻优(matlab实现)

本博客的完整代码获取&#xff1a; https://www.mathworks.com/academia/books/book106283.html 1案例背景 对于未知的非线性函数,仅通过函数的输入输出数据难以准确寻找函数极值。这类问题可以通过神经网络结合遗传算法求解,利用神经网络的非线性拟合能力和遗传算法的非线性…

make/makefile的使用

make/makefile 文章目录 make/makefile初步认识makefile的工作流程依赖关系和依赖方法make的使用 总结 make是一个命令&#xff0c;是一个解释makefile中指令的命令工具&#xff0c;makefile是一个文件&#xff0c;当前目录下的文件&#xff0c;两者搭配使用&#xff0c;完成项…

数据预处理matlab

matlab数据的获取、预处理、统计、可视化、降维 数据的预处理 - MATLAB & Simulink - MathWorks 中国https://ww2.mathworks.cn/help/matlab/preprocessing-data.html 一、数据的获取 1.1 从Excel中获取 使用readtable() 例1&#xff1a; 使用spreadsheetImportOption…

【AutoSAR 架构介绍】

AutoSAR简介 AUTOSAR是Automotive Open System Architecture&#xff08;汽车开放系统架构&#xff09;的首字母缩写&#xff0c;是一家致力于制定汽车电子软件标准的联盟。 AUTOSAR是由全球汽车制造商、部件供应商及其他电子、半导体和软件系统公司联合建立&#xff0c;各成…

npm link 实现全局运行package.json中的指令

packages.json "name":"testcli","bin": {"itRun": "index.js"},执行命令 npm link如果要解绑定 npm unlink testcli 现在你可以输入 itRun试一下

MySQL高阶语句之二

目录 一、子查询 1.1语法 1.2select 1.3insert 1.3update 1.4delete 1.5 exists 1.6别名as 二、MySQL视图 2.1功能 2.2区别 2.3联系 2.4 创建视图(单表) 2.5 创建视图(多表) 2.6修改原表数据 2.7修改视图数据 三、NULL值 四、连接查询 4.1内连接 4.1.1语法 4.1.…

LangChain+LLM大模型问答能力搭建与思考

1. 背景 最近&#xff0c;大模型&#xff08;LLMs&#xff0c;Large Language Models&#xff09;可谓是NLP领域&#xff0c;甚至整个科技领域最火热的技术了。凑巧的是&#xff0c;我本人恰好就是NLP算法工程师&#xff0c;面临着被LLMs浪潮淘汰的窘境&#xff0c;决定在焦虑…