Harbor突然无法访问,采用重启大法解决。步骤如下:
- 登录harbor服务器,进入到harbor安装目录(/var/opt/harbor/harbor);
- 执行docker-compose restart;
- 如遇到以下报错,
ERROR: for harbor-ui UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60) ERROR: for registry UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60) ERROR: for harbor-adminserver UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60) ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information. If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).
可在/etc/profile下添加以下语句并执行source /etc/profile生效,然后再次执行docker-compose restart
export COMPOSE_HTTP_TIMEOUT=500 export DOCKER_CLIENT_TIMEOUT=500