• harbor安装高可用


    harbor架构

    下载地址https://github.com/goharbor/harbor/

    高可用架构

    解压压缩包

    tar -xvf harbor-offline-installer-v1.10.3.tgz

    进入harbor目录修改配置文件

    执行sh install.sh安装harbor

    通过nginx进行负载实现高可用

    user nginx;
    worker_processes 1;
    
    
    error_log /var/log/nginx/error.log warn;
    
    pid /var/run/nginx.pid;
    
    events {
        worker_connections  1024;
    }
    
    stream {
    
        upstream hub {
                server 172.17.166.217:80;
                #server 172.17.166.218:80;
            }
    
    
        server {
            listen 80;
            proxy_pass hub;
            proxy_timeout 300s;
            proxy_connect_timeout 5s;
                }
    
    }

    创建nginx启动脚本

    docker stop harbornginx
    
    docker rm harbornginx
    
    docker run -idt --net=host --name harbornginx -p 80:80 -v /soft/nginx:/etc/nginx nginx:1.17.7

    修改容器镜像地址

    docker

    {
    
        "insecure-registries": ["172.17.166.217"]
    
    }

    containerd

    vim /etc/containerd/config.toml 
        [plugins."io.containerd.grpc.v1.cri".registry]
          [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
            [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
              endpoint = ["https://registry-1.docker.io"]
            [plugins."io.containerd.grpc.v1.cri".registry.mirrors."172.17.166.217"]
              endpoint = ["http://172.17.166.217"]
          [plugins."io.containerd.grpc.v1.cri".registry.configs]
            [plugins."io.containerd.grpc.v1.cri".registry.configs."172.17.166.217".auth]
                   username = "admin"
                   password = "1.Q1.Q1.Q"

    docker 登录验证 docker login 172.17.166.217

    harbor创建用户

    将用户添加到项目中

    双方创建访问地址及凭证

    双方添加复制选项

    可选立即同步及事件驱动实现双主互备

  • 相关阅读:
    洛谷 P1896 [SCOI2005]互不侵犯(状压DP)
    POJ 3208 Apocalypse Someday(数位DP)
    HDU 3555 Bomb(数位DP)
    HDU 3652 B-number(数位DP)
    蜂鸣器版天空之城
    【洛谷习题】小木棍[数据加强版]
    【NOIP2009】靶形数独
    【洛谷习题】填涂颜色
    【NOIP2003】加分二叉树
    【NOIP2000】单词接龙
  • 原文地址:https://www.cnblogs.com/dahuige/p/15012372.html
Copyright © 2020-2023  润新知