Harbor启动后直接无法登陆
启动harbor,浏览器输入地址,可正常进入ui,但是输入admin账号密码后,提示密码错误
按F12 后,查看许多接口报502
查看docker-compose ps ,发现harbor-adminserver 的状态一直是Restarting
[root@test-master harbor]
Name Command State Ports
--------------------------------------------------------------------------------------------------------------------------------------------------
harbor-adminserver /harbor/start.sh Restarting
harbor-core /harbor/start.sh Up (health: starting)
harbor-db /entrypoint.sh postgres Up (healthy) 5432/tcp
harbor-jobservice /harbor/start.sh Up
harbor-log /bin/sh -c /usr/local/bin/ ... Up (healthy) 127.0.0.1:1514->10514/tcp
harbor-portal nginx -g daemon off; Up (healthy) 80/tcp
nginx nginx -g daemon off; Up (healthy) 0.0.0.0:30443->443/tcp, 0.0.0.0:4443->4443/tcp, 0.0.0.0:1180->80/tcp
redis docker-entrypoint.sh redis ... Up 6379/tcp
registry /entrypoint.sh /etc/regist ... Up (healthy) 5000/tcp
registryctl /harbor/start.sh Up (healthy)
查看adminserver 的日志如下
Oct 23 20:18:43 172.19.0.1 adminserver[30566]: 2021-10-23T12:18:43Z [INFO] initializing system configurations...
Oct 23 20:18:43 172.19.0.1 adminserver[30566]: 2021-10-23T12:18:43Z [INFO] Registering database: type-PostgreSQL host-postgresql port-5432 databse-registry sslmode-"disable"
Oct 23 20:18:43 172.19.0.1 adminserver[30566]: 2021-10-23T12:18:43Z [INFO] Register database completed
Oct 23 20:18:43 172.19.0.1 adminserver[30566]: 2021-10-23T12:18:43Z [INFO] Upgrading schema for pgsql ...
Oct 23 20:18:43 172.19.0.1 adminserver[30566]: 2021-10-23T12:18:43Z [INFO] No change in schema, skip.
Oct 23 20:18:43 172.19.0.1 adminserver[30566]: 2021-10-23T12:18:43Z [INFO] the path of json configuration storage: /etc/adminserver/config/config.json
Oct 23 20:18:43 172.19.0.1 adminserver[30566]: 2021-10-23T12:18:43Z [INFO] the path of key used by key provider: /etc/adminserver/key
Oct 23 20:18:43 172.19.0.1 adminserver[30566]: 2021-10-23T12:18:43Z [FATAL] [main.go:45]: failed to initialize the system: read /etc/adminserver/key: is a directory
由于前面在docker-compose.yml 中修改了一些’/data’的路径,指向了自定义的/docker/harbor/data ,修改的不彻底,而在执行安装./install.sh 时,自动生成secretkey 的默认是在/data 目录下的,这就导致运行adminserver 无法找到该文件
解决办法
只需要把’/data/secretkey’文件移动到/docker/habor/data/ 下,然后重启启动
$ docker-compose down
$ docker-compose up -d
再次进入UI界面,成功解决
|