kubernetes应用的包管理Helm工具

news2024/9/22 12:11:18

目录

一、helm简介

二、部署helm

1、官网与资源

2、部署helm

(1)安装helm

(2)配置helm命令补齐

三、helm常用操作

(1)查询官方应用中心

(2)管理第三方repo源

(3)helm的使用方法

(4)安装项目前预定义项目选项

四、构建helm中的chart包

1、Helm Chart目录结构

2、构建方法

五、构建helm仓库

1、在harbor仓库中构建一个公开的项目

2、安装helm push插件

(1)在线安装

(2)离线安装

3、上传项目到仓库

(1)添加仓库

(2)上传本地项目

六、helm的版本迭代

1、重新构建新版本项目

2、上传项目到helm仓库中

3、更新应用

4、应用回滚


一、helm简介

  • Helm是Kubernetes 应用的包管理工具,主要用来管理 Charts,类似Linux系统的yum。

  • Helm Chart是用来封装Kubernetes原生应用程序的一系列YAML文件。可以在你部署应用的时候自定义应用程序的一些 Metadata,以便于应用程序的分发。

  • 对于应用发布者而言

    • 通过Helm打包应用、管理应用依赖关系、管理应用版本并发布应用到软件仓库。

  • 对于使用者而言

    • 使用Helm后可以以简单的方式在Kubernetes上查找、安装、升级、回滚、卸载应用程序

二、部署helm

1、官网与资源

官网: Helm | 快速入门指南

软件资源: Releases · helm/helm · GitHub

2、部署helm

(1)安装helm

[root@k8s-master ~]# mkdir helm
[root@k8s-master ~]# cd helm/
[root@k8s-master helm]# tar zxf helm-v3.15.4-linux-amd64.tar.gz 
[root@k8s-master helm]# ls
helm-v3.15.4-linux-amd64.tar.gz  linux-amd64
[root@k8s-master helm]# cd linux-amd64/
[root@k8s-master linux-amd64]# ls
helm  LICENSE  README.md
[root@k8s-master linux-amd64]# cp -p helm /usr/local/bin/
cp: overwrite '/usr/local/bin/helm'? y

(2)配置helm命令补齐

[root@k8s-master linux-amd64]# echo "source <(helm completion bash)" >> ~/.bashrc
[root@k8s-master linux-amd64]# source ~/.bashrc
[root@k8s-master linux-amd64]# helm version
version.BuildInfo{Version:"v3.15.4", GitCommit:"fa9efb07d9d8debbb4306d72af76a383895aa8c4", GitTreeState:"clean", GoVersion:"go1.22.6"}

三、helm常用操作

命令描述
create创建一个 chart 并指定名字
dependency管理 chart 依赖
get下载一个 release。可用子命令:all、hooks、manifest、notes、values
history获取 release 历史
install安装一个 chart
list列出 release
package将 chart 目录打包到 chart 存档文件中
pull从远程仓库中下载 chart 并解压到本地 # helm pull stable/mysql -- untar
repo添加,列出,移除,更新和索引 chart 仓库。可用子命令:add、index、 list、remove、update
rollback从之前版本回滚
search根据关键字搜索 chart。可用子命令:hub、repo
show查看 chart 详细信息。可用子命令:all、chart、readme、values
status显示已命名版本的状态
template本地呈现模板
uninstall卸载一个 release
upgrade更新一个 release
version查看 helm 客户端版本

(1)查询官方应用中心

[root@k8s-master helm]# helm search  hub nginx		#在官方仓库中搜索
[root@k8s-master helm]# helm  search  repo  nginx	#在本地仓库中搜索

(2)管理第三方repo源

  • 阿里云仓库:https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts

  • bitnami仓库: https://charts.bitnami.com/bitnami

  • 微软仓库:Index of /kubernetes/charts/

  • 官方仓库: https://hub.kubeapps.com/charts/incubator

#添加阿里云仓库
[root@k8s-master helm]# helm repo  add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
"aliyun" has been added to your repositories

