Kubernetes的hostpath创建pv和pvc的验证---以部署halo博客系统为例

news2024/11/26 16:42:06

结论:hostapath作为一种存储类型是支持使用pv及pvc声明使用的。


缘由:最近在寻求云计算方向的运维管理岗位,周五晚上参加了一个头部大厂的西安岗位电面,面试人似乎不情愿作为本场考评的面试官,我在电子会议等了大约17分钟对方才姗姗迟来,张口就问H厂计算产品的各部件工作原理是什么(恕我已经在工作简历中描述清楚了,我只是部署使用过H厂的产品,在公开的技术资料中并未见到各部件的工作原理详细描述,因为各厂商都宣称自己的产品基于开源产品进行了深度重构,并以商业机密为由拒绝披露),在谈到Kubernetes云原生的存储实现时,对方趾高气扬地打断我道:hostpath不能使用pvc动态申明使用。昨天我查阅了Kubernetes的产品文档、专题书籍和相关的博客文章均为明确定义hostpath不能使用pvc动态申明使用 ,最多的描述是在业务生产环境中不建议使用hostapath作为存储。


好吧,实践是检验真理正确与否的唯一标准,到实验靶场上验证一下使用hostapath 做 k8s-APP 的持久化存储是否可行就一清二楚了。

Kubernetes靶场环境:

1master和2slave组成最小化集群,宿主机OS为CentOS7-2207版本,搭建的Kubernetes集群是 基于containerd的 version 1.28.0 版本的。
宿主机规格为 2C/2G、20GB硬盘。

具体操作过程描述如下:

1 使用 crictl image pull 拉取 halo 的docker镜像到本地镜像仓库;

2 编写 Kubernetes-APP 的 yaml配置文件
halo-deployment.yaml
halo-deployment.yaml.original
halo-namespace.yaml
halo-network-service.yaml
halo-persistent-volume-claim.yaml
halo-persistent-volume.yaml

其中 halo-deployment.yaml.original 用于以非PV的形式部署 halo,目的在于验证 halo 是否可以运行再 containerd 上。

验证使用到配置文件的内容如下

slax@slax:~/k8s部署halo博客$
slax@slax:~/k8s部署halo博客$ cat halo-namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: halo
labels:
name: halo
slax@slax:~/k8s部署halo博客$
slax@slax:~/k8s部署halo博客$ cat halo-persistent-volume.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: root-halo
namespace: halo
spec:
capacity:
storage: 2Gi
accessModes:

  • ReadWriteOnce
    persistentVolumeReclaimPolicy: Recycle
    hostPath:
    path: /home/centos7-00/k8shostpath/halo
    slax@slax:~/k8s部署halo博客$
    slax@slax:~/k8s部署halo博客$ cat halo-persistent-volume-claim.yaml
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    name: root-halo
    namespace: halo
    spec:
    accessModes:
  • ReadWriteOnce
    resources:
    requests:
    storage: 2Gi
    slax@slax:~/k8s部署halo博客$
    slax@slax:~/k8s部署halo博客$ cat halo-deployment.yaml
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    labels:
    app: halo
    name: halo-deployment20231028
    namespace: halo
    spec:
    replicas: 1
    selector:
    matchLabels:
    app: halo
    template:
    metadata:
    labels:
    app: halo
    spec:
    containers:
  • image: docker.io/halohub/halo
    ports:
  • containerPort: 80
    name: halo
    volumeMounts:
  • name: root-halo
    mountPath: /root/.halo2
    volumes:
  • name: root-halo
    persistentVolumeClaim:
    claimName: root-halo
    slax@slax:~/k8s部署halo博客$
    slax@slax:~/k8s部署halo博客$ cat halo-network-service.yaml
    apiVersion: v1
    kind: Service
    metadata:
    labels:
    app: halo
    name: halo-deployment20231028
    namespace: halo
    spec:
    ports:
  • port: 8090
    name: halo-network-service80
    protocol: TCP
    targetPort: 8090
    nodePort: 30009
    selector:
    app: halo
    type: NodePort
    slax@slax:~/k8s部署halo博客$

3 创建 namespace

4 创建 pv

5 创建 pvc

6 创建 deployment

7 创建 service

具体操作过程如下:

