安装Harbor

前言

Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器,虽然Docker官方也提供了公共的镜像仓库,但是从安全和效率等方面考虑,部署企业内部的私有环境Registry是非常必要的,Harbor和docker中央仓库的关系,就类似于nexus和Maven中央仓库的关系,Harbor除了存储和分发镜像外还具有用户管理,项目管理,配置管理和日志查询,高可用部署等主要功能。

安装Harbor

安装之前需要安装Docker和Docker-Compose,本文不再赘述。版本查看:

[root@localhost harbor]# docker version
Client: Docker Engine - CommunityVersion:           23.0.2API version:       1.42Go version:        go1.19.7Git commit:        569dd73Built:             Mon Mar 27 16:18:54 2023OS/Arch:           linux/amd64Context:           defaultServer: Docker Engine - CommunityEngine:Version:          23.0.2API version:      1.42 (minimum version 1.12)Go version:       go1.19.7Git commit:       219f21bBuilt:            Mon Mar 27 16:16:31 2023OS/Arch:          linux/amd64Experimental:     falsecontainerd:Version:          1.6.20GitCommit:        2806fc1057397dbaeefbea0e4e17bddfbd388f38runc:Version:          1.1.5GitCommit:        v1.1.5-0-gf19387adocker-init:Version:          0.19.0GitCommit:        de40ad0[root@localhost harbor]# docker compose version
Docker Compose version v2.20.2

下载Harbor压缩包并解压,

下载地址

 如果虚拟机网络可以到底互联网,可以使用下载。

wget https://github.com/goharbor/harbor/releases/download/v2.8.3/harbor-offline-installer-v2.8.3.tgz
[root@localhost harbor]# ls
harbor-offline-installer-v2.8.3.tgz
[root@localhost harbor]# pwd
/root/harbor
[root@localhost harbor]# mkdir /opt/install
[root@localhost harbor]# tar -xzf harbor-offline-installer-v2.8.3.tgz -C /opt/install

修改Harbor的配置

[root@localhost harbor]# cd /opt/install/harbor
[root@localhost harbor]# ls
common.sh  harbor.v2.8.3.tar.gz  harbor.yml  harbor.yml.tmpl  input  install.sh  LICENSE  prepare
[root@localhost harbor]# cp harbor.yml.tmpl harbor.yml[root@localhost harbor]# cat harbor.yml
# Configuration file of Harbor# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: 192.168.56.100# http related config
http:# port for http, default is 80. If https enabled, this port will redirect to https portport: 85
# https related config
https:# https port for harbor, default is 443
#  port: 443
## The path of cert and key files for nginx
#  certificate: /your/certificate/path
#  private_key: /your/private/key/path

安装Harbor

[root@localhost harbor]# ./prepare
prepare base dir is set to /opt/install/harbor
Unable to find image 'goharbor/prepare:v2.8.3' locally
v2.8.3: Pulling from goharbor/prepare
64766fbe86f3: Pull complete 
5e8573822658: Pull complete 
b325f953ccaa: Pull complete 
4a61406f052d: Pull complete 
35af786c7219: Pull complete 
9e054aa5e0c4: Pull complete 
ac0b5dc3429a: Pull complete 
c1fcbc663df3: Pull complete 
35ef2e38ddee: Pull complete 
2a411a6b181f: Pull complete 
Digest: sha256:31b05f630675290977311f476bafba9406539c73aaa773f27fbe8a295cda184a
Status: Downloaded newer image for goharbor/prepare:v2.8.3
WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
Generated configuration file: /config/portal/nginx.conf
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/registryctl/config.yml
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
Generated and saved secret to file: /data/secret/keys/secretkey
Successfully called func: create_root_cert
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir
[root@localhost harbor]# ./install.sh[Step 0]: checking if docker is installed ...Note: docker version: 23.0.2[Step 1]: checking docker-compose is installed ...Note: Docker Compose version v2.20.2[Step 2]: loading Harbor images ...
176a9faee2d2: Loading layer [==================================================>]  6.176MB/6.176MB
7533b07674a0: Loading layer [==================================================>]  4.096kB/4.096kB
9ab27df52911: Loading layer [==================================================>]  3.072kB/3.072kB
457b8a810324: Loading layer [==================================================>]  17.57MB/17.57MB
8ade677a8a4b: Loading layer [==================================================>]  18.36MB/18.36MB
Loaded image: goharbor/registry-photon:v2.8.3
ae6af9dcdf7c: Loading layer [==================================================>]  6.171MB/6.171MB
d9b2d282124e: Loading layer [==================================================>]  9.098MB/9.098MB
71d01ecf12a5: Loading layer [==================================================>]  15.88MB/15.88MB
a93bf4c4de26: Loading layer [==================================================>]  29.29MB/29.29MB
d6ccdcf712be: Loading layer [==================================================>]  22.02kB/22.02kB
20d0340657f4: Loading layer [==================================================>]  15.88MB/15.88MB
Loaded image: goharbor/notary-server-photon:v2.8.3
7076e9de5fb2: Loading layer [==================================================>]  6.171MB/6.171MB
06edddd4eeea: Loading layer [==================================================>]  9.098MB/9.098MB
4c8df5f33db0: Loading layer [==================================================>]  14.47MB/14.47MB
7bf292abe752: Loading layer [==================================================>]  29.29MB/29.29MB
ac4de38627ae: Loading layer [==================================================>]  22.02kB/22.02kB
687c00954816: Loading layer [==================================================>]  14.47MB/14.47MB
Loaded image: goharbor/notary-signer-photon:v2.8.3
ab5bc430313c: Loading layer [==================================================>]  90.16MB/90.16MB
dc3ba398e48c: Loading layer [==================================================>]  3.584kB/3.584kB
d26b379ad813: Loading layer [==================================================>]  3.072kB/3.072kB
93e3e2322706: Loading layer [==================================================>]   2.56kB/2.56kB
0bf9c54793f1: Loading layer [==================================================>]  3.072kB/3.072kB
2742f8f52b00: Loading layer [==================================================>]  3.584kB/3.584kB
299dda8831bd: Loading layer [==================================================>]  20.48kB/20.48kB
Loaded image: goharbor/harbor-log:v2.8.3
02ddc8ed9baf: Loading layer [==================================================>]   85.6MB/85.6MB
377838d34c47: Loading layer [==================================================>]  3.072kB/3.072kB
1bda8bcd6461: Loading layer [==================================================>]   59.9kB/59.9kB
90ea325b2c6d: Loading layer [==================================================>]  61.95kB/61.95kB
Loaded image: goharbor/redis-photon:v2.8.3
3996ab5000eb: Loading layer [==================================================>]  9.188MB/9.188MB
03553e550818: Loading layer [==================================================>]  3.584kB/3.584kB
9f2717a623b0: Loading layer [==================================================>]   2.56kB/2.56kB
ce715e5a53cf: Loading layer [==================================================>]  47.46MB/47.46MB
9505353423e5: Loading layer [==================================================>]  48.25MB/48.25MB
Loaded image: goharbor/harbor-jobservice:v2.8.3
Loaded image: goharbor/prepare:v2.8.3
b99dc282b3c7: Loading layer [==================================================>]  9.188MB/9.188MB
786372442d5c: Loading layer [==================================================>]  3.584kB/3.584kB
c95eff9c3c92: Loading layer [==================================================>]   2.56kB/2.56kB
69a6620f70fd: Loading layer [==================================================>]  59.22MB/59.22MB
faee135ed65a: Loading layer [==================================================>]  5.632kB/5.632kB
b8228ebe38a4: Loading layer [==================================================>]  116.7kB/116.7kB
e2db669e8a7c: Loading layer [==================================================>]  44.03kB/44.03kB
1d973fccb394: Loading layer [==================================================>]  60.17MB/60.17MB
747dd0c43ef1: Loading layer [==================================================>]   2.56kB/2.56kB
Loaded image: goharbor/harbor-core:v2.8.3
1122996461e4: Loading layer [==================================================>]  6.176MB/6.176MB
c11d210da0c1: Loading layer [==================================================>]  4.096kB/4.096kB
7abff3111e9b: Loading layer [==================================================>]  17.57MB/17.57MB
569fe4e2f2c9: Loading layer [==================================================>]  3.072kB/3.072kB
bca259d7c630: Loading layer [==================================================>]  31.01MB/31.01MB
2dda2be83cfd: Loading layer [==================================================>]  49.37MB/49.37MB
Loaded image: goharbor/harbor-registryctl:v2.8.3
825a82984415: Loading layer [==================================================>]  82.12MB/82.12MB
Loaded image: goharbor/nginx-photon:v2.8.3
39074d649f8c: Loading layer [==================================================>]  6.707MB/6.707MB
688b64470d74: Loading layer [==================================================>]  4.096kB/4.096kB
320f85b1e3eb: Loading layer [==================================================>]  3.072kB/3.072kB
dde1dfb74607: Loading layer [==================================================>]  194.8MB/194.8MB
229337a9e8cc: Loading layer [==================================================>]   14.1MB/14.1MB
8c74af69019d: Loading layer [==================================================>]  209.7MB/209.7MB
Loaded image: goharbor/trivy-adapter-photon:v2.8.3
74b07281d2e5: Loading layer [==================================================>]  82.12MB/82.12MB
751e146c3c0f: Loading layer [==================================================>]    6.1MB/6.1MB
2cbfa90aca6d: Loading layer [==================================================>]  1.233MB/1.233MB
Loaded image: goharbor/harbor-portal:v2.8.3
3a8f210ea3e0: Loading layer [==================================================>]  116.2MB/116.2MB
06434a1eae73: Loading layer [==================================================>]  25.18MB/25.18MB
0923361e26b9: Loading layer [==================================================>]   5.12kB/5.12kB
e4658596b9ef: Loading layer [==================================================>]  6.144kB/6.144kB
350bc2e11862: Loading layer [==================================================>]  3.072kB/3.072kB
54847be3f348: Loading layer [==================================================>]  2.048kB/2.048kB
67296b765de0: Loading layer [==================================================>]   2.56kB/2.56kB
136c1f931ee8: Loading layer [==================================================>]   2.56kB/2.56kB
c44a36e8102e: Loading layer [==================================================>]   2.56kB/2.56kB
60bcea6b0ccb: Loading layer [==================================================>]  9.728kB/9.728kB
Loaded image: goharbor/harbor-db:v2.8.3
85c2b8de0e50: Loading layer [==================================================>]  9.188MB/9.188MB
1fd29ea96459: Loading layer [==================================================>]  26.04MB/26.04MB
9154b665386d: Loading layer [==================================================>]  4.608kB/4.608kB
9e173c1e037d: Loading layer [==================================================>]  26.83MB/26.83MB
Loaded image: goharbor/harbor-exporter:v2.8.3[Step 3]: preparing environment ...[Step 4]: preparing harbor configs ...
prepare base dir is set to /opt/install/harbor
WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
Clearing the configuration file: /config/portal/nginx.conf
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/registry/passwd
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/db/env
Clearing the configuration file: /config/jobservice/env
Clearing the configuration file: /config/jobservice/config.yml
Generated configuration file: /config/portal/nginx.conf
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/registryctl/config.yml
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /data/secret/keys/secretkey
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dirNote: stopping existing Harbor instance ...[Step 5]: starting Harbor ...
[+] Running 10/10✔ Network harbor_harbor        Created                                                                                                                                                                    0.0s ✔ Container harbor-log         Started                                                                                                                                                                    0.4s ✔ Container harbor-portal      Started                                                                                                                                                                    1.1s ✔ Container registryctl        Started                                                                                                                                                                    1.1s ✔ Container redis              Started                                                                                                                                                                    0.9s ✔ Container registry           Started                                                                                                                                                                    0.9s ✔ Container harbor-db          Started                                                                                                                                                                    1.0s ✔ Container harbor-core        Started                                                                                                                                                                    1.3s ✔ Container harbor-jobservice  Started                                                                                                                                                                    1.6s ✔ Container nginx              Started                                                                                                                                                                    1.6s 
✔ ----Harbor has been installed and started successfully.----

