nexus中異常導致的不能正常啟動的問題 '/nexus-data/db/config'


在kubeopertor中創建新的k8s集群時,總是報錯10.12.8.16:8081/xx/xxx不通導致創建集群失敗。在kubeoperator中查看nexus的容器狀態為unhealth,且nexus的8081 8082 8083端口均不通,查看nexus容器得到報錯

ERROR [ForkJoinPool.commonPool-worker-1] *SYSTEM com.orientechnologies.orient.core.storage.impl.local.paginated. OLocalPaginatedStorage - Exception `75806EC9` in storage `plocal:/nexus-data/db/config`: 2.2.36 (build d3beb772c02098ceaea89779a7afd4b7305d37 88, branch 2.2.x)
com.orientechnologies.orient.core.exception.OStorageException: Cannot open local storage '/nexus-data/db/config' with mode=rw
DB name="config"

可能是由於之前這台服務器的磁盤滿了導致導致orientdb數據損壞,需要進行數據修復,重啟nexus重啟服務器依然異常。

由報錯可知是config數據庫出現問題

經過百度看到文章http://www.renhl.com/linux/2020/06/05/nexus-repair-orientdb.html

使用root權限進入容器

docker exec -it -u root  4344ab1ab44e sh

進入該db目錄,刪除所有*.wal文件

cd /nexus-data/db/config

rm -rf *.wal

查找修復工具nexus-orient-console.jar的路徑

find / -name nexus-orient-console.jar

執行修復

java -jar /opt/sonatype/nexus/lib/support/nexus-orient-console.jar

orientdb> export database config-export

orientdb> drop database

orientdb> create database plocal:/nexus-data/db/config admin admin

orientdb> import database config-export.json.gz -preserveClusterIDs=true

orientdb> rebuild index *

orientdb> disconnect

這樣數據庫修復好了

還需要給db數據庫更改權限,現在很多屬主是root啟動會有問題。

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

重啟nexus

docker start container_id && docker logs -f container_id

nexus啟動成功,8081 8082 8083 端口都通了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM