1.清理物理
先创建一个Admin - Cleanup repositories using their associated policies类型的Task,这个任务会并不会真正但删除镜像,只是将其设置成deleted状态,不会物理删除;因此我们还需再创建一个Admin - Compact blob store类型的Task完成物理删除。
2.设置storage.diskCache.diskFreeSpaceLimit变量
磁盘剩余空间太少,数据库为只读状态,不可以设置task去清理,此时log中会显示如下异常:
Error occurred while executing a write operation to database 'component' due to limited free space on the disk (3188 MB). The database is now working in read-only mode. Please close the database (or stop OrientDB), make room on your hard drive and then reopen the database. The minimal required space is 4096 MB. Required space is now set to 4096MB (you can change it by setting parameter storage.diskCache.diskFreeSpaceLimit) .
根据提示信息可知:nexus要求最少有4096MB的磁盘空间,而当前磁盘只剩3188MB,我们可以通过设置{yourpath}/nexus/bin/nexus.vmoptions中的storage.diskCache.diskFreeSpaceLimit参数来指定剩余磁盘空间的容忍度。
然后重启nexus,添加task完成清除磁盘工作。