查看docker compose状态:

[root@localhost harbor]# docker compose ls
NAME                STATUS              CONFIG FILES
harbor              running(9)          /opt/install/harbor/docker-compose.yml

常用启动停止命令

--启动
docker compose -f /opt/install/harbor/harbor.yml up -d
--停止
docker compose -f /opt/install/harbor/harbor.yml stop
--重启
docker compose -f /opt/install/harbor/harbor.yml restart

创建Harbor用户和项目

http://192.168.56.100:85/

 创建项目:tensquare

创建用户:XXXX 密码:XXXX

 项目分配用户:

 

选择对应的角色:

角色权限说明
访客对于指定项目拥有只读权限
开发人员对于指定项目拥有读写权限
维护人员对于指定项目拥有读写权限,创建 Webhooks
项目管理员除了读写权限,同时拥有用户管理/镜像扫描等管理权限

把镜像上传到Harbor

下面演示将192.168.56.100机器上的镜像webapp001上传到位于192.168.56.100机器上的Harbor。

在production-server机器上完成下面步骤:

(1) 把Harbor地址加入到Docker信任列表
# vim /etc/docker/daemon.json
{"registry-mirrors":["https://zydiol88.mirror.aliyuncs.com"],"insecure-registries":["192.168.56.100:85"]
}(2) 重启docker
systemctl restart docker(3) 登录Harbor
[root@localhost harbor]# docker login -u 用户名 -p 密码 192.168.56.100:85
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-storeLogin Succeeded(4) 给需要上传到Harbor的镜像打标签
docker tag webapp001:V1 192.168.56.100:85/tensquare/webapp001:v1.0(5) 推送镜像到Harbor
[root@localhost ~]# docker push 192.168.56.100:85/tensquare/webapp001:v1.0
The push refers to repository [192.168.56.100:85/tensquare/webapp001]
f732db36266b: Pushed 
ceaf9e1ebef5: Pushed 
9b9b7f3d56a0: Pushed 
f1b5933fe4b5: Pushed 
v1.0: digest: sha256:e29e461e556f9cae489d8af98380799497f7fe31089d9a9df051fcc3a6f3e9ae size: 1159