[root@master0 centos7-00]#
[root@master0 centos7-00]# ls -F Working/
halo-deployment.yaml halo-deployment.yaml.original
halo-namespace.yaml halo-network-service.yaml
halo-persistent-volume-claim.yaml halo-persistent-volume.yaml
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl create -f
Working/halo-namespace.yaml
namespace/halo created
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl get namespaces
NAME STATUS AGE
default Active 44dhalo Active 14s
kube-flannel Active 44d
kube-node-lease Active 44d
kube-public Active 44d
kube-system Active 44d
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl describe namespace halo
Name: halo
Labels: kubernetes.io/metadata.name=halo
name=halo
Annotations:
Status: Active
No resource quota.
No LimitRange resource.
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl create -f
Working/halo-persistent-volume.yaml
persistentvolume/root-halo created
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl get pv -n halo
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM
STORAGECLASS REASON AGE
root-halo 2Gi RWO Recycle Bound
halo/root-halo 58s
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl create -f
Working/halo-persistent-volume-claim.yamlpersistentvolumeclaim/root-halo created
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl get pvc -n halo
NAME STATUS VOLUME CAPACITY ACCESS MODES
STORAGECLASS AGE
root-halo Bound root-halo 2Gi RWO
36s
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl create -f
Working/halo-deployment.yaml
deployment.apps/halo-deployment20231028 created
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl get pods -n halo
NAME READY STATUS
RESTARTS AGE
halo-deployment20231028-7c46d785c7-72hxf 1/1 Running 0
19s
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl describe deployment
halo-deployment20231028 -n halo
Name: halo-deployment20231028
Namespace: halo
CreationTimestamp: Sun, 29 Oct 2023 12:24:53 +0800
Labels: app=halo
Annotations: deployment.kubernetes.io/revision: 1
Selector: app=halo
Replicas: 1 desired | 1 updated | 1 total | 1 available
| 0 unavailable
StrategyType: RollingUpdateMinReadySeconds: 0
RollingUpdateStrategy: 25% max unavailable, 25% max surge
Pod Template:
Labels: app=halo
Containers:
halo:
Image: docker.io/halohub/halo
Port: 80/TCP
Host Port: 0/TCP
Environment:
Mounts:
/root/.halo2 from root-halo (rw)
Volumes:
root-halo:
Type: PersistentVolumeClaim (a reference to a
PersistentVolumeClaim in the same namespace)
ClaimName: root-halo
ReadOnly: false
Conditions:
Type Status Reason


