(转)Harbor重启失败

harbor版本:
v1.10.2

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
[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容器一直在重启。

1
2
3
4
5
6
7
8
9
10
[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日志:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
[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

解决方案

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 导出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

转自:https://blog.csdn.net/qq_39680564/article/details/107237110

posted @   人艰不拆_zmc  阅读(4112)  评论(1编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 张高兴的大模型开发实战:(一)使用 Selenium 进行网页爬虫
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示