[root@localhost ~]# docker images
REPOSITORY                              TAG       IMAGE ID       CREATED         SIZE
192.168.56.100:85/tensquare/webapp001   v1.0      d0b3485e2db7   3 months ago    122MB
webapp001                               V1        d0b3485e2db7   3 months ago    122MB
webapp001                               latest    d0b3485e2db7   3 months ago    122MB
xlrl/mantisbt                           latest    95dc52690259   3 months ago    571MB
jenkinsci/blueocean                     latest    04540a0bb985   10 months ago   579MB
fjudith/draw.io                         latest    7905aa0f7047   2 years ago     684MB

从Harbor下载镜像

在需要从Harbor上拉取镜像的机器需要完成如下步骤

(1) 安装Docker,并启动Docker(2) 把Harbor地址加入到Docker信任列表
# vim /etc/docker/daemon.json
{"registry-mirrors":["https://zydiol88.mirror.aliyuncs.com"],"insecure-registries":["192.168.56.100:85"]
}(3) 重启docker
systemctl restart docker(4) 登录Harbor
[root@localhost docker]# docker login -u huan2.xu -p Hww911226 192.168.56.100:85
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-storeLogin Succeeded(5) 拉取镜像
[root@localhost docker]# docker pull 192.168.56.100:85/tensquare/webapp001@sha256:e29e461e556f9cae489d8af98380799497f7fe31089d9a9df051fcc3a6f3e9ae
192.168.56.100:85/tensquare/webapp001@sha256:e29e461e556f9cae489d8af98380799497f7fe31089d9a9df051fcc3a6f3e9ae: Pulling from tensquare/webapp001
e7c96db7181b: Pull complete 
f910a506b6cb: Pull complete 
c2274a1a0e27: Pull complete 
521c03dac675: Pull complete 
Digest: sha256:e29e461e556f9cae489d8af98380799497f7fe31089d9a9df051fcc3a6f3e9ae
Status: Downloaded newer image for 192.168.56.100:85/tensquare/webapp001@sha256:e29e461e556f9cae489d8af98380799497f7fe31089d9a9df051fcc3a6f3e9ae
192.168.56.100:85/tensquare/webapp001@sha256:e29e461e556f9cae489d8af98380799497f7fe31089d9a9df051fcc3a6f3e9ae
[root@localhost docker]# docker images
REPOSITORY                              TAG       IMAGE ID       CREATED        SIZE
192.168.56.100:85/tensquare/webapp001   <none>    d0b3485e2db7   3 months ago   122MB

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

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

