Harbor安装报错502 Bad Gateway
Harbor安装报错502 Bad Gateway,按照文档安装完成后,然后出现了白白的界面,瞬间赶脚不好了
查看容器状态发现harbor-adminserver节点一直处于Restarting状态
[root@localhost harbor]# docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------------------------------------------------
harbor-adminserver /harbor/start.sh Restarting
harbor-db /usr/local/bin/docker-entr ... Up 3306/tcp
harbor-jobservice /harbor/start.sh Up
harbor-log /bin/sh -c /usr/local/bin/ ... Up 127.0.0.1:1514->10514/tcp
harbor-ui /harbor/start.sh Up
nginx nginx -g daemon off; Up 0.0.0.0:443->443/tcp, 0.0.0.0:4443->4443/tcp, 0.0.0.0:80->80/tcp
registry /entrypoint.sh serve /etc/ ... Up 5000/tcp
查看/var/log/harbor/adminserver.log 日志有以下报错
Dec 25 02:39:18 172.18.0.1 adminserver[2641]: 2017-12-25T07:39:18Z [INFO] initializing system configurations...
Dec 25 02:39:18 172.18.0.1 adminserver[2641]: 2017-12-25T07:39:18Z [INFO] the path of json configuration storage: /etc/adminserver/config/config.json
Dec 25 02:39:18 172.18.0.1 adminserver[2641]: 2017-12-25T07:39:18Z [DEBUG] [driver_json.go:46]: path of configuration file: /etc/adminserver/config/config.json
Dec 25 02:39:18 172.18.0.1 adminserver[2641]: 2017-12-25T07:39:18Z [INFO] the path of key used by key provider: /etc/adminserver/key
查看/var/log/harbor/jobservice.log 日志有以下报错
Dec 25 02:39:50 172.18.0.1 jobservice[2641]: 2017-12-25T07:39:50Z [ERROR] [utils.go:102]: failed to connect to tcp://adminserver:8080, retry after 2 seconds :dial tcp 172.18.0.3:8
080: getsockopt: connection refused
原因是我们指定的secretkey_path 路径创建的文件没有权限
第一种方法:
设置下权限,设置目录下面secretkey文件的所属者
[root@localhost harbor]# chown 10000:10000 /mycre/secretkey
然后执行
docker-compose down
docker-compose up -d
第二种方法:
还原设置secretkey_path的路径为/data
切换harbor的安装目录执行以下操作
[root@localhost harbor]#docker-compose down
[root@localhost harbor]#rm -rf /data/secretkey
[root@localhost harbor]#./prepare
[root@localhost harbor]#docker-compose up –d
[root@localhost harbor]# docker-compose ps
Name Command State Ports
------------------------------------------------------------------------------------------------------------------------------
harbor-adminserver /harbor/start.sh Up
harbor-db /usr/local/bin/docker-entr ... Up 3306/tcp
harbor-jobservice /harbor/start.sh Up
harbor-log /bin/sh -c /usr/local/bin/ ... Up 127.0.0.1:1514->10514/tcp
harbor-ui /harbor/start.sh Up
nginx nginx -g daemon off; Up 0.0.0.0:443->443/tcp, 0.0.0.0:4443->4443/tcp, 0.0.0.0:80->80/tcp
registry /entrypoint.sh serve /etc/ ... Up 5000/tcp
[root@localhost harbor]#
- 本文标签: Docker
- 本文链接: http://www.iamlk.cn/article/13
- 版权声明: 本文由Leonidax原创发布,转载请遵循《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权