Available True MinimumReplicasAvailable
Progressing True NewReplicaSetAvailable
OldReplicaSets:
NewReplicaSet: halo-deployment20231028-7c46d785c7 (1/1 replicas
created)
Events:
Type Reason Age From Message
—— ——— —— —— ———-Normal ScalingReplicaSet 5m40s deployment-controller Scaled up
replica set halo-deployment20231028-7c46d785c7 to 1
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl describe pod
halo-deployment20231028-7c46d785c7-72hxf -n halo
Name: halo-deployment20231028-7c46d785c7-72hxf
Namespace: halo
Priority: 0
Service Account: default
Node: slave1/192.168.136.152
Start Time: Sun, 29 Oct 2023 12:24:54 +0800
Labels: app=halo
pod-template-hash=7c46d785c7
Annotations:
Status: Running
IP: 10.244.2.3
IPs:
IP: 10.244.2.3
Controlled By: ReplicaSet/halo-deployment20231028-7c46d785c7
Containers:
halo:
Container ID:
containerd://5b908410f29ec3aa2ba55613842a69c105320d8aa633cd7acc12e3e
8afcb5a78
Image: docker.io/halohub/halo
Image ID:
docker.io/halohub/halo@sha256:994537a47aff491b29251665dc86ef2a87bd70
00516c330b5e636ca4b029d35c
Port: 80/TCPHost Port: 0/TCP
State: Running
Started: Sun, 29 Oct 2023 12:25:10 +0800
Ready: True
Restart Count: 0
Environment:
Mounts:
/root/.halo2 from root-halo (rw)
/var/run/secrets/kubernetes.io/serviceaccount from
kube-api-access-m7lqg (ro)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
root-halo:
Type: PersistentVolumeClaim (a reference to a
PersistentVolumeClaim in the same namespace)
ClaimName: root-halo
ReadOnly: false
kube-api-access-m7lqg:
Type: Projected (a volume that contains injected
data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional:
DownwardAPI: trueQoS Class: BestEffort
Node-Selectors:
Tolerations: node.kubernetes.io/not-ready:NoExecute
op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message


Normal Scheduled 7m23s default-scheduler Successfully assigned
halo/halo-deployment20231028-7c46d785c7-72hxf to slave1
Normal Pulling 7m23s kubelet Pulling image
“docker.io/halohub/halo”
Normal Pulled 7m7s kubelet Successfully pulled
image “docker.io/halohub/halo” in 15.665s (15.665s including waiting)
Normal Created 7m7s kubelet Created container halo
Normal Started 7m7s kubelet Started container halo
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl create -f
Working/halo-network-service.yaml
service/halo-deployment20231028 created
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl get services -n halo
NAME TYPE CLUSTER-IP EXTERNAL-IP
PORT(S) AGE
halo-deployment20231028 NodePort 10.108.173.68
8090:30009/TCP 27s
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl describe servicehalo-deployment20231028 -n halo
Name: halo-deployment20231028
Namespace: halo
Labels: app=halo
Annotations:
Selector: app=halo
Type: NodePort
IP Family Policy: SingleStack
IP Families: IPv4
IP: 10.108.173.68
IPs: 10.108.173.68
Port: halo-network-service80 8090/TCP
TargetPort: 8090/TCP
NodePort: halo-network-service80 30009/TCP
Endpoints: 10.244.2.3:8090
Session Affinity: None
External Traffic Policy: Cluster
Events:
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl get pod -n halo
NAME READY STATUS
RESTARTS AGE
halo-deployment20231028-7c46d785c7-72hxf 1/1 Running 0
12m
[root@master0 centos7-00]#
[root@master0 centos7-00]# kubectl logs -f -n halo
halo-deployment20231028-7c46d785c7-72hxf
/ / / /_ / /__
/ // / `/ / \
/ __ / /
/ / / // /
/
/ //__,//___/
Version: 1.4.16
2023-10-29 12:25:13.363 INFO 7 —- [ main]
run.halo.app.Application : Starting Application
v1.4.16 using Java 11.0.11 on halo-deployment20231028-7c46d785c7-72hxf
with PID 7 (/application/BOOT-INF/classes started by root in
/application)
2023-10-29 12:25:13.365 INFO 7 —- [ main]
run.halo.app.Application : No active profile set,
falling back to default profiles: default
2023-10-29 12:25:15.203 INFO 7 —-
[ main] .s.d.r.c.RepositoryConfigurationDelegate :
Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2023-10-29 12:25:15.441 INFO 7 —-
[ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished
Spring Data repository scanning in 225 ms. Found 22 JPA repository
interfaces.
2023-10-29 12:25:17.525 INFO 7 —- [ main]
org.eclipse.jetty.util.log : Logging initialized @6453ms
to org.eclipse.jetty.util.log.Slf4jLog
2023-10-29 12:25:17.898 INFO 7 —- [ main]
o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port:
8090
2023-10-29 12:25:17.921 INFO 7 —- [ main]
org.eclipse.jetty.server.Server : jetty-9.4.42.v20210604;built: 2021-06-04T17:33:38.939Z; git:
5cd5e6d2375eeab146813b0de9f19eda6ab6e6cb; jvm 11.0.11+9
2023-10-29 12:25:18.045 INFO 7 —- [ main]
o.e.j.s.h.ContextHandler.application : Initializing Spring
embedded WebApplicationContext
2023-10-29 12:25:18.046 INFO 7 —- [ main]
w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext:
initialization completed in 4598 ms
2023-10-29 12:25:18.524 INFO 7 —- [ main]
run.halo.app.config.HaloConfiguration : Halo cache store load impl :
[class run.halo.app.cache.InMemoryCacheStore]
2023-10-29 12:25:18.778 INFO 7 —- [ main]
com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting…
2023-10-29 12:25:19.209 INFO 7 —- [ main]
com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start
completed.
2023-10-29 12:25:20.136 INFO 7 —- [ main]
o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing
PersistenceUnitInfo [name: default]
2023-10-29 12:25:20.216 INFO 7 —- [ main]
org.hibernate.Version : HHH000412: Hibernate ORM
core version 5.4.32.Final
2023-10-29 12:25:20.299 INFO 7 —- [ main]
o.hibernate.annotations.common.Version : HCANN000001: Hibernate
Commons Annotations {5.1.2.Final}
2023-10-29 12:25:20.609 INFO 7 —- [ main]
org.hibernate.dialect.Dialect : HHH000400: Using dialect:
org.hibernate.dialect.H2Dialect
2023-10-29 12:25:22.775 INFO 7 —- [ main]o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using
JtaPlatform implementation:
[org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatfor
m]
2023-10-29 12:25:22.789 INFO 7 —- [ main]
j.LocalContainerEntityManagerFactoryBean : Initialized JPA
EntityManagerFactory for persistence unit ‘default’
2023-10-29 12:25:24.479 INFO 7 —- [ main]
org.eclipse.jetty.server.session : DefaultSessionIdManager
workerName=node0
2023-10-29 12:25:24.480 INFO 7 —- [ main]
org.eclipse.jetty.server.session : No SessionScavenger set,
using defaults
2023-10-29 12:25:24.480 INFO 7 —- [ main]
org.eclipse.jetty.server.session : node0 Scavenging every
660000ms
2023-10-29 12:25:24.494 INFO 7 —- [ main]
o.e.jetty.server.handler.ContextHandler : Started
o.s.b.w.e.j.JettyEmbeddedWebAppContext@2cc3df02{application,/,[file:
///tmp/jetty-docbase.8090.3227147541353187501/,
jar:file:/application/BOOT-INF/lib/springfox-swagger-ui-3.0.0.jar!/M
ETA-INF/resources],AVAILABLE}
2023-10-29 12:25:24.494 INFO 7 —- [ main]
org.eclipse.jetty.server.Server : Started @13424ms
2023-10-29 12:25:25.565 INFO 7 —- [ main]
run.halo.app.handler.file.FileHandlers : Registered 9 file
handler(s)
2023-10-29 12:25:29.824 INFO 7 —- [ main]
o.s.b.a.e.web.EndpointLinksResolver : Exposing 4 endpoint(s)beneath base path ‘/api/admin/actuator’
2023-10-29 12:25:29.887 INFO 7 —- [ main]
o.e.j.s.h.ContextHandler.application : Initializing Spring
DispatcherServlet ‘dispatcherServlet’
2023-10-29 12:25:29.887 INFO 7 —- [ main]
o.s.web.servlet.DispatcherServlet : Initializing Servlet
‘dispatcherServlet’
2023-10-29 12:25:29.889 INFO 7 —- [ main]
o.s.web.servlet.DispatcherServlet : Completed initialization in
1 ms
2023-10-29 12:25:29.898 INFO 7 —- [ main]
o.e.jetty.server.AbstractConnector : Started
ServerConnector@2f8c4fae{HTTP/1.1, (http/1.1)}{0.0.0.0:8090}
2023-10-29 12:25:29.899 INFO 7 —- [ main]
o.s.b.web.embedded.jetty.JettyWebServer : Jetty started on port(s)
8090 (http/1.1) with context path ‘/‘
2023-10-29 12:25:29.948 INFO 7 —- [ main]
run.halo.app.Application : Started Application in
18.115 seconds (JVM running for 18.879)
2023-10-29 12:25:29.953 INFO 7 —- [ main]
run.halo.app.listener.StartedListener : Starting migrate
database…
2023-10-29 12:25:30.080 INFO 7 —- [ main]
o.f.c.internal.license.VersionPrinter : Flyway Community Edition
7.5.1 by Redgate
2023-10-29 12:25:30.100 INFO 7 —- [ main]
o.f.c.i.database.base.DatabaseType : Database:
jdbc:h2:file:/root/.halo//db/halo (H2 1.4)
2023-10-29 12:25:30.120 INFO 7 —- [ main]o.f.c.i.s.JdbcTableSchemaHistory : Repair of failed migration
in Schema History table “PUBLIC”.”flyway_schema_history” not necessary
as table doesn’t exist.
2023-10-29 12:25:30.154 INFO 7 —- [ main]
o.f.core.internal.command.DbRepair : Successfully repaired
schema history table “PUBLIC”.”flyway_schema_history” (execution time
00:00.036s).
2023-10-29 12:25:30.169 INFO 7 —- [ main]
o.f.c.internal.license.VersionPrinter : Flyway Community Edition
7.5.1 by Redgate
2023-10-29 12:25:30.196 INFO 7 —- [ main]
o.f.core.internal.command.DbValidate : Successfully validated 4
migrations (execution time 00:00.016s)
2023-10-29 12:25:30.245 INFO 7 —- [ main]
o.f.c.i.s.JdbcTableSchemaHistory : Creating Schema History
table “PUBLIC”.”flyway_schema_history” with baseline …
2023-10-29 12:25:30.321 INFO 7 —- [ main]
o.f.core.internal.command.DbBaseline : Successfully baselined
schema with version: 1
2023-10-29 12:25:30.359 INFO 7 —- [ main]
o.f.core.internal.command.DbMigrate : Current version of schema
“PUBLIC”: 1
2023-10-29 12:25:30.363 INFO 7 —- [ main]
o.f.core.internal.command.DbMigrate : Migrating schema “PUBLIC”
to version “2 - migrate 1.2.0-beta.1 to 1.2.0-beta.2”
2023-10-29 12:25:30.421 INFO 7 —- [ main]
o.f.core.internal.command.DbMigrate : Migrating schema “PUBLIC”
to version “3 - migrate 1.3.0-beta.1 to 1.3.0-beta.2”
2023-10-29 12:25:30.562 INFO 7 —- [ main]o.f.core.internal.command.DbMigrate : Migrating schema “PUBLIC”
to version “4 - migrate 1.3.0-beta.2 to 1.3.0-beta.3”
2023-10-29 12:25:30.609 INFO 7 —- [ main]
o.f.core.internal.command.DbMigrate : Successfully applied 3
migrations to schema “PUBLIC” (execution time 00:00.269s)
2023-10-29 12:25:30.611 INFO 7 —- [ main]
run.halo.app.listener.StartedListener : Migrate database succeed.
2023-10-29 12:25:30.612 INFO 7 —- [ main]
run.halo.app.listener.StartedListener : Created backup directory:
[/tmp/halo-backup]
2023-10-29 12:25:30.612 INFO 7 —- [ main]
run.halo.app.listener.StartedListener : Created data export
directory: [/tmp/halo-data-export]
2023-10-29 12:25:30.740 INFO 7 —- [ main]
run.halo.app.listener.StartedListener : Copied theme folder from
[/application/BOOT-INF/classes/templates/themes] to
[/root/.halo/templates/themes/caicai_anatole]
2023-10-29 12:25:30.792 INFO 7 —- [ main]
run.halo.app.listener.StartedListener : Halo started at
http://127.0.0.1:8090
2023-10-29 12:25:30.792 INFO 7 —- [ main]
run.halo.app.listener.StartedListener : Halo admin started at
http://127.0.0.1:8090/admin
2023-10-29 12:25:30.792 INFO 7 —- [ main]
run.halo.app.listener.StartedListener : Halo has started
successfully!
^C
[root@master0 centos7-00]#

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

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

相关文章

C++ 动态规划 DP教程 (一)思考过程(*/ω\*)

动态规划是一种思维方法,大家首先要做的就是接受这种思维方法,认同他,然后再去运用它解决新问题。 动态规划是用递推的思路去解决问题。 首先确定问题做一件什么事情? 对这件事情分步完成,分成很多步。 如果我们把整件…

【0基础学Java第三课】-- 运算符

3. 运算符 3.1 什么是运算符3.2 算术运算符3.2.1 **基本四则运算符:加减乘除模( - * / %)**3.2.2 增量运算符 - * %3.2.3 自增/自减运算符 -- 3.3 关系运算符3.4逻辑运算符(重点)3.4.1 逻辑与 &&3.4.2 逻辑 ||3.4.3逻辑非 !3.4.4 短路求值 3.5 …

Lauterbach使用指南之RunTime功能

Lauterbach使用指南之RunTime功能 前言 首先,请问大家几个小小问题,你清楚: Lauterbach这个工具是干什么用的吗?在软件运行过程中如何测量两个运行point之间的runtime时间呢?Lauterbach的RunTime功能具体应当如何来操…

Linux中shell脚本的基础知识

目录 一、shell脚本的意义 二、如何创建shell脚本 三、如何执行shell脚本 四、如何对脚本进行调试 五、练习 一、shell脚本的意义 1、shell:脚本中命令的解释器 2、脚本的意义: 记录命令执行的过程和执行逻辑,以便以后重复执行脚本可以…

matlabR2021a正版免费使用

目录 matlab介绍: 安装: matlab介绍: MATLAB(Matrix Laboratory的缩写)是一种高级技术计算和编程环境,由MathWorks公司开发。它在科学、工程、数据分析和数学建模领域中广泛应用,为用户提供了…

【RTOS学习】互斥管理 | 调试 | 信息统计

🐱作者:一只大喵咪1201 🐱专栏:《RTOS学习》 🔥格言:你只管努力,剩下的交给时间! 互斥管理 | 调试 | 信息统计 🍉互斥管理🌰屏蔽中断🌰暂停调度器…

VMware Horizon 8 2309 Enterprise虚拟桌面

VMware Horizon 8 2309 Enterprise虚拟桌面 一、虚拟桌面二、产品发布三、VMware Horizon 8 2309 Enterprise1.VMware Horizon 8 2309 Enterprise产品清单2.安装部署3. 优化工具总结 一、虚拟桌面 利用虚拟桌面和应用随时随地进行访问。 从云端进行管理 使用云端控制台和 Saa…

IO线程及相关函数

进程是资源分配的最小单位,线程是cpu调度的最小单位 一、概念: 线程指的是共享相同地址空间的多个任务 是一个轻量级的进程,为了提高系统的性能引入线程,线程和进程都参与统一的调度 在同一个进程中创建的线程共享该进程的地址空间…

预制菜配送小程序商城的效果如何

预制菜是近些年热度较高的新赛道,很多商家品牌入局,而投入到市场中也受到不少商家的喜欢,各种品牌和经销商层出不穷,目前各品牌主要以拓展市场和研究菜品为主,而线上无疑是很好的宣传销售渠道。 接下来让我们看看通过…

搭建gnn环境

1.无法激活 激活pytorch遇到报错usage: conda-script.py [-h] [--no-plugins] [-V] COMMAND ... conda-script.py: error: arg-CSDN博客 参考教程 【精选】手把手教你在windows10安装GNN相关环境(torchtorch_geometricrdkitdeepchem)_gnn环境相关的包-…

Docker Consul概述及构建

Docker Consul概述及构建 一、Consul概述1.1、什么是Consul1.2、consul 容器服务更新与发现1.3、服务注册与发现的含义1.4、consul-template概述1.5、registrator的作用 二、consul部署2.1、环境配置2.2、在主节点上部署consul2.3 、配置容器服务自动加入nginx集群2.3.1、安装G…

【Linux】:进程程序替换

进程程序替换 一.替换原理二.替换函数三.exec类函数 一.替换原理 用fork创建子进程后执行的是和父进程相同的程序(但有可能执行不同的代码分支),子进程往往要调用一种exec函数以执行另一个程序。当进程调用一种exec函数时,该进程的用户空间代码和数据完全…

CleanMyMac X2024永久免费版mac电脑管家

日常使用中,很多用户忽略了Mac清除数据的重要性。当Mac运行速度越来越慢,发热严重,储存空间总是不足的时候,才意识到保持日常清理才是解决这些问题的根本。经常清理Mac,还有你意想不到的好处。 提高系统性能&#xff…

React-快速搭建开发环境

1.安装 说明:react-excise-01是创建的文件名 npx create-react-app react-excise-01 2. 打开文件 说明:we suggest that you begin by typing:下面即是步骤。 cd react-excise-01 npm start 3.显示

HIT_OS_LAB1 调试分析 Linux 0.00 引导程序

操作系统实验一 姓名:董帅学号:2021111547班级:21R0312 1.1 实验目的 熟悉实验环境掌握如何手写Bochs虚拟机的配置文件掌握Bochs虚拟机的调试技巧掌握操作系统启动的步骤 1.2 实验内容 1.2.1 掌握如何手写Bochs虚拟机的配置文件 boot: f…

拉扎维模拟CMOS集成电路设计西交张鸿老师课程P10~13视频学习记录

--------------------------------------------------------------------------------------------------------------------------------- p10 短沟道,除了沟长调,还可能出现速度饱和问题; 但是在拉扎维这本书里面没有考虑这个问题&#…

python随手小练12(南农作业题)

题目: 设有四个字母:a bcd,能组成多少个互不相同且无重复数字的三个字母的单词?各是什么? 解题思路:遍历全部可能的组合,把有重复的删除 具体操作: total 0 s [0, a, b, c, d] #注意:不能写成[0, a, b, c, d] for i in range(1, 5): …

为什么数组的下标是从0开始呢?

我们在许多的编程语言中,大部分的数组下标都是从零开始的,那为什么不是从一开始的呢? 首先我们,先要了解数组相关的定义。 数组(Array)是一种线性表数据结构。它用一组连续的内存空间,来存储一…

关于FTP的一些往事

公司每天都要从美国的服务器下载大量的语音文件。然后根据语音的内容完成相关的医疗报告。不同语音的实时性要求是不一样的,有些要求6小时内完成(TAT6) ,有些则是12小时。中美之间的网速又特别慢,所以,如何…

计算机网络基础三

课程目标 理解路由表的作用 能够读懂路由表信息 能够使用图形抓包工具 wireshark 进行数据包的抓取 ,如( TCP/IP 的三次握手四次断开) 一、路由表 思考: 什么是交换,什么是路由,什么是路由表?1. 交换是指同网络访…