相关文章

2023牛客多校第三场 B.Auspiciousness

传送门 前题提要:没得说,赛时根本没想到dp,赛后翻各大题解看了很久,终于懂了dp的做法,故准备写一篇题解. 首先,先定义一下我们的 d p dp dp方程,考虑将处于 [ 1 , n ] [1,n] [1,n]的数当做小数,将处于 [ n 1 , 2 ∗ n ] [n1,2*n] [n1,2∗n]的数当做大数.那么对于我们的摸牌结…

CEC2022代码(Matlab代码)及多种智能优化算法求解CEC2022

一、CEC2022测试函数 CEC2022测试集共有12个单目标测试函数&#xff0c;每个测试函数可选择的维度分别为10维、20维。该测试集合也是目前高质量论文应用最广泛的测试集&#xff0c;CEC2022测试集函数复杂&#xff0c;非常具有挑战力。 CEC2022测试函数与理论最优值 二、多种智…

hcip——ospf综合

要求 1. 搭建toop 2.地址规划 协议范围路由器地址 RIP 172.16.0.0 17 R12 loop0&#xff1a;172.16.0.0 24 loop1&#xff1a;172.16.1.0 24 OSPF 172.16.128.0 17 area1 172.16.144.0 20 R1 g0:172.16.144.1 24 loop0:172.16.145.1 24 R2 g0:172.16.144.2 24 loop:172…

微信小程序:实现提示窗确定,取消执行不同操作(消息提示确认取消)showModal

效果 代码 wx.showModal({title: 提示,content: 是否确认退出,success: function (res) {if (res.confirm) {console.log(用户点击确定)} else if (res.cancel) {console.log(用户点击取消)}}})

常用css 笔记