#添加bitnami仓库
[root@k8s-master helm]# helm repo add bitnami https://charts.bitnami.com/bitnami
"bitnami" has been added to your repositories

#查看仓库信息
[root@k8s-master helm]# helm repo list
NAME    URL
aliyun  https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
bitnami https://charts.bitnami.com/bitnami

#查看仓库存储helm清单
[root@k8s-master helm]# helm search repo  aliyun
NAME                            CHART VERSION   APP VERSION     DESCRIPTION         #应用名称						  封装版本			软件版本          软件描述                   
aliyun/acs-engine-autoscaler    2.1.3           2.1.1           Scales worker nodes within agent pools           
aliyun/aerospike                0.1.7           v3.14.1.2       A Helm chart for Aerospike in Kubernetes 

#删除第三方存储库
[root@k8s-master helm]# helm repo list
NAME    URL
aliyun  https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
bitnami https://charts.bitnami.com/bitnami

[root@k8s-master helm]# helm repo remove aliyun
"aliyun" has been removed from your repositories
[root@k8s-master helm]# helm repo list
NAME    URL
bitnami https://charts.bitnami.com/bitnami

(3)helm的使用方法

# 1、查找chart
[root@k8s-master helm]# helm search repo nginx
# 2、查看chart信息
[root@k8s-master helm]# helm show chart bitnami/nginx
# 3.安装chart包
[root@k8s-master helm]# helm install zx bitnami/nginx
[root@k8s-master helm]# helm list
NAME	NAMESPACE	REVISION	UPDATED                                	STATUS  	CHART        	APP VERSION
zx  	default  	1       	2024-09-20 11:17:39.302881065 +0800 CST	deployed	nginx-18.1.15	1.27.1     
[root@k8s-master helm]# kubectl get pods
NAME                        READY   STATUS                  RESTARTS   AGE
zx-nginx-77f58d964f-9s4cl   0/1     Init:ImagePullBackOff   0          81s

#查看项目的发布状态
[root@k8s-master helm]# helm status zx
NAME: zx
LAST DEPLOYED: Fri Sep 20 11:17:39 2024
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: nginx
CHART VERSION: 18.1.15
APP VERSION: 1.27.1

#卸载项目
[root@k8s-master helm]# helm uninstall zx
release "zx" uninstalled
[root@k8s-master helm]# kubectl get pods
No resources found in default namespace.
[root@k8s-master helm]# helm list
NAME	NAMESPACE	REVISION	UPDATED	STATUS	CHART	APP VERSION

(4)安装项目前预定义项目选项

#拉取项目
[root@k8s-master helm]# helm pull bitnami/nginx
[root@k8s-master helm]# ls
helm-v3.15.4-linux-amd64.tar.gz  linux-amd64
[root@k8s-master helm]# 
[root@k8s-master helm]# helm pull bitnami/nginx
[root@k8s-master helm]# ls
helm-v3.15.4-linux-amd64.tar.gz  linux-amd64  nginx-18.1.15.tgz
[root@k8s-master helm]# tar zxf nginx-18.1.15.tgz 
[root@k8s-master helm]# ls
helm-v3.15.4-linux-amd64.tar.gz  linux-amd64  nginx  nginx-18.1.15.tgz
[root@k8s-master helm]# cd nginx/
[root@k8s-master nginx]# ls
Chart.lock  charts  Chart.yaml  README.md  templates  values.schema.json  values.yaml
[root@k8s-master nginx]# ls templates/        #项目模板
deployment.yaml      hpa.yaml                 NOTES.txt                    serviceaccount.yaml
extra-list.yaml      ingress-tls-secret.yaml  pdb.yaml                     servicemonitor.yaml
health-ingress.yaml  ingress.yaml             prometheusrules.yaml         svc.yaml
_helpers.tpl         networkpolicy.yaml       server-block-configmap.yaml  tls-secret.yaml
[root@k8s-master nginx]# vim values.yaml     #项目变量文件

#上传项目所需要镜像到仓库
[root@k8s-master helm]# docker load -i nginx-1.27.1-debian-12-r2.tar 
[root@k8s-master helm]# docker tag bitnami/nginx:1.27.1-debian-12-r2 reg.zx.org/bitnami/nginx:1.27.1-debian-12-r2

[root@k8s-master helm]# docker push reg.zx.org/bitnami/nginx:1.27.1-debian-12-r2

#安装本地项目
[root@k8s-master helm]# helm upgrade zx /root/helm/nginx --set image.tag=1.27.1-debian-12-r2
[root@k8s-master helm]# helm install zx /root/helm/nginx
[root@k8s-master nginx]# kubectl get pods
NAME                        READY   STATUS    RESTARTS   AGE
zx-nginx-6c7ffc66f7-26lpp   1/1     Running   0          40s
[root@k8s-master nginx]# kubectl get svc
NAME         TYPE           CLUSTER-IP     EXTERNAL-IP     PORT(S)                      AGE
kubernetes   ClusterIP      10.96.0.1      <none>          443/TCP                      4d1h
myapp1       ClusterIP      10.99.26.240   <none>          80/TCP                       3d3h
zx-nginx     LoadBalancer   10.97.55.101   172.25.254.50   80:32536/TCP,443:32763/TCP   105s

#更新项目
[root@k8s-master nginx]# vim values.yaml 
623   type: ClusterIP
761   hostname: myapp.zx.org
781   ingressClassName: "nginx"

[root@k8s-master nginx]# helm upgrade zx .
[root@k8s-master nginx]# kubectl get svc
NAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
kubernetes   ClusterIP   10.96.0.1       <none>        443/TCP          4d1h
myapp1       ClusterIP   10.99.26.240    <none>        80/TCP           3d3h
zx-nginx     ClusterIP   10.102.14.124   <none>        80/TCP,443/TCP   13m
[root@k8s-master nginx]# curl 10.102.14.124
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

#查看历史
[root@k8s-master nginx]# helm history zx
#删除项目
[root@k8s-master nginx]# helm  uninstall zx

四、构建helm中的chart包

1、Helm Chart目录结构

# 建立chart项目
[root@k8s-master helm]# helm create zx
Creating zx
[root@k8s-master helm]# tree zx/
zx/
├── charts                            #目录里存放这个chart依赖的所有子chart。
├── Chart.yaml                        #用于描述这个 Chart 的基本信息,包括名字、描述信息以及版本等。
├── templates                         #目录里面存放所有 yaml 模板文件。
│   ├── deployment.yaml               
│   ├── _helpers.tpl                  #放置模板助手的地方,可以在整个 chart 中重复使用
│   ├── hpa.yaml
│   ├── ingress.yaml
│   ├── NOTES.txt
│   ├── serviceaccount.yaml
│   ├── service.yaml
│   └── tests
│       └── test-connection.yaml
└── values.yaml                        #用于存储 templates 目录中模板文件中用到变量的值

3 directories, 10 files

2、构建方法

[root@k8s-master helm]# cd zx/
[root@k8s-master zx]# vim Chart.yaml 
apiVersion: v2
name: zx
description: A Helm chart for Kubernetes
type: application
version: 0.1.0				#项目版本
appVersion: "v1"			#软件版本

[root@k8s-master zx]# vim values.yaml 
image:
  repository: reg.zx.org/library/myapp
  pullPolicy: IfNotPresent
  tag: "v1"
ingress:
  enabled: true
  className: "nginx"
  annotations: {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
  hosts:
    - host: www.zx.org
      paths:
        - path: /
          pathType: ImplementationSpecific

#语法检测
[root@k8s-master zx]# helm lint .
==> Linting .
[INFO] Chart.yaml: icon is recommended

1 chart(s) linted, 0 chart(s) failed

#项目打包
[root@k8s-master zx]# cd ..
[root@k8s-master helm]# helm package zx/
Successfully packaged chart and saved it to: /root/helm/zx-0.1.0.tgz
[root@k8s-master helm]# ls
#项目可以通过各种分享方式发方为任何人后部署即可
[root@k8s-master helm]# helm install zx zx-0.1.0.tgz 
NAME: zx
LAST DEPLOYED: Fri Sep 20 12:43:20 2024
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
  http://www.zx.org/

[root@k8s-master helm]# kubectl get pods
NAME                  READY   STATUS    RESTARTS   AGE
zx-69745f4966-fq79r   1/1     Running   0          7s
[root@k8s-master helm]# kubectl get  ingress
NAME    CLASS   HOSTS              ADDRESS         PORTS     AGE
myapp   nginx   myapp-tls.zx.org   172.25.254.10   80, 443   3d23h
zx      nginx   www.zx.org         172.25.254.10   80        72s
[root@k8s-master helm]# kubectl get  svc
NAME         TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1        <none>        443/TCP   4d2h
myapp1       ClusterIP   10.99.26.240     <none>        80/TCP    3d4h
zx           ClusterIP   10.100.153.131   <none>        80/TCP    4m11s
[root@k8s-master helm]# curl 10.100.153.131
Hello MyApp | Version: v1 | <a href="hostname.html">Pod Name</a>

五、构建helm仓库

1、在harbor仓库中构建一个公开的项目

2、安装helm push插件

官方网址:GitHub - chartmuseum/helm-push: Helm plugin to push chart package to ChartMuseum

(1)在线安装

[root@k8s-master helm]# dnf install git -y
[root@k8s-master helm]# helm plugin install https://github.com/chartmuseum/helm-push

(2)离线安装

#创建helm plugin的存放目录
[root@k8s-master helm]# mkdir  ~/.local/share/helm/plugins/helm-push -p

#解压push插件包到指定目录
[root@k8s-master helm]# tar zxf helm-push_0.10.4_linux_amd64.tar.gz -C ~/.local/share/helm/plugins/helm-push
[root@k8s-master helm]# ls ~/.local/share/helm/plugins/helm-push
acceptance_tests  BUILDING.md  go.mod  LICENSE   pkg          README.md  scripts
bin               cmd          go.sum  Makefile  plugin.yaml  releases   testdata

#查看helm调用命令是否成功
[root@k8s-master helm]# helm cm-push --help
Helm plugin to push chart package to ChartMuseum

3、上传项目到仓库

(1)添加仓库

[root@k8s-master helm]# helm repo add zx-new https://reg.zx.org/chartrepo/zx-new
"zx-new" has been added to your repositories
#添加仓库时报错,因为用的是加密访问,需添加证书
#为helm添加证书
[root@k8s-master helm]# cp /etc/docker/certs.d/reg.zx.org/ca.crt /etc/pki/ca-trust/source/anchors/
#更新本地ca认证库
[root@k8s-master helm]# update-ca-trust

(2)上传本地项目

#命令执行格式
helm cm-push <项目名称> <仓库名称> -u admin -p 123
[root@k8s-master helm]# helm cm-push zx-0.1.0.tgz zx-new -u admin -p123
Pushing zx-0.1.0.tgz to zx-new...
Done.
#查看项目上传情况
#上传后数据未更新
[root@k8s-master helm]# helm search repo zx-new
No results found
#更新仓库
[root@k8s-master helm]# helm repo update zx-new
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "zx-new" chart repository
Update Complete. ⎈Happy Helming!⎈
#再次查看
[root@k8s-master helm]# helm search repo zx-new
NAME     	CHART VERSION	APP VERSION	DESCRIPTION                
zx-new/zx	0.1.0        	v1         	A Helm chart for Kubernetes
#安装项目
[root@k8s-master helm]# helm install zx zx-new/zx
NAME: zx
LAST DEPLOYED: Fri Sep 20 13:11:11 2024
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
  http://www.zx.org/

[root@k8s-master helm]# kubectl get pods -o wide
NAME                  READY   STATUS    RESTARTS   AGE   IP               NODE               NOMINATED NODE   READINESS GATES
zx-69745f4966-zw7tm   1/1     Running   0          5s    10.244.101.132   k8s-node1.zx.org   <none>           <none>
[root@k8s-master helm]# curl 10.244.101.132
Hello MyApp | Version: v1 | <a href="hostname.html">Pod Name</a>

六、helm的版本迭代

1、重新构建新版本项目

[root@k8s-master helm]# vim zx/Chart.yaml 
version: 0.2.0
appVersion: "v2"

[root@k8s-master helm]# vim zx/values.yaml 
tag: "v2"

[root@k8s-master helm]# helm package zx/
Successfully packaged chart and saved it to: /root/helm/zx-0.2.0.tgz

2、上传项目到helm仓库中

[root@k8s-master helm]# helm cm-push zx-0.2.0.tgz zx-new -u admin -p 123
Pushing zx-0.2.0.tgz to zx-new...
Done.
[root@k8s-master helm]# helm repo update zx-new
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "zx-new" chart repository
Update Complete. ⎈Happy Helming!⎈
[root@k8s-master helm]# helm search repo zx-new -l
NAME     	CHART VERSION	APP VERSION	DESCRIPTION                
zx-new/zx	0.2.0        	v2         	A Helm chart for Kubernetes
zx-new/zx	0.1.0        	v1         	A Helm chart for Kubernetes

3、更新应用

[root@k8s-master helm]# helm upgrade zx zx-new/zx
Release "zx" has been upgraded. Happy Helming!
NAME: zx
LAST DEPLOYED: Fri Sep 20 13:19:42 2024
NAMESPACE: default
STATUS: deployed
REVISION: 2
NOTES:
1. Get the application URL by running these commands:
  http://www.zx.org/
[root@k8s-master helm]# kubectl get pods -o wide
NAME                  READY   STATUS    RESTARTS   AGE   IP               NODE               NOMINATED NODE   READINESS GATES
zx-568f564d69-m7vgn   1/1     Running   0          35s   10.244.101.133   k8s-node1.zx.org   <none>           <none>
[root@k8s-master helm]# curl 10.244.101.133 
Hello MyApp | Version: v2 | <a href="hostname.html">Pod Name</a>

[root@k8s-master helm]# helm  history  zx
REVISION	UPDATED                 	STATUS    	CHART   	APP VERSION	DESCRIPTION     
1       	Fri Sep 20 13:13:28 2024	superseded	zx-0.1.0	v1         	Install complete
2       	Fri Sep 20 13:19:42 2024	deployed  	zx-0.2.0	v2         	Upgrade complete

4、应用回滚

[root@k8s-master helm]# helm rollback zx
Rollback was a success! Happy Helming!
[root@k8s-master helm]# helm  history  zx
REVISION	UPDATED                 	STATUS    	CHART   	APP VERSION	DESCRIPTION     
1       	Fri Sep 20 13:13:28 2024	superseded	zx-0.1.0	v1         	Install complete
2       	Fri Sep 20 13:19:42 2024	superseded	zx-0.2.0	v2         	Upgrade complete
3       	Fri Sep 20 13:21:40 2024	deployed  	zx-0.1.0	v1         	Rollback to 1   
[root@k8s-master helm]# kubectl get pods -o wide
NAME                  READY   STATUS    RESTARTS   AGE   IP               NODE               NOMINATED NODE   READINESS GATES
zx-69745f4966-44n5m   1/1     Running   0          14s   10.244.101.134   k8s-node1.zx.org   <none>           <none>
[root@k8s-master helm]# curl 10.244.101.134
Hello MyApp | Version: v1 | <a href="hostname.html">Pod Name</a>

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

AI周报(9.15-9.21)

AI应用-宇宙建筑师&#xff1a;AI探索宇宙结构 近日&#xff0c;来自马克斯普朗克研究所等机构&#xff0c;利用宇宙学和红移依赖性对宇宙结构形成进行了场级仿真。 AI版“宇宙闪电侠”&#xff1a;若以传统宇宙模拟的缓慢行进比作悠然自得的蜗牛&#xff0c;那么AI便宛如宇宙…

centos7 添加中文字体

一、打开C:\Windows\Fonts 复制 复制出来再拷贝到linux服务器目录&#xff1a;/usr/share/fonts/jtwin #执行 #mkdir /usr/share/fonts/jtwin chmod -R 755 /usr/share/fonts/jtwin yum -y install ttmkfdir ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir 编辑&…

Ubuntu 安装和使用 Fcitx 中文输入法;截图软件flameshot

一、Ubuntu 安装和使用 Fcitx 中文输入法 在 Ubuntu 上安装和使用 Fcitx 输入法框架是一个常见的选择&#xff0c;特别是对于需要中文输入的用户。以下是详细的步骤来安装和配置 Fcitx 输入法&#xff1a; 1. 安装 Fcitx 和相关输入法 首先&#xff0c;更新你的包列表并安装…

黑马智数Day1

src文件夹 src 目录指的是源代码目录&#xff0c;存放项目应用的源代码&#xff0c;包含项目的逻辑和功能实现&#xff0c;实际上线之后在浏览器中跑的代码就是它们 apis - 业务接口 assets - 静态资源 &#xff08;图片&#xff09; components - 组件 公共组件 constants…

1.量化第一步,搭建属于自己的金融数据库!

数据是一切量化研究的前提。 做量化没有数据&#xff0c;就相当于做饭时没有食材。 很多时候&#xff0c;我们需要从大量的数据中寻找规律&#xff0c;并从中开发出策略。如果我们每次使用的时候&#xff0c;都从网上去找数据&#xff0c;一方面效率低下&#xff0c;另一方面短…

erlang学习:Linux常用命令2

目录操作命令 对目录进行基本操作 相关cd切换目录之类的就直接省去了&#xff0c;以下操作中都会用到 查看当前目录下的所有目录和文件 ls 列表查看当前目录下的所有目录和文件&#xff08;列表查看&#xff0c;显示更多信息&#xff09; ls -l 或 ll 在当前目录下创建一个…

中断-MCU

中断 目录 中断 中断的概念 中断的执行过程 中断服务函数 中断的部分专业术语 – 了解 STM32中的中断分类 嵌套向量中断控制器 NVIC STM32中的中断优先级 中断编程 外部中断&#xff08;单片机之外&#xff09;之EXTI中断 相关寄存器 外部中断&#xff08;EXTI&am…

在jupyter notebook中取消代理服务器的解决方案

大家好,我是爱编程的喵喵。双985硕士毕业,现担任全栈工程师一职,热衷于将数据思维应用到工作与生活中。从事机器学习以及相关的前后端开发工作。曾在阿里云、科大讯飞、CCF等比赛获得多次Top名次。现为CSDN博客专家、人工智能领域优质创作者。喜欢通过博客创作的方式对所学的…

2.个人电脑部署MySQL,傻瓜式教程带你拥有个人金融数据库!

2.个人电脑部署MySQL&#xff0c;傻瓜式教程带你拥有个人金融数据库&#xff01; ‍ 前边我们提到&#xff0c;比较适合做量化投研的数据库是MySQL&#xff0c;开源免费。所以今天我就写一篇教程来教大家如何在自己的环境中部署MySQL。 在不同的设备或系统中安装MySQL的步骤…

MySQL篇(存储过程 触发器 存储函数)(持续更新迭代)

目录 一、存储过程 1. 简介 2. 特点 3. 语法 3.1. 创建 3.2. 调用 3.3. 查看 3.4. 删除 4. 示例 二、变量 1. 简介 2. 系统变量 2.1. 查看系统变量 2.2. 设置系统变量 2.3. 演示示例 3. 用户定义变量 3.1. 赋值 方式一 方式二 3.2. 使用 3.3. 演示示例 4.…

MES系统能够实时监控生产进度,优化生产排程

一、MES系统实时监控生产进度 MES系统通过集成各种数据采集手段&#xff08;如RFID、条形码、传感器、PLC等&#xff09;&#xff0c;能够实时、准确地采集生产现场的数据&#xff0c;包括设备状态、生产数量、生产时间、人员操作等信息。这些数据被实时传输到MES系统的数据库…

群晖使用Docker部署WPS Office并实现异地使用浏览器制作办公文档

文章目录 前言1. 本地环境配置2. 制作本地分享链接3. 制作公网访问链接4. 公网ip地址访问您的分享相册5. 制作固定公网访问链接 前言 想象一下这个场景&#xff1a;如果遇到周末紧急需要改方案&#xff0c;但团队成员都在各自家中&#xff0c;这个时候如果大家能够轻松访问这个…

照片EXIF数据统计与可视化

拍的照片越来越多&#xff0c;想要了解一下日常拍摄的习惯&#xff0c;便于后面换镜头、调整参数等操作&#xff0c;所以写了这个脚本来统计照片的EXIF数据。该脚本用于统计指定文件夹下所有JPG图片的EXIF数据&#xff0c;包括快门速度、ISO、焦距、光圈和拍摄时间&#xff0c;…

网络资源模板--Android Studio 仿WeChat聊天App

目录 一、项目演示 二、项目测试环境 三、项目详情 四、完整的项目源码 一、项目演示 网络资源模板--仿微信聊天App 二、项目测试环境 三、项目详情 登陆注册 ### 登录功能&#xff08;LoginActivity&#xff09; 1. **界面初始化**&#xff1a;设置界面元素&#xff0c;包…

二叉树---java---黑马

二叉树 遍历 遍历分两种 广度优先遍历 尽可能先访问距离根节点最近的节点&#xff0c;也称之为层序遍历。 深度优先遍历 对于二叉树&#xff0c;进一步分为三种 pre-order前序遍历&#xff0c;对于每一颗子树&#xff0c;先访问该节点&#xff0c;然后是左子树&#xf…

银河麒麟桌面操作系统如何添加WPS字体

银河麒麟桌面操作系统如何添加WPS字体 1、使用场景2、操作方法步骤一&#xff1a;下载字体文件步骤二&#xff1a;打开终端步骤三&#xff1a;进入字体文件所在目录步骤四&#xff1a;拷贝字体文件到WPS字体目录步骤五&#xff1a;更新字体缓存步骤六&#xff1a;重启WPS Offic…

C++ 把字符串转换成整数 (atoi) - 力扣(LeetCode)

点击链接即可查看&#xff1a;LCR 192. 把字符串转换成整数 (atoi) - 力扣&#xff08;LeetCode&#xff09; 一、题目 请你来实现一个 myAtoi(string s) 函数&#xff0c;使其能将字符串转换成一个 32 位有符号整数&#xff08;类似 C/C 中的 atoi 函数&#xff09;。 函数 my…

基于协同过滤算法的商品推荐系统

系统展示 用户前台界面 管理员后台界面 商家后台界面 系统背景 随着互联网技术的飞速发展&#xff0c;用户每天面临的信息量呈爆炸式增长&#xff0c;如何有效地筛选出用户感兴趣的内容成为一大挑战。在此背景下&#xff0c;基于协同过滤算法的商品推荐系统应运而生。该系统通过…

Th:1.1 建立连接

基础讲解 1.TCP通信流程 基于TCP通信的Socket基本流程: 1.1 Socket 函数返回值&#xff1a;一个文件描述符&#xff1a; 特别的两个队列。 #include <sys/types.h> #include <sys/socket.h> //create an endpoint for communication int socket(int …

【Mysql】Centos 安装 Mysql8.0

官网下载安装包 官网地址&#xff1a;MySQL :: Download MySQL Community Server 查看服务器的名称和版本号 lsb_release -a 查看服务的架构 uname -m 下载对应的版本&#xff0c;这里操作系统选择 Red Hat 就可以了。&#xff08;CentOS 就是将 RHEL 发行的源代码从新编译…