Harbor双主复制高可用部署

环境信息:
主机名称 IP 备注
harbor01 192.168.61.56 harbor1服务器
harbor02 192.168.61.57 harbor2服务器
192.168.61.59 Nginx代理
192.168.61.56/57 两个节点分别部署docker-ce ,docker-compose,harbor-offline-installer-v2.9.1.tgz
  • 部署docker-ce docker-compose
wget -P /etc/yum.repos.d/ https://download.docker.com/linux/centos/docker-ce.repo
yum clean all && yum makecache fast
yum -y install docker-ce docker-compose
systemctl enable docker && systemctl start docker
  • 离线部署 harbor
# 下载离线部署包
wget https://github.com/goharbor/harbor/releases/download/v2.9.1/harbor-offline-installer-v2.9.1.tgz
tar -zxvf harbor-offline-installer-v2.9.1.tgz
cd 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.61.56  # 修改为当前主机IP地址# http related config
http:# port for http, default is 80. If https enabled, this port will redirect to https portport: 80# https related config
https:# https port for harbor, default is 443port: 443# The path of cert and key files for nginxcertificate: /opt/key/server.crt   #配置https 证书,证书需要生成private_key: /opt/key/server.key# # Uncomment following will enable tls communication between all harbor components
# internal_tls:
#   # set enabled to true means internal tls is enabled
#   enabled: true
#   # put your cert and key files on dir
#   dir: /etc/harbor/tls/internal
#   # enable strong ssl ciphers (default: false)
#   strong_ssl_ciphers: false# Uncomment external_url if you want to enable external proxy
# And when it enabled the hostname will no longer used
external_url: https://192.168.61.56   # 配置访问地址# The initial password of Harbor admin
# It only works in first time to install harbor
# Remember Change the admin password from UI after launching Harbor.
harbor_admin_password: Harbor12345     # 修改默认账户admin 的登录密码# 其他配置可按需修改,完成以上配置后开始部署harbor
[root@harbor01 harbor]# ./install.sh [Step 0]: checking if docker is installed ...Note: docker version: 24.0.7[Step 1]: checking docker-compose is installed ...Note: Docker Compose version v2.21.0[Step 2]: loading Harbor images ...
4349dad1c75c: Loading layer [==================================================>]  10.89MB/10.89MB
b3619b11127a: Loading layer [==================================================>]  3.584kB/3.584kB
7b38a647487c: Loading layer [==================================================>]   2.56kB/2.56kB
af63cee918f4: Loading layer [==================================================>]  44.69MB/44.69MB
087e0e1d01ed: Loading layer [==================================================>]  45.48MB/45.48MB
Loaded image: goharbor/harbor-jobservice:v2.9.1
7a18cae000bb: Loading layer [==================================================>]  7.873MB/7.873MB
6e8443cb30ea: Loading layer [==================================================>]  4.096kB/4.096kB
7e6f1921b03b: Loading layer [==================================================>]   17.4MB/17.4MB
7ab103a3c9e9: Loading layer [==================================================>]  3.072kB/3.072kB
afdeb50007ba: Loading layer [==================================================>]  32.78MB/32.78MB
0838cfee6fc3: Loading layer [==================================================>]  50.97MB/50.97MB
Loaded image: goharbor/harbor-registryctl:v2.9.1
06a21a75ac76: Loading layer [==================================================>]  10.89MB/10.89MB
7ef38c74aa21: Loading layer [==================================================>]  3.584kB/3.584kB
78e12b1b294b: Loading layer [==================================================>]   2.56kB/2.56kB
7415bb76ee07: Loading layer [==================================================>]  58.23MB/58.23MB
c25cd46ee82a: Loading layer [==================================================>]  5.632kB/5.632kB
1a3de5a9a094: Loading layer [==================================================>]  122.4kB/122.4kB
2d2d193fbdcd: Loading layer [==================================================>]  80.38kB/80.38kB
ee47e7543fea: Loading layer [==================================================>]  59.23MB/59.23MB
6ebe4d7b431b: Loading layer [==================================================>]   2.56kB/2.56kB
Loaded image: goharbor/harbor-core:v2.9.1
7d9f76d29c1c: Loading layer [==================================================>]  124.4MB/124.4MB
50cb5ae20a44: Loading layer [==================================================>]  3.584kB/3.584kB
59a78c21122c: Loading layer [==================================================>]  3.072kB/3.072kB
6beb01cc5baa: Loading layer [==================================================>]   2.56kB/2.56kB
b09018e5a73f: Loading layer [==================================================>]  3.072kB/3.072kB
c1078fb9f5c7: Loading layer [==================================================>]  3.584kB/3.584kB
59dadef71b1b: Loading layer [==================================================>]  20.48kB/20.48kB
Loaded image: goharbor/harbor-log:v2.9.1
d1de629330a4: Loading layer [==================================================>]  60.48MB/60.48MB
3cb3537a6da7: Loading layer [==================================================>]  173.9MB/173.9MB
a327f18369ed: Loading layer [==================================================>]  25.46MB/25.46MB
3f5c8182a7a2: Loading layer [==================================================>]  63.37MB/63.37MB
a972da56e974: Loading layer [==================================================>]   5.12kB/5.12kB
2fa2fe9c942b: Loading layer [==================================================>]  6.144kB/6.144kB
53214b04b836: Loading layer [==================================================>]  3.072kB/3.072kB
7fde99a5b238: Loading layer [==================================================>]  2.048kB/2.048kB
b985c63bb4f0: Loading layer [==================================================>]   2.56kB/2.56kB
58e8be9a88e4: Loading layer [==================================================>]   7.68kB/7.68kB
Loaded image: goharbor/harbor-db:v2.9.1
64966afbcdad: Loading layer [==================================================>]  10.89MB/10.89MB
7ffad26c4cb7: Loading layer [==================================================>]  27.62MB/27.62MB
ce5f177604e5: Loading layer [==================================================>]  4.608kB/4.608kB
4c46c82379dc: Loading layer [==================================================>]  28.41MB/28.41MB
Loaded image: goharbor/harbor-exporter:v2.9.1
f2d51adf2664: Loading layer [==================================================>]  60.48MB/60.48MB
962114f3c6f4: Loading layer [==================================================>]  110.8MB/110.8MB
fa9bce70fee8: Loading layer [==================================================>]  3.072kB/3.072kB
034a19d4e2af: Loading layer [==================================================>]   59.9kB/59.9kB
ea8a227a5ce4: Loading layer [==================================================>]  61.95kB/61.95kB
Loaded image: goharbor/redis-photon:v2.9.1
b99018c986e9: Loading layer [==================================================>]  115.1MB/115.1MB
Loaded image: goharbor/nginx-photon:v2.9.1
7e85bea4f9eb: Loading layer [==================================================>]  7.873MB/7.873MB
2d7031c02133: Loading layer [==================================================>]  4.096kB/4.096kB
f2f29a057a0e: Loading layer [==================================================>]  3.072kB/3.072kB
c465d9ffbcae: Loading layer [==================================================>]   17.4MB/17.4MB
e8392e2d1c5c: Loading layer [==================================================>]  18.19MB/18.19MB
Loaded image: goharbor/registry-photon:v2.9.1
0ee5099becd4: Loading layer [==================================================>]  8.424MB/8.424MB
709c954772b5: Loading layer [==================================================>]  4.096kB/4.096kB
4b4592e67634: Loading layer [==================================================>]  3.072kB/3.072kB
db64864bc2d4: Loading layer [==================================================>]  196.4MB/196.4MB
b2e16fced657: Loading layer [==================================================>]  14.21MB/14.21MB
261777ce207b: Loading layer [==================================================>]  211.4MB/211.4MB
Loaded image: goharbor/trivy-adapter-photon:v2.9.1
Loaded image: goharbor/prepare:v2.9.1
d0dcb5740755: Loading layer [==================================================>]  115.1MB/115.1MB
a68394b34761: Loading layer [==================================================>]   6.46MB/6.46MB
e47863752870: Loading layer [==================================================>]  245.8kB/245.8kB
eb0d64571e29: Loading layer [==================================================>]  1.233MB/1.233MB
Loaded image: goharbor/harbor-portal:v2.9.1[Step 3]: preparing environment ...[Step 4]: preparing harbor configs ...
prepare base dir is set to /root/harbor
Error happened in config validation...
ERROR:root:Please specify hostname
[root@harbor01 harbor]# docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
[root@harbor01 harbor]# vi harbor.yml 
[root@harbor01 harbor]# vi harbor.yml 
[root@harbor01 harbor]# sh install.sh [Step 0]: checking if docker is installed ...Note: docker version: 24.0.7[Step 1]: checking docker-compose is installed ...Note: Docker Compose version v2.21.0[Step 2]: loading Harbor images ...
Loaded image: goharbor/harbor-jobservice:v2.9.1
Loaded image: goharbor/harbor-registryctl:v2.9.1
Loaded image: goharbor/harbor-core:v2.9.1
Loaded image: goharbor/harbor-log:v2.9.1
Loaded image: goharbor/harbor-db:v2.9.1
Loaded image: goharbor/harbor-exporter:v2.9.1
Loaded image: goharbor/redis-photon:v2.9.1
Loaded image: goharbor/nginx-photon:v2.9.1
Loaded image: goharbor/registry-photon:v2.9.1
Loaded image: goharbor/trivy-adapter-photon:v2.9.1
Loaded image: goharbor/prepare:v2.9.1
Loaded image: goharbor/harbor-portal:v2.9.1[Step 3]: preparing environment ...[Step 4]: preparing harbor configs ...
prepare base dir is set to /root/harbor
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 dirNote: stopping existing Harbor instance ...[Step 5]: starting Harbor ...
[+] Running 10/10✔ Network harbor_harbor        Created                                                                                                                                                                                                  0.3s ✔ Container harbor-log         Started                                                                                                                                                                                                  0.4s ✔ Container registryctl        Started                                                                                                                                                                                                  0.5s ✔ Container harbor-portal      Started                                                                                                                                                                                                  0.7s ✔ Container redis              Started                                                                                                                                                                                                  0.6s ✔ Container registry           Started                                                                                                                                                                                                  0.6s ✔ Container harbor-db          Started                                                                                                                                                                                                  0.4s ✔ Container harbor-core        Started                                                                                                                                                                                                  0.2s ✔ Container nginx              Started                                                                                                                                                                                                  0.5s ✔ Container harbor-jobservice  Started                                                                                                                                                                                                  0.3s 
✔ ----Harbor has been installed and started successfully.----




配置双主复制

测试推送镜像主机配置/etc/docker/daemon.json

cat /etc/docker/daemon.json

{

"insecure-registries": ["192.168.61.56","192.168.61.57"]

}
systemctl daemon-reload && systemctl restart docekr
两个节点创建项目 kubeflow项目

  • 在192.168.61.57 上配置,系统管理-仓库管理-新建目标

  • 在192.168.61.57 上配置,系统管理-复制管理-新建规则,也可以使用push-based 触发模式使用事件触发,这里演示使用pull-based

  • 在192.168.61.56 上配置,系统管理-仓库管理-新建目标

  • 在192.168.61.56 上配置,系统管理-复制管理-新建规则,也可以使用push-based 触发模式使用事件触发,这里演示使用pull-based

测试推送镜像 两节点同步情况

  • 推送镜像至192.168.61.57节点仓库

    192.168.61.56 节点查看

  • 推送镜像至192.168.61.56节点仓库

    192.168.61.57 节点查看

配置nginx 代理

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

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

相关文章

经济下行,当下企业如何破局?

禅道前几天刚发布的企业决策分析解决方案2.0中,增加了适合IPD市场分析的3C战略三角模型。我想借着此次发布,和大家分享一下企业如何落地IPD,让企业的真金白银不浪费。大家好,我是陈哥,今天想和大家聊聊企业如何落地IPD~ 华为实施IPD的巨大成功激励了众多的中国企业,很多企…

强化学习理论-第1课-基础概念

1. state:状态,可以是机器人的位置,速度,加速度等2. action:对于每一个状态,可能的动作3. state transition:状态转移3.1 state transition probability:4. policy:告诉agent在这个状态应该采用哪个action

强!34.1K star! 再见Postman,新一代API测试利器,功能强大、颜值爆表!

1、引言 在当今的互联网时代,API(应用程序编程接口)已经成为连接不同软件系统的桥梁。作为一名开发者,掌握API测试技能至关重要。市面上的API测试工具琳琅满目,今天我们要介绍的是一款开源、跨平台的API测试工具——Insomnia。 2、Insomnia介绍 Insomnia是一款功能丰富、易…

kubernetes删除ns异常状态为:Terminating

用kubernetes-API删除 1、首先,获取要删除 NameSpace 的 JSON 文件:替换其中的 <terminating-namespace> 为实际 namespace kubectl get namespace <terminating-namespace> -o json >tmp.json[root@master01 ~]# kubectl get namespace kuboard -o json >…

Veritas InfoScale 8.0 (Unix, Linux, Windows) 下载 - 高可用性和灾难恢复解决方案

Veritas InfoScale 8.0 (Unix, Linux, Windows) 下载 - 高可用性和灾难恢复解决方案Veritas InfoScale 8.0 (Unix, Linux, Windows) - 高可用性和灾难恢复解决方案 打造云和本地应用程序的高可用性和出色性能 请访问原文链接:Veritas InfoScale 8.0 (Unix, Linux, Windows) - …

记一次装机记录

跑个题,放个装机的记录。 趁双十一装了一台台式放实验室用。起初有以下几个想法:内存 32 GB 或更多 CPU 性能足够强,能够满足多开软件的需求,且响应速度快 应当带有无线网卡(主板自带或自行加装 PCIe 网卡),用于连接蓝牙鼠标键盘耳机和临时连接 WiFi。 可能在未来购入一…

SyncOOD:增加OOD目标检测鲁棒性,自动化数据助您一臂之力 | ECCV24

本文是对公开论文的核心提炼,而非直接翻译,旨在进行学术交流。如有任何侵权问题,请及时联系号主以便删除。 来源:晓飞的算法工程笔记 公众号,转载请注明出处论文: Can OOD Object Detectors Learn from Foundation Models?论文地址:https://arxiv.org/abs/2409.05162 论…

《图解设计模式》 第五部分 一致性

第11章 Composite 模式 文中举例文件夹系统, 简单说明: 这里可以讲File 和 dirctory 看作一种东西 Entry。在 Entry 的基础上分化两者,构成结构。 能够使容器与内容具有一致性,创造出递归结构。第12章 Decorator 模式public class Main{public static void main(String[] ar…