0、定义变量 :root { --primary-color: #007bff;} .button { background-color: var(--primary-color);} 1、水平垂直居中 div {width: 100px;height: 100px;position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto; }父级控制子集居中 .parent {display: fle…

【广州华锐互动】VR模拟灭火逃生体验系统

VR模拟灭火逃生体验系统由广州华锐互动开发&#xff0c;是一种基于虚拟现实技术的应急演练与培训系统&#xff0c;可以真实模拟消防逃生场景&#xff0c;让体验者在沉浸式的虚拟环境中&#xff0c;根据正确的消防逃生方法提示&#xff0c;进行自救演练。这种科学普及方法是更加…

【线程安全的讨论(一)】CPU多核缓存架构和JMM

CPU多核缓存架构 一、CPU多核缓存架构可见性问题乱序执行&#xff08;指令重排&#xff09; 二、JMM——Java内存模型 一、CPU多核缓存架构 计算机的基本组成图 CPU 缓存为了提高程序运行的性能&#xff0c;现代 CPU 在很多方面会对程序进行优化。CPU 的处理速度很快&#xf…

ICMP隐蔽隧道攻击分析与检测

• ICMP隧道攻击工具特征分析 一、原理 由于ICMP报文自身可以携带数据&#xff0c;而且ICMP报文是由系统内核处理的&#xff0c;不占用任何端口&#xff0c;因此具有很高的隐蔽性。 通过改变操作系统默认填充的Data&#xff0c;替换成自己构造的数据&#xff0c;这就是ICMP隐…

simulink与遗传算法结合求解TSP问题

前言&#xff1a;刚开始入门学习simulink&#xff0c;了解了基本的模块功能后想尝试从自己熟悉的领域入手&#xff0c;自己出题使用simulink搭建模型。选择的是TSP问题的遗传算法&#xff0c;考虑如何用simulink建模思想来实现一个简单TSP问题的遗传算法。 TSP问题描述 一个配…

【深度学习】基于图形的机器学习:概述

一、说明 图神经网络&#xff08;GNN&#xff09;在数据科学和机器学习中越来越受到关注&#xff0c;但在专家圈之外仍然知之甚少。为了掌握这种令人兴奋的方法&#xff0c;我们必须从更广泛的图形机器学习&#xff08;GML&#xff09;领域开始。许多在线资源谈论GNN和GML&…

SSIS对SQL Server向Mysql数据转发表数据 (一)

开发工具 Visual Stuido 2019 、SSIS、SQL Server 2016、Mysql 8.0.30 1、配置VS2019的添加相应的功能&#xff0c;勾选SQL Server Data Tools,下载就行我用的VS2019版本还需要下载下面几个插件&#xff0c;链接我放在下面了 Microsoft Analysis Services Projects - Visual St…

CSS伪元素详解以及伪元素与伪类的区别

伪元素常常被误解为伪类&#xff0c;主要在于他们的语法相似&#xff0c;都是对于选择器功能的扩展&#xff0c;相似程度很高导致被混淆。 本文通过详细介绍伪元素和常见的使用方法&#xff0c;最后也会分析下伪元素与伪类的基本区别。 基本描述 CSS伪元素也是应用于选择器的…

无线温湿度信息收集点模块的组成和工作状态及编程与组网建议

在传感技术与物联网的不断发展下&#xff0c;无线温湿度信息收集点模块作为一种重要的终端设备&#xff0c;被广泛应用于各个领域。本文将详细介绍该模块的组成和工作状态&#xff0c;并给出编程和组网的建议。 一、组成 该无线温湿度信息收集点模块由以下几个核心组成部分构成…

安卓:百度地图开发(超详细)

一、百度地图介绍 百度地图SDK是一套供开发者使用的软件开发工具包&#xff08;SDK&#xff09;&#xff0c;用于在Android应用程序中集成和使用百度地图功能。通过使用百度地图SDK&#xff0c;开发者可以实现在自己的应用中显示地图、获取定位信息、进行搜索、导航等功能。 百…

算法----二叉搜索树中第K小的元素

题目 二叉搜索树中第K小的元素 给定一个二叉搜索树的根节点 root &#xff0c;和一个整数 k &#xff0c;请你设计一个算法查找其中第 k 个最小元素&#xff08;从 1 开始计数&#xff09;。 示例 1&#xff1a; 输入&#xff1a;root [3,1,4,null,2], k 1 输出&#xff…

STL中的神秘“指针”:迭代器

&#x1f680;write in front&#x1f680; &#x1f4dc;所属专栏&#xff1a;C学习 &#x1f6f0;️博客主页&#xff1a;睿睿的博客主页 &#x1f6f0;️代码仓库&#xff1a;&#x1f389;VS2022_C语言仓库 &#x1f3a1;您的点赞、关注、收藏、评论&#xff0c;是对我最大…

NAT协议(网络地址转换协议)详解

NAT协议&#xff08;网络地址转换协议&#xff09;详解 为什么需要NATNAT的实现方式静态NAT动态NATNAPT NAT技术的优缺点优点缺点 NAT协议是将IP数据报头中的IP地址转换为另外一个IP地址的过程&#xff0c;主要用于实现私有网络访问公有网络的功能。这种通过使用少量的IP地址代…

2023-7-26-第二十三式解释器模式

&#x1f37f;*★,*:.☆(&#xffe3;▽&#xffe3;)/$:*.★* &#x1f37f; &#x1f4a5;&#x1f4a5;&#x1f4a5;欢迎来到&#x1f91e;汤姆&#x1f91e;的csdn博文&#x1f4a5;&#x1f4a5;&#x1f4a5; &#x1f49f;&#x1f49f;喜欢的朋友可以关注一下&#xf…

[vue] 新项目配置整理(没写完,回头有空继续)

省流版(vue2项目)&#xff1a; 脚手架&#xff1a;vue create xxxx vuex&#xff1a;npm i vuex3 router : npm install vue-router3 vue cli创建项目 vue create xxxx(项目名称) 添加基本配置 module.exports {lintOnSave: false, // 关闭eslint检查publicPath:./, //…

Longhorn vs Rook vs OpenEBS vs Portworx vs IOMesh:细说 5 款 K8s 持久化存储产品优劣势

云原生时代下&#xff0c;越来越多的企业开始使用 Kubernetes&#xff08;K8s&#xff09;承载数据库、消息中间件等“生产级”有状态工作负载。由于这些应用对数据持久保存、性能、容量扩展和快速交付具有较高的要求&#xff0c;企业往往需要采用专为 Kubernetes 环境设计的持…