1.问题:
[root@k8s-master ~]# docker login 10.0.0.77:85
Username: admin
Password:
Error response from daemon: login attempt to http://10.0.0.77:85/v2/ failed with status: 502 Bad Gateway
2.原因分析并解决
原因分析:harbor服务器部分服务因宕机引起服务未重启。
# 发现部分镜像是不用重启
[root@centos7 harbor]# docker-compose up -d
harbor-log is up-to-date
harbor-db is up-to-date
harbor-portal is up-to-date
Starting redis ... done
Starting registry ... done
Starting registryctl ... done
harbor-core is up-to-date
nginx is up-to-date
harbor-jobservice is up-to-date
# 我害怕还是不能生效便先down 然后再up
[root@centos7 harbor]# docker-compose down
Stopping harbor-jobservice ... done
Stopping nginx ... done
Stopping harbor-core ... done
Stopping registry ... done
Stopping redis ... done
Stopping registryctl ... done
Stopping harbor-portal ... done
Stopping harbor-db ... done
Stopping harbor-log ... done
Removing harbor-jobservice ... done
Removing nginx ... done
Removing harbor-core ... done
Removing registry ... done
Removing redis ... done
Removing registryctl ... done
Removing harbor-portal ... done
Removing harbor-db ... done
Removing harbor-log ... done
[root@centos7 harbor]# docker-compose up -d
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating harbor-portal ... done
Creating redis ... done
Creating harbor-db ... done
Creating registryctl ... done
Creating registry ... done
Creating harbor-core ... done
Creating harbor-jobservice ... done
Creating nginx ... done
3.再次登录
[root@k8s-master ~]# docker login 10.0.0.77:85
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded