• Nexus OrientDB数据库变为只读 storage is switched to 'read only' mode


    错误消息 :

    2021-01-15 16:23:06,604+0800 ERROR [event-6-thread-1396 <command>sql.select from browse_node where asset_id=:asset_id limit 1</command>] yw com.orientechnologies.orient.core.storage.cache.local.OWOWCache - $ANSI{grean {db=security}}checksum verification failed for page '2' of 'browse_node_3.pcl'.
    2021-01-15 16:23:06,627+0800 WARN  [qtp1067566931-4517] yw org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: PUT /repository/maven-deploy/org/bouncycastle/bcprov-jdk15on/1.64/bcprov-jdk15on-1.64.jar.md5 com.orientechnologies.orient.core.exception.OPageIsBrokenException: Following files and pages are detected to be broken ['browse_node_3.pc]' :2;], storage is switched to 'read only' mode. Any modifycation operations are prohibited. To restore database and make it fully operational you may export and import database to and from JSON.
            DB name="security"
            at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.CheckLowDiskSpaceRequestsAndReadOnlyConditions(OAbstractpaginatedStorage.java:5144)
            at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commit(OAbstractPaginatedStorage.java:1729)
            at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:541)
            at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:99)
            at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2908)
            at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2870)
            at org.sonatype.nexus.repository.storage.StorageTxImpl.commit(StorageTxImpl.java:179)
            ...
    
    

    解决步骤:

    • 停止nexus进程
      ./nexus stop

    • 备份变成只读模式的数据库 ,我这里是 security 数据库
      cp -rv /opt/nexus/sonatype-work/nexus3/db/security /backup/

    • 运行OrientDB 数据库客户端
      java -jar /opt/nexus-3.12.1-01/lib/support/nexus-orient-console.jar

    • 连接出错数据库
      orientdb> connect PLOCAL:/opt/sonatype-work/nexus3/db/security admin admin

    • 导出数据库
      orientdb {db=security}> EXPORT DATABASE /backup/orientdb-security.export

    • 断开与数据库security 的连接
      orientdb {db=security}> DISCONNECT

    • 删除出问题的库
      orientdb> DROP DATABASE PLOCAL:/opt/sonatype-work/nexus3/db/security admin admin

    • 重新创建出问题的库
      orientdb> CREATE DATABASE PLOCAL:/opt/sonatype-work/nexus3/db/security admin admin

    • 导入之前的备份
      orientdb {db=security}> IMPORT DATABASE /backup/orientdb-security.export.gz

    • 关闭数据库连接
      orientdb {db=security}> DISCONNECT

    • 退出数据库客户端
      orientdb> EXIT

  • 相关阅读:
    20160205.CCPP体系详解(0015天)
    盘点各专业到古代都能干些啥
    一份简单的在 Linux下编译及调试 C 代码的指南
    WordPress Gravatar国内加载缓慢解决办法
    linux修改mysql字符集编码
    阿里合伙人邵晓锋:什么是创业者应该抵制的诱惑?
    6月27日云栖精选夜读:细数智能家居的痛点
    6月26日云栖精选夜读:成为一名Java高级工程师你需要学什么
    搭建百万级别邮件发送平台
    黑科技实验室:这些高级装备厉害了!
  • 原文地址:https://www.cnblogs.com/fejerry/p/15533859.html
Copyright © 2020-2023  润新知