Harbor 重启失败--已解决

harbor版本
v1.10.2

遇到问题:
使用 docker-compose down命令关闭harbor,然后使用./install.sh --with-chartmuseum命令重新安装带chart仓库的harbor,然后发现启动不了,报以下错误:

[Step 5]: starting Harbor ...
Creating network "harbor_harbor" with the default driver
Creating network "harbor_harbor-chartmuseum" with the default driver
Creating harbor-log ... done
Creating redis      ... 
Creating registryctl ... 
Creating harbor-portal ... error
Creating chartmuseum   ... 
Creating harbor-db     ... 
Creating registryctl   ... error

ERROR: for harbor-portal  Cannot start service portal: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

ERROR: for chartmuseum  Cannot start service chartmuseum: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused
Creating redis         ... error
ERROR: for registryctl  Cannot start service registryctl: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

Creating registry      ... error

ERROR: for registry  Cannot start service registry: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

ERROR: for redis  Cannot start service redis: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

ERROR: for portal  Cannot start service portal: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

ERROR: for chartmuseum  Cannot start service chartmuseum: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

ERROR: for registryctl  Cannot start service registryctl: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

ERROR: for postgresql  Cannot start service postgresql: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

ERROR: for registry  Cannot start service registry: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused

ERROR: for redis  Cannot start service redis: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused
ERROR: Encountered errors while bringing up the project.

使用docker-compose ps查看容器,发现harbor-log容器一直在重启。

[root@harbor harbor]# docker-compose ps
    Name                   Command                 State      Ports
-------------------------------------------------------------------
chartmuseum     ./docker-entrypoint.sh           Exit 128          
harbor-db       /docker-entrypoint.sh            Exit 128          
harbor-log      /bin/sh -c /usr/local/bin/ ...   Restarting        
harbor-portal   nginx -g daemon off;             Exit 128          
redis           redis-server /etc/redis.conf     Exit 128          
registry        /home/harbor/entrypoint.sh       Exit 128          
registryctl     /home/harbor/start.sh            Exit 128 

使用docker logs -f harbor-log查看harbor-log日志:

[root@harbor harbor]# docker logs -f harbor-log 
sudo: Account or password is expired, reset your password and try again
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Changing password for root.
sudo: unable to change expired password: Authentication token manipulation error
sudo: Account or password is expired, reset your password and try again
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: unable to change expired password: Authentication token manipulation error
Changing password for root.
sudo: Account or password is expired, reset your password and try again
Changing password for root.
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: unable to change expired password: Authentication token manipulation error
sudo: Account or password is expired, reset your password and try again
Changing password for root.
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: unable to change expired password: Authentication token manipulation error
sudo: Account or password is expired, reset your password and try again
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Changing password for root.
sudo: unable to change expired password: Authentication token manipulation error
sudo: Account or password is expired, reset your password and try again
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Changing password for root.
sudo: unable to change expired password: Authentication token manipulation error
sudo: Account or password is expired, reset your password and try again
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: unable to change expired password: Authentication token manipulation error
Changing password for root.
sudo: Account or password is expired, reset your password and try again
Changing password for root.
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: unable to change expired password: Authentication token manipulation error
sudo: Account or password is expired, reset your password and try again
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: unable to change expired password: Authentication token manipulation error
Changing password for root.
sudo: Account or password is expired, reset your password and try again
Changing password for root.
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: unable to change expired password: Authentication token manipulation error
sudo: Account or password is expired, reset your password and try again
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Changing password for root.
sudo: unable to change expired password: Authentication token manipulation error

解决方案

# 导出harbor-log容器
mkdir -p /tmp/harbor-log
cd /tmp/harbor-log
docker export harbor-log -o harbor-log.tar

# 解压tar包
tar xvfp harbor-log.tar

# 修改shadow文件的值
sed -i 's/:90:/:99999:/g' /tmp/harbor-log/etc/shadow

# 将修改后的shadow文件挂载到harbor-log容器内
mkdir -p /opt/harbor-log-etc/
cp /tmp/harbor-log/etc/shadow /opt/harbor-log-etc/shadow

# 修改docker-composr.yml文件,harbor-log容器的volumes配置,增加以下配置
      - type: bind
        source: /opt/harbor-log-etc/shadow
        target: /etc/shadow
# 重启harbor即可
docker-compose down
docker-compose up -d
  • 5
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 10
    评论
Harbor-offline-installer2.7 是一个用于安装和配置 Harbor 的离线安装包。Harbor 是一个开源的企业级容器镜像注册中心,它提供了一个可靠和安全的方式来管理和存储容器镜像。 使用 Harbor-offline-installer2.7 可以方便地将 Harbor 安装在离线环境中,而不需要依赖于互联网。这对于一些安全性要求高或者网络条件有限的场景是非常有用的。 在安装过程中,首先需要将离线安装包下载到本地环境中。然后,在执行安装之前,需要根据部署环境的要求进行一些预配置,例如设置主机名、IP 地址、SSL 证书等。完成预配置后,可以运行安装程序来启动安装过程。 安装程序会自动执行一系列步骤,包括创建并配置数据库、生成加密证书、设置认证和授权规则等。在安装完成后,可以通过浏览器访问 Harbor 的管理界面,进行进一步的配置和管理操作。 Harbor-offline-installer2.7 不仅提供了基本的容器镜像注册和存储功能,还具有一些高级特性,如镜像复制和同步、安全扫描和漏洞检测、访问控制和权限管理等。这些功能使得 Harbor 成为一个强大而全面的容器镜像管理平台。 总而言之,Harbor-offline-installer2.7 是一个方便的工具,可用于将 Harbor 安装到离线环境中,并提供了一系列功能来管理和保护容器镜像。它的使用简单,但具有强大的功能,适用于各种企业级容器应用场景。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值