机房停电导致索引文件损坏所致。

解决过程
清除以前的文件
进入到宿主机存放nexus数据文件目录,比如我自己机器上的/home/app/data/nexus

cd /home/app/data/nexus/db/config

rm -rf *.wal

cd /home/app/data/nexus/db/component

rm -rf *.wal

执行修复工具
到nexus的docker安装目录去找修复工具,如果不知道就搜索,步骤如下: 以root用户登录 cd /

find . -name nexus-orient-console.jar

cd {上一步中找到的文件路径}

java -jar nexus-orient-console.jar

connect plocal:${nexus-db-oath}/db/component admin admin #在我这里就是/home/app/data/nexus/db/componnet

rebuild index *

repair database --fix-links

disconnect

exit

授权
cd ${nexus-db-oath}/db #在我这里就是/home/app/data/nexus/db

chmod 777 -R /home/app/data/nexus/db

重新启动nexus
docker ps -a

docker start container_id && docker logs -f container_id

 

更多推荐