生产环境搭建高可用Harbor(包括恢复演练实操)

生产环境搭建高可用Harbor(包括恢复演练实操)
摘要由CSDN通过智能技术生成

生产环境搭建高可用Harbor(包括恢复演练实操)

前言

因资源成本问题,本Harbor高可用架构为最小开销方案,如果资源充足,可以将PG、Redis全部使用使用云厂商集群模式。

同时为了配置简单,并没用使用keepalived与heartbeat等高可用开源组件。

harbor-arch

准备工作

阿里云SLB 阿里云ECS 共享存储 Redis
最小实例SLB 2c4g 俩台 阿里云NFS 阿里云Redis

操作系统为Ubuntu18.04,在俩台ECS上搭建主从PG,如果不想用阿里云redis,也可以使用ECS搭建Redis。

安装Harbor,用于导出基础harbor数据,恢复到PG集群中.

  1. 安装docker-compose

    curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
    sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
    # 添加国内阿里云
    curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
    #更新
    sudo apt-get update
    [[查看docker]]版本
    apt-cache madison docker-ce
    #安装最新版
    sudo apt-get install -y docker-ce
    [[安装5]]:19.03.6~3-0~ubuntu-bionic版
    sudo apt-get install -y docker-ce=5:19.03.6~3-0~ubuntu-bionic
    
  2. Docker配置镜像加速与国内docker-cn源

    sudo tee /etc/docker/daemon.json <<-'EOF'
    {
      "registry-mirrors": ["https://8sab4djv.mirror.aliyuncs.com"],
        "registry-mirrors": ["https://registry.docker-cn.com"],
      "insecure-registries": ["https://harbor.unixsre.com"]
    }
    EOF
    sudo systemctl daemon-reload
    sudo systemctl restart docker
    
    
    

    镜像加速

  3. 安装Harbor2.3

    # 下载Harbor
    wget -P /usr/local wget https://github.com/goharbor/harbor/releases/download/v2.3.2/harbor-online-installer-v2.3.2.tgz
    
    tar zxf /usr/local/harbor-online-installer-v2.3.2.tgz -C /data/harbor
    
    # 修改配置文件,根据自己的需求进行修改
    cd /var/www/dream/harbor
    cp harbor.yml.tmpl harbor.yml
    # 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: harbor.unixsre.com
    
    # http related config
    http:
      # port for http, default is 80. If https enabled, this port will redirect to https port
      port: 80
    
    # https related config
    https:
      # https port for harbor, default is 443
      port: 443
      # The path of cert and key files for nginx
      certificate: /data/harbor/ssl/unixsre.com.cer
      private_key: /data/harbor/ssl/unixsre.com.key
    
    # # Uncomment following will enable tls communication between all harbor components
    # internal_tls:
    #   # set enabled to true means internal tls 
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值