K8S - 理解volumeMounts 中的subpath
在上一篇文章中
springboot service如何动态读取外部配置文件
介绍了springboot 中如何实时读取外部配置文件的内容
部署在K8S
接下来我把它部署在k8s
首先, 我们把配置文件放入项目某个目录
这步部是必须的, 毕竟我们要引入是项目外部的文件, 这一步只是方便在不同CICD 环境下的docker 构建
我们就放在 src 外面的configs folder

修改docker file
# use the basic openjdk image
FROM openjdk:17# setup working directory
WORKDIR /app# create /app/config
RUN mkdir -p /app/config/config2# copy configs files from project folder to /app/config
# When using COPY with more than one source file, the destination must be a directory and end with a /
COPY configs/external-config.properties /app/config/
COPY configs/external-config2.properties /app/config/config2/# copy and rename jar file into container
COPY target/*.jar app.jar# expose port
EXPOSE 8080# define environment variable, and provide a default value
ENV APP_ENVIRONMENT=dev# define the default startup command, it could be overridden in k8s
# CMD java -jar -Dserver.port=8080 -Dspring.config.name=application-${APP_ENVIRONMENT} app.jar
CMD java -jar -Dserver.port=8080 app.jar --spring.profiles.active=${APP_ENVIRONMENT}
需要创建/app/configs 并把配置文件复制到这里, 因为springboot service 会从这个path读取
注意有两个config 文件, 他们并不在同1个folder
external-config2.properties 在subfolder config2里面
构建镜像和部署镜像到GAR
这一步我们用google cloudbuild 完成
至于cloudbuild 的介绍请参考
初探 Google 云原生的CICD - CloudBuild
cloudbuild-gcr.yaml
# just to update the docker image to GAR with the pom.xml versionsteps:- id: run maven installname: maven:3.9.6-sapmachine-17 # https://hub.docker.com/_/mavenentrypoint: bashargs:- '-c'- |whoamiset -xpwdmvn installcat pom.xml | grep -m 1 "<version>" | sed -e 's/.*<version>\([^<]*\)<\/version>.*/\1/' > /workspace/version.txtecho "Version: $(cat /workspace/version.txt)"- id: build and push docker imagename: 'gcr.io/cloud-builders/docker'entrypoint: bashargs:- '-c'- |set -xecho "Building docker image with tag: $(cat /workspace/version.txt)"docker build -t $_GAR_BASE/$PROJECT_ID/$_DOCKER_REPO_NAME/${_APP_NAME}:$(cat /workspace/version.txt) .docker push $_GAR_BASE/$PROJECT_ID/$_DOCKER_REPO_NAME/${_APP_NAME}:$(cat /workspace/version.txt)logsBucket: gs://jason-hsbc_cloudbuild/logs/
options: # https://cloud.google.com/cloud-build/docs/build-config#optionslogging: GCS_ONLY # or CLOUD_LOGGING_ONLY https://cloud.google.com/cloud-build/docs/build-config#loggingsubstitutions:_DOCKER_REPO_NAME: my-docker-repo_APP_NAME: cloud-order_GAR_BASE: europe-west2-docker.pkg.dev
部署完成后, 我们得到1个gar的对应image的url
europe-west2-docker.pkg.dev/jason-hsbc/my-docker-repo/cloud-order:1.1.0
编写k8s yaml 和部署到k8s
apiVersion: apps/v1
kind: Deployment
metadata:labels: # label of this deploymentapp: cloud-order # custom definedauthor: nvd11name: deployment-cloud-order # name of this deploymentnamespace: default
spec:replicas: 3 # desired replica count, Please note that the replica Pods in a Deployment are typically distributed across multiple nodes.revisionHistoryLimit: 10 # The number of old ReplicaSets to retain to allow rollbackselector: # label of the Pod that the Deployment is managing,, it's mandatory, without it , we will get this error # error: error validating data: ValidationError(Deployment.spec.selector): missing required field "matchLabels" in io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector ..matchLabels:app: cloud-orderstrategy: # Strategy of upodatetype: RollingUpdate # RollingUpdate or RecreaterollingUpdate:maxSurge: 25% # The maximum number of Pods that can be created over the desired number of Pods during the updatemaxUnavailable: 25% # The maximum number of Pods that can be unavailable during the updatetemplate: # Pod templatemetadata:labels:app: cloud-order # label of the Pod that the Deployment is managing. must match the selector, otherwise, will get the error Invalid value: map[string]string{"app":"bq-api-xxx"}: `selector` does not match template `labels`spec: # specification of the Podcontainers:- image: europe-west2-docker.pkg.dev/jason-hsbc/my-docker-repo/cloud-order:1.1.0 # image of the containerimagePullPolicy: Alwaysname: container-cloud-ordercommand: ["bash"]args: - "-c"- |java -jar -Dserver.port=8080 app.jar --spring.profiles.active=$APP_ENVIRONMENTenv: # set env varaibles- name: APP_ENVIRONMENT # name of the environment variablevalue: prod # value of the environment variablerestartPolicy: Always # Restart policy for all containers within the PodterminationGracePeriodSeconds: 10 # The period of time in seconds given to the Pod to terminate gracefully
没什么特别
部署:
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ kubectl apply -f deployment-cloud-order-with-subpath.yaml
deployment.apps/deployment-cloud-order created
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ kubectl get pods
NAME READY STATUS RESTARTS AGE
deployment-bq-api-service-6f6ffc7866-8djx9 1/1 Running 3 (12d ago) 17d
deployment-bq-api-service-6f6ffc7866-g4854 1/1 Running 12 (12d ago) 61d
deployment-bq-api-service-6f6ffc7866-lwxt7 1/1 Running 14 (12d ago) 63d
deployment-bq-api-service-6f6ffc7866-mxwcq 1/1 Running 11 (12d ago) 61d
deployment-cloud-order-58ddcf894d-8pjsz 1/1 Running 0 5s
deployment-cloud-order-58ddcf894d-mp4js 1/1 Running 0 5s
deployment-cloud-order-58ddcf894d-sszjd 1/1 Running 0 5s
检查容器内的配置文件:
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ kubectl exec -it deployment-cloud-order-58ddcf894d-8pjsz -- /bin/bash
bash-4.4# pwd
/app
bash-4.4# ls config
config2 external-config.properties
bash-4.4# ls config/config2/
external-config2.properties
bash-4.4#
测试api
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ curl http://www.jp-gcp-vms.cloud:8085/cloud-order/actuator/info | jq .% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed
100 1842 0 1842 0 0 1827 0 --:--:-- 0:00:01 --:--:-- 1829
{"app": "Cloud Order Service","appEnvProfile": "prod","version": "1.1.0","hostname": "deployment-cloud-order-58ddcf894d-8pjsz","dbUrl": "jdbc:mysql://192.168.0.42:3306/demo_cloud_order?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true","description": "This is a simple Spring Boot application to for cloud order...","customConfig1": "value of config1","customConfig2": "value of config2",}
}
注意 customConfig1 和 customConfig2 的值, 部署是成功的
For customConfig2 使用configMap
由于customConfig2 是实时更新的
我们尝试用configmap 来取代 上面external-config2.properties 的配置
注意这里的值改成 value of config2 - from k8s configmap 方便区分
构建1个external-config2 的configmap 资源对象
configmap-cloud-order-external-config2.yaml
apiVersion: v1
kind: ConfigMap
metadata:name: configmap-cloud-order-external-config2
data:external.custom.config2: external.custom.config2=value of config2 - from k8s configmap
部署:
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ kubectl apply -f configmap-cloud-order-external-config2.yaml
configmap/configmap-cloud-order-external-config2 created
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ kubectl describe cm configmap-cloud-order-external-config2
Name: configmap-cloud-order-external-config2
Namespace: default
Labels: <none>
Annotations: <none>Data
====
external.custom.config2:
----
external.custom.config2=value of config2 - from k8s configmapBinaryData
====Events: <none>
修改deployment yaml 引入configmap
apiVersion: apps/v1
kind: Deployment
metadata:labels: # label of this deploymentapp: cloud-order # custom definedauthor: nvd11name: deployment-cloud-order # name of this deploymentnamespace: default
spec:replicas: 3 # desired replica count, Please note that the replica Pods in a Deployment are typically distributed across multiple nodes.revisionHistoryLimit: 10 # The number of old ReplicaSets to retain to allow rollbackselector: # label of the Pod that the Deployment is managing,, it's mandatory, without it , we will get this error # error: error validating data: ValidationError(Deployment.spec.selector): missing required field "matchLabels" in io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector ..matchLabels:app: cloud-orderstrategy: # Strategy of upodatetype: RollingUpdate # RollingUpdate or RecreaterollingUpdate:maxSurge: 25% # The maximum number of Pods that can be created over the desired number of Pods during the updatemaxUnavailable: 25% # The maximum number of Pods that can be unavailable during the updatetemplate: # Pod templatemetadata:labels:app: cloud-order # label of the Pod that the Deployment is managing. must match the selector, otherwise, will get the error Invalid value: map[string]string{"app":"bq-api-xxx"}: `selector` does not match template `labels`spec: # specification of the Podcontainers:- image: europe-west2-docker.pkg.dev/jason-hsbc/my-docker-repo/cloud-order:1.1.0 # image of the containerimagePullPolicy: Alwaysname: container-cloud-ordercommand: ["bash"]args: - "-c"- |java -jar -Dserver.port=8080 app.jar --spring.profiles.active=$APP_ENVIRONMENTenv: # set env varaibles- name: APP_ENVIRONMENT # name of the environment variablevalue: prod # value of the environment variablevolumeMounts:- name: volume-external-config2mountPath: /app/config/config2/volumes:- name: volume-external-config2configMap:name: configmap-cloud-order-external-config2items:- key: external.custom.config2path: external-config2.properties # name of the file to be mountedrestartPolicy: Always # Restart policy for all containers within the PodterminationGracePeriodSeconds: 10 # The period of time in seconds given to the Pod to terminate gracefully
注意这里使用了 volume 和 volumemount
重新部署 cloud-order service
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ kubectl delete deploy deployment-cloud-order
deployment.apps "deployment-cloud-order" deleted
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ kubectl apply -f deployment-cloud-order-with-subpath.yaml
deployment.apps/deployment-cloud-order created
测试api
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ curl http://www.jp-gcp-vms.cloud:8085/cloud-order/actuator/info | jq .% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed
100 1863 0 1863 0 0 3888 0 --:--:-- --:--:-- --:--:-- 3889
{"app": "Cloud Order Service","appEnvProfile": "prod","version": "1.1.0","hostname": "deployment-cloud-order-69d4cd76d6-hwtfj","dbUrl": "jdbc:mysql://192.168.0.42:3306/demo_cloud_order?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true","description": "This is a simple Spring Boot application to for cloud order...","customConfig1": "value of config1","customConfig2": "value of config2 - from k8s configmap",
并没什么大问题, 证明configmap 的配置是可以覆盖docker里面定义的配置文件的
实时修改configmap 的配置
这时我们修改一下 configmap configmap-cloud-order-external-config2 里的值
由 external.custom.config2: external.custom.config2=value of config2 - from k8s configmap
改成 external.custom.config2: external.custom.config2=value of config2 - from k8s configmap updated!
apiVersion: v1
kind: ConfigMap
metadata:name: configmap-cloud-order-external-config2
data:external.custom.config2: external.custom.config2=value of config2 - from k8s configmap updated!
更新:
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ kubectl apply -f configmap-cloud-order-external-config2.yaml
configmap/configmap-cloud-order-external-config2 configured
等半分钟后 (1是 k8s 需要时间把 configmap的值刷新到 pods里的volumes, 2时是springboot本身需要定时器去重新获取值)
再测试api
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ curl http://www.jp-gcp-vms.cloud:8085/cloud-order/actuator/info | jq .% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed
100 1872 0 1872 0 0 3900 0 --:--:-- --:--:-- --:--:-- 3900
{"app": "Cloud Order Service","appEnvProfile": "prod","version": "1.1.0","hostname": "deployment-cloud-order-69d4cd76d6-qj98f","dbUrl": "jdbc:mysql://192.168.0.42:3306/demo_cloud_order?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true","description": "This is a simple Spring Boot application to for cloud order...","customConfig1": "value of config1","customConfig2": "value of config2 - from k8s configmap updated!",
果然customConfig2的值自动更新了, 正是我们想要的
而且容器里的文件也的确更新了
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ kubectl exec -it deployment-cloud-order-69d4cd76d6-hwtfj -- /bin/bash
bash-4.4# pwd
/app
bash-4.4# ls config
config2 external-config.properties
bash-4.4# cat config/config2/external-config2.properties
external.custom.config2=value of config2 - from k8s configmap updated!
volumes mount 会覆盖整个文件夹(其他文件被删除)
下面来点整活
我们修改一下deployment 的yaml 配置, 把configmap的值 mark成另1个文件名
volumeMounts:- name: volume-external-config2mountPath: /app/config/config2/volumes:- name: volume-external-config2configMap:name: configmap-cloud-order-external-config2items:- key: external.custom.config2path: external-config2-1.properties # name of the file to be mounted
按照设想, 容器内的configmap里的
/app/config/config2/ 文件内将会有两个文件
dockerfile 定义的external-config2.properties
和 k8s 定义的 external-config2-1.properties
实际部署测试:
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ curl http://www.jp-gcp-vms.cloud:8085/cloud-order/actuator/info | jq .% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed
100 1837 0 1837 0 0 926 0 --:--:-- 0:00:01 --:--:-- 926
{"app": "Cloud Order Service","appEnvProfile": "prod","version": "1.1.0","hostname": "deployment-cloud-order-6878b85d44-cdvlc","dbUrl": "jdbc:mysql://192.168.0.42:3306/demo_cloud_order?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true","description": "This is a simple Spring Boot application to for cloud order...","customConfig1": "value of config1","customConfig2": "not defined",
customConfig2 居然是not defined
检查容器
发现 external-config2.properties 没了
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ kubectl exec -it deployment-cloud-order-6878b85d44-cdvlc -- /bin/bash
bash-4.4# ls
app.jar config
bash-4.4# ls config
config2 external-config.properties
bash-4.4# ls config/config2/
external-config2-1.properties
bash-4.4#
原因是 当k8s 把 volume volume-external-config2 mount在 /app/config/config2 中的时候, 原来的文件就会消失
尝试把新文件mount到1个subfolder
解决方法1:
把 volume volume-external-config2 mount在 /app/config/config2/config-sub
应该可以解决
我们修改deployment yaml
volumeMounts:- name: volume-external-config2mountPath: /app/config/config2/config-subvolumes:- name: volume-external-config2configMap:name: configmap-cloud-order-external-config2items:- key: external.custom.config2path: external-config2-1.properties # name of the file to be mounted
mountPath 改成了/app/config/config2/config-sub
这种方法是可行的
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ kubectl exec -it deployment-cloud-order-654974f855-cmdz7 -- /bin/bash
bash-4.4# ls
app.jar config
bash-4.4# cd config
bash-4.4# ls
config2 external-config.properties
bash-4.4# cd config2
bash-4.4# ls
config-sub external-config2.properties
bash-4.4# cd config-sub
bash-4.4# ls
external-config2-1.properties
bash-4.4#
而且证明了, mountpath中的路径不存在的话, k8s会尝试创建。
利用subpath 去把文件mount在同样的folder
但是上面的做法, 能把新文件mount在1个字母中, 的确不会另旧文件消失,但是并直接真正解决问题
K8S 提供了subpath 的方法:
我们修改deployment yaml
volumeMounts:- name: volume-external-config2mountPath: /app/config/config2/external-config2-1.properties # if we need to use subpath, need to provide the filename as wellsubPath: external-config2-1.properties # name of the file to be mounted, if we use subpath, the other files in that same folder will not dispearvolumes:- name: volume-external-config2configMap:name: configmap-cloud-order-external-config2items:- key: external.custom.config2path: external-config2-1.properties # name of the file to be mounted
注意这里有两个改动:
- mountpath 上加上了文件名
- 添加subpath 配置, 其值还是文件名
这次的确能令两个配置文件同时存在, 原来的文件external-config2.properties 并没有被抹除
gateman@MoreFine-S500:~/projects/coding/k8s-s/service-case/cloud-order$ kubectl exec -it deployment-cloud-order-7775b8c7cd-jnv7v -- /bin/bash
bash-4.4# pwd
/app
bash-4.4# ls
app.jar config
bash-4.4# ls config
config2 external-config.properties
bash-4.4# ls config/config2/
external-config2-1.properties external-config2.properties
bash-4.4#
subpath的一些限制
k8s 设计的 subpath 其实并不是那么直接
参考:
https://hackmd.io/@maelvls/kubernetes-subpath?utm_source=preview-mode&utm_medium=rec
第1个限制就是 subpath 只能1个文件1个文件地mount, 不支持mount整个folder
参考:
https://kubernetes.io/docs/concepts/configuration/configmap/
第2个限制就是, 用subpath mount的configmap , 即使configmap的值被外部修改, 也不会同步到容器…
相关文章:
K8S - 理解volumeMounts 中的subpath
在上一篇文章中 springboot service如何动态读取外部配置文件 介绍了springboot 中如何实时读取外部配置文件的内容 部署在K8S 接下来我把它部署在k8s 首先, 我们把配置文件放入项目某个目录 这步部是必须的, 毕竟我们要引入是项目外部的文件…...
java工程师成功转型大数据
时间:2024年09月06日 作者:小蒋聊技术 邮箱:wei_wei10163.com 微信:wei_wei10 音频:喜马拉雅 希望大家帮个忙!如果大家有工作机会,希望帮小蒋推荐一下,小蒋希望遇到一个认真做事…...
visual studio 2022更新以后,之前的有些工程编译出错,升级到Visual studio Enterprise 2022 Preview解决
系列文章目录 文章目录 系列文章目录前言一、解决方法 前言 今天遇到一个问题:visual studio 2022升级成预览版以后,之前的有些工程编译出错。首先代码、项目设置都没有改变,只是更新了visual studio 2022。 在编译工程时,编译器…...
Linux 性能调优技巧
1理解 Linux 性能的基本组成 CPU 使用率:衡量 CPU 在单位时间内被占用的程度。内存使用:关注的是活跃内存与缓存内存的比例,以及是否有过多的交换。I/O 性能:磁盘读写速度直接影响应用程序的响应时间和吞吐量。网络性能ÿ…...
【网络安全】WordPress Uncontrolled Resource Consumption
未经许可,不得转载。 文章目录 WordPresswp-cron.php实战漏洞危害解决措施WordPress WordPress 是全球最广泛使用的内容管理系统(CMS),目前约有 43% 的网站依赖于它。由于其用户友好的界面和丰富的插件功能,WordPress 成为了全球最受欢迎的 CMS。 然而,在使用 WordPres…...
gitee绑定公钥后依旧无法使用_gitee push添加公钥无效
解决: 步骤按照官网操作即可:gitee官方说明 看看远程地址是否使用的http模式,是的话换ssh模式...
Linux 删除 当前下的 mysql-8.0.31 空文件夹
在Linux中,如果你想要删除当前目录下的名为mysql-8.0.31的空文件夹(即该文件夹内没有任何文件或子文件夹),你可以使用rmdir命令。但是,如果mysql-8.0.31文件夹并非完全为空(即它包含文件或子文件夹…...
2024,中国服务器操作系统迎云智主升浪
“主升浪”描述了股市中一轮行情中涨幅最大、上升持续时间最长的阶段。2024年,云与AI深度融合形成了数字经济主升浪,从而打开了中国服务器操作系统的黄金机遇期。 2024年注定将成为非常不平凡的一年。不仅是实现“十四五”规划目标任务的关键一年&#x…...
STM32快速复习(九)RTC时钟模块
文章目录 前言一、RTC是什么?RTC的工作原理?二、库函数以及示例1.标准库函数2.示例代码 总结 前言 STM32 的实时时钟(RTC)是一个独立的定时器。 STM32 的 RTC 模块拥有一组连续计数的计数器,在相应软件配置下…...
Nacos注册中心与OpenFeign远程调用
文章目录 一、注册中心原理二、Nacos注册中心三、服务注册四、服务发现五、OpenFeign 一、注册中心原理 在微服务当中必须有两个角色 服务提供者:提供接口供其它微服务访问 服务消费者:调用其它微服务提供的接口 在大型微服务项目中,服务提供…...
【基础算法总结】双指针
目录 一,双指针算法介绍二,算法原理和代码实现283.移动零1089.复写零202.快乐数11.盛最多水的容器611.有效三角形的个数LRC179.和为s的两个数15.三数之和18.四数之和 三,算法总结 一,双指针算法介绍 双指针算法是基础算法之一&am…...
教你制作一本一对一授权才能阅读的样本册
在这个信息时代,保护个人隐私变得越来越重要。一对一授权阅读机制,正是为了满足这一需求而诞生。今天,就让我来教你如何制作一本只有一对一授权才能阅读的样本册。这不仅适用于保护个人隐私,还能为企业、研究机构等提供安全、高效…...
【DEV工具-IDEA】idea的光标变成黑块了?
项目场景: 解决:windows:按一下insert键。...
没通过算法备案 或许是这几点你没做好
没通过算法备案 或许是这几点你没做好 当企业提交算法备案遭遇“不予通过”时,往往是因为一些看似微小却至关重要的细节未能达到标准。以下是一些常见的原因,希望能为准备备案的企业提供一些预警和指导: ICP备案缺失:互联网信息服…...
力扣172.阶乘后的0
class Solution {public int trailingZeroes(int n) {int ans 0;//本质:每5个数有一个5的倍数,每25个数有一个25的倍数……int num 5;while(n / num ! 0) {ans n/num;num * 5;}return ans;} }...
Oracle 19c数据库:Windows详细安装与配置指南
Oracle 19c的安装和配置是一个相对复杂但系统化的过程,本文演示如何在 Windows 系统下安装 Oracle数据库,安装足够的磁盘空间(一般需要5~6个G,所以选剩余空间大的盘)。以下是一个详细的步骤指南,包括准备工…...
解决职业摔跤手分类问题的算法与实现
解决职业摔跤手分类问题的算法与实现 引言问题定义算法设计二分图判定算法步骤伪代码C语言实现引言 在职业摔跤界,摔跤手通常被分为“娃娃脸”(“好人”)型和“高跟鞋”(“坏人”)型。在任意一对摔跤手之间,都有可能存在竞争关系。本文的目标是设计一个算法,用于判断是…...
微擎框架
微擎框架之——多级查询显示每项个数-Poison-CSDN博客微擎框架之——系统内置分页加载-CSDN博客 微擎-关于安装模块时出现:Could not resolve: www.52xbjs.com (Could not contact DNS servers)-Poison-CSDN博客...
容器化技术在非结构化数据中台的部署研究
随着大数据时代的到来,非结构化数据的处理与管理日益成为企业和组织关注的重点。为应对非结构化数据中台在数据存储、处理及安全性等方面面临的挑战,本研究深入探讨了容器化技术在该领域的部署与应用。研究首先概述了容器化技术的基本概念、特点及其在非…...
RK3399 android7.1 话柄电话功能
实现功能:挂柄接IO口+GND控制话机听筒与系统喇叭的切换(抬起手柄声音由喇叭切换到听筒,挂到磁吸底座喇叭出声) 应用场景: 电子电话班牌,电话机等 硬件接线方式: 电话手柄:听筒接耳机座子<HRP,GND>,麦克风接<MIC+,MIC-> 电话底座:磁吸座子接<IO2,GND&g…...
Vim 调用外部命令学习笔记
Vim 外部命令集成完全指南 文章目录 Vim 外部命令集成完全指南核心概念理解命令语法解析语法对比 常用外部命令详解文本排序与去重文本筛选与搜索高级 grep 搜索技巧文本替换与编辑字符处理高级文本处理编程语言处理其他实用命令 范围操作示例指定行范围处理复合命令示例 实用技…...
React19源码系列之 事件插件系统
事件类别 事件类型 定义 文档 Event Event 接口表示在 EventTarget 上出现的事件。 Event - Web API | MDN UIEvent UIEvent 接口表示简单的用户界面事件。 UIEvent - Web API | MDN KeyboardEvent KeyboardEvent 对象描述了用户与键盘的交互。 KeyboardEvent - Web…...
令牌桶 滑动窗口->限流 分布式信号量->限并发的原理 lua脚本分析介绍
文章目录 前言限流限制并发的实际理解限流令牌桶代码实现结果分析令牌桶lua的模拟实现原理总结: 滑动窗口代码实现结果分析lua脚本原理解析 限并发分布式信号量代码实现结果分析lua脚本实现原理 双注解去实现限流 并发结果分析: 实际业务去理解体会统一注…...
Typeerror: cannot read properties of undefined (reading ‘XXX‘)
最近需要在离线机器上运行软件,所以得把软件用docker打包起来,大部分功能都没问题,出了一个奇怪的事情。同样的代码,在本机上用vscode可以运行起来,但是打包之后在docker里出现了问题。使用的是dialog组件,…...
技术栈RabbitMq的介绍和使用
目录 1. 什么是消息队列?2. 消息队列的优点3. RabbitMQ 消息队列概述4. RabbitMQ 安装5. Exchange 四种类型5.1 direct 精准匹配5.2 fanout 广播5.3 topic 正则匹配 6. RabbitMQ 队列模式6.1 简单队列模式6.2 工作队列模式6.3 发布/订阅模式6.4 路由模式6.5 主题模式…...
脑机新手指南(七):OpenBCI_GUI:从环境搭建到数据可视化(上)
一、OpenBCI_GUI 项目概述 (一)项目背景与目标 OpenBCI 是一个开源的脑电信号采集硬件平台,其配套的 OpenBCI_GUI 则是专为该硬件设计的图形化界面工具。对于研究人员、开发者和学生而言,首次接触 OpenBCI 设备时,往…...
DBLP数据库是什么?
DBLP(Digital Bibliography & Library Project)Computer Science Bibliography是全球著名的计算机科学出版物的开放书目数据库。DBLP所收录的期刊和会议论文质量较高,数据库文献更新速度很快,很好地反映了国际计算机科学学术研…...
小木的算法日记-多叉树的递归/层序遍历
🌲 从二叉树到森林:一文彻底搞懂多叉树遍历的艺术 🚀 引言 你好,未来的算法大神! 在数据结构的世界里,“树”无疑是最核心、最迷人的概念之一。我们中的大多数人都是从 二叉树 开始入门的,它…...
Spring Boot + MyBatis 集成支付宝支付流程
Spring Boot MyBatis 集成支付宝支付流程 核心流程 商户系统生成订单调用支付宝创建预支付订单用户跳转支付宝完成支付支付宝异步通知支付结果商户处理支付结果更新订单状态支付宝同步跳转回商户页面 代码实现示例(电脑网站支付) 1. 添加依赖 <!…...
Oracle实用参考(13)——Oracle for Linux物理DG环境搭建(2)
13.2. Oracle for Linux物理DG环境搭建 Oracle 数据库的DataGuard技术方案,业界也称为DG,其在数据库高可用、容灾及负载分离等方面,都有着非常广泛的应用,对此,前面相关章节已做过较为详尽的讲解,此处不再赘述。 需要说明的是, DG方案又分为物理DG和逻辑DG,两者的搭建…...
