记一次异常停机损坏了orientdb 导致nexus2无法启动

简介: 在一台centos7上通过docker部署了nexus2. 昨天zabbix报警,主机宕机了。查看控制台发现有SATA报错(原因不明)。

在一台centos7上通过docker部署了nexus2.
昨天zabbix报警,主机宕机了。查看控制台发现有SATA报错(原因不明)。
主机重启后,nexus服务启动失败。报错
Cannot open local storage ‘/sonatype-work/db/npm’ with mode=rw

详细日志如下:

2017-08-14 01:13:10,635+0000 ERROR [jetty-main-1] *SYSTEM com.bolyuba.nexus.plugin.npm.service.internal.orient.OrientMetadataStore - Life-cycle operation failed
com.orientechnologies.orient.core.exception.OStorageException: Cannot open local storage '/sonatype-work/db/npm' with mode=rw
        at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:224) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:248) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.bolyuba.nexus.plugin.npm.service.internal.orient.OrientMetadataStore.doStart(OrientMetadataStore.java:112) [nexus-npm-repository-plugin-2.14.2-01/:na]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport$Handler.doStart(LifecycleSupport.java:70) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext$MainMap_Starting.started(LifecycleHandlerContext.java:255) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext.started(LifecycleHandlerContext.java:57) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport.start(LifecycleSupport.java:129) [goodies-lifecycle-1.9.jar:1.9]
        at com.bolyuba.nexus.plugin.npm.service.internal.orient.OrientMetadataStore.startOnce(OrientMetadataStore.java:211) [nexus-npm-repository-plugin-2.14.2-01/:na]
        at com.bolyuba.nexus.plugin.npm.service.internal.MetadataServiceFactoryImpl.createProxyMetadataService(MetadataServiceFactoryImpl.java:70) [nexus-npm-repository-plugin-2.14.2-01/:na]
        at com.bolyuba.nexus.plugin.npm.proxy.DefaultNpmProxyRepository.<init>(DefaultNpmProxyRepository.java:105) [nexus-npm-repository-plugin-2.14.2-01/:na]
        at com.bolyuba.nexus.plugin.npm.proxy.DefaultNpmProxyRepository$$FastClassByGuice$$6ad68420.newInstance(<generated>) [sisu-guice-3.2.6.jar:na]
        at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:89) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115) [sisu-guice-3.2.6.jar:3.2.6]
        at org.eclipse.sisu.bean.BeanScheduler$Activator.onProvision(BeanScheduler.java:176) [org.eclipse.sisu.inject-0.3.1.jar:na]
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:126) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:87) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012) [sisu-guice-3.2.6.jar:3.2.6]
        at org.sonatype.nexus.configuration.application.runtime.DefaultApplicationRuntimeConfigurationBuilder.createRepository(DefaultApplicationRuntimeConfigurationBuilder.java:52) [nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.instantiateRepository(DefaultNexusConfiguration.java:681) [nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.instantiateRepository(DefaultNexusConfiguration.java:665) [nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createRepositories(DefaultNexusConfiguration.java:637) [nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createInternals(DefaultNexusConfiguration.java:621) [nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.NxApplication.doStart(NxApplication.java:160) [nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport$Handler.doStart(LifecycleSupport.java:70) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext$MainMap_Starting.started(LifecycleHandlerContext.java:255) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext.started(LifecycleHandlerContext.java:57) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport.start(LifecycleSupport.java:129) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:168) [classes/:na]
        at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) [jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) [jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.Server.doStart(Server.java:282) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247) [nexus-bootstrap-2.14.2-01.jar:2.14.2-01]
Caused by: java.io.IOException: Input/output error
        at java.io.RandomAccessFile.readBytes(Native Method) ~[na:1.8.0_102]
        at java.io.RandomAccessFile.read(RandomAccessFile.java:377) ~[na:1.8.0_102]
        at java.io.RandomAccessFile.readFully(RandomAccessFile.java:436) ~[na:1.8.0_102]
        at java.io.RandomAccessFile.readFully(RandomAccessFile.java:416) ~[na:1.8.0_102]
        at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$LogSegment.initPageCache(ODiskWriteAheadLog.java:555) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$LogSegment.init(ODiskWriteAheadLog.java:279) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog.<init>(ODiskWriteAheadLog.java:692) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog.<init>(ODiskWriteAheadLog.java:616) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.initWalAndDiskCache(OLocalPaginatedStorage.java:292) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:167) ~[nexus-orient-plugin-2.14.2-01/:na]
        ... 52 common frames omitted
2017-08-14 01:13:10,640+0000 WARN  [jetty-main-1] *SYSTEM com.bolyuba.nexus.plugin.npm.service.internal.orient.OrientMetadataStore - Could not start OrientMetadataStore
com.orientechnologies.orient.core.exception.OStorageException: Cannot open local storage '/sonatype-work/db/npm' with mode=rw
        at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:224) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:248) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.bolyuba.nexus.plugin.npm.service.internal.orient.OrientMetadataStore.doStart(OrientMetadataStore.java:112) ~[nexus-npm-repository-plugin-2.14.2-01/:na]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport$Handler.doStart(LifecycleSupport.java:70) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext$MainMap_Starting.started(LifecycleHandlerContext.java:255) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext.started(LifecycleHandlerContext.java:57) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport.start(LifecycleSupport.java:129) [goodies-lifecycle-1.9.jar:1.9]
        at com.bolyuba.nexus.plugin.npm.service.internal.orient.OrientMetadataStore.startOnce(OrientMetadataStore.java:211) ~[nexus-npm-repository-plugin-2.14.2-01/:na]
        at com.bolyuba.nexus.plugin.npm.service.internal.MetadataServiceFactoryImpl.createProxyMetadataService(MetadataServiceFactoryImpl.java:70) [nexus-npm-repository-plugin-2.14.2-01/:na]
        at com.bolyuba.nexus.plugin.npm.proxy.DefaultNpmProxyRepository.<init>(DefaultNpmProxyRepository.java:105) [nexus-npm-repository-plugin-2.14.2-01/:na]
        at com.bolyuba.nexus.plugin.npm.proxy.DefaultNpmProxyRepository$$FastClassByGuice$$6ad68420.newInstance(<generated>) [sisu-guice-3.2.6.jar:na]
        at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:89) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115) [sisu-guice-3.2.6.jar:3.2.6]
        at org.eclipse.sisu.bean.BeanScheduler$Activator.onProvision(BeanScheduler.java:176) [org.eclipse.sisu.inject-0.3.1.jar:na]
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:126) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:87) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) [sisu-guice-3.2.6.jar:3.2.6]
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012) [sisu-guice-3.2.6.jar:3.2.6]
        at org.sonatype.nexus.configuration.application.runtime.DefaultApplicationRuntimeConfigurationBuilder.createRepository(DefaultApplicationRuntimeConfigurationBuilder.java:52) [nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.instantiateRepository(DefaultNexusConfiguration.java:681) [nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.instantiateRepository(DefaultNexusConfiguration.java:665) [nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createRepositories(DefaultNexusConfiguration.java:637) [nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createInternals(DefaultNexusConfiguration.java:621) [nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.NxApplication.doStart(NxApplication.java:160) [nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport$Handler.doStart(LifecycleSupport.java:70) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext$MainMap_Starting.started(LifecycleHandlerContext.java:255) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext.started(LifecycleHandlerContext.java:57) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport.start(LifecycleSupport.java:129) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:168) [classes/:na]
        at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) [jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) [jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.Server.doStart(Server.java:282) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247) [nexus-bootstrap-2.14.2-01.jar:2.14.2-01]
Caused by: java.io.IOException: Input/output error
        at java.io.RandomAccessFile.readBytes(Native Method) ~[na:1.8.0_102]
        at java.io.RandomAccessFile.read(RandomAccessFile.java:377) ~[na:1.8.0_102]
        at java.io.RandomAccessFile.readFully(RandomAccessFile.java:436) ~[na:1.8.0_102]
        at java.io.RandomAccessFile.readFully(RandomAccessFile.java:416) ~[na:1.8.0_102]
        at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$LogSegment.initPageCache(ODiskWriteAheadLog.java:555) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog$LogSegment.init(ODiskWriteAheadLog.java:279) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog.<init>(ODiskWriteAheadLog.java:692) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.ODiskWriteAheadLog.<init>(ODiskWriteAheadLog.java:616) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.initWalAndDiskCache(OLocalPaginatedStorage.java:292) ~[nexus-orient-plugin-2.14.2-01/:na]
        at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:167) ~[nexus-orient-plugin-2.14.2-01/:na]
        ... 52 common frames omitted
2017-08-14 01:13:10,657+0000 ERROR [jetty-main-1] *SYSTEM org.sonatype.nexus.NxApplication - Could not start Nexus, user configuration exception!
org.sonatype.configuration.validation.InvalidConfigurationException: Could not lookup a new instance of Repository!
        at org.sonatype.nexus.configuration.application.runtime.DefaultApplicationRuntimeConfigurationBuilder.createRepository(DefaultApplicationRuntimeConfigurationBuilder.java:55) ~[nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.instantiateRepository(DefaultNexusConfiguration.java:681) ~[nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.instantiateRepository(DefaultNexusConfiguration.java:665) ~[nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createRepositories(DefaultNexusConfiguration.java:637) ~[nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.configuration.application.DefaultNexusConfiguration.createInternals(DefaultNexusConfiguration.java:621) ~[nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.nexus.NxApplication.doStart(NxApplication.java:160) ~[nexus-core-2.14.2-01.jar:2.14.2-01]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport$Handler.doStart(LifecycleSupport.java:70) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext$MainMap_Starting.started(LifecycleHandlerContext.java:255) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext.started(LifecycleHandlerContext.java:57) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport.start(LifecycleSupport.java:129) [goodies-lifecycle-1.9.jar:1.9]
        at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:168) [classes/:na]
        at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) [jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) [jetty-webapp-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.server.Server.doStart(Server.java:282) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
        at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:247) [nexus-bootstrap-2.14.2-01.jar:2.14.2-01]
Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, com.orientechnologies.orient.core.exception.OStorageException: Cannot open local storage '/sonatype-work/db/npm' with mode=rw
  at com.bolyuba.nexus.plugin.npm.proxy.DefaultNpmProxyRepository.<init>(DefaultNpmProxyRepository.java:104)
  while locating com.bolyuba.nexus.plugin.npm.proxy.DefaultNpmProxyRepository
  while locating org.sonatype.nexus.proxy.repository.Repository annotated with @com.google.inject.name.Named(value=npm-proxy)

解决

网上查到说是由于非正常关机导致 orientdb 损坏。
需要使用orientdb控制台命令修复。

在nexus的镜像中没有找到orientdb的console命令,所以从官网下载了最新的2.2.25版。

把docker容器中损坏的db复制出来,进行修复:

# 进入容器
docker exec -it nexus /bin/bash

cd /sonatype-work/db

tar czf npm.tar.gz npm

# ^d 退出容器

# 从容器中复制出来,解压到/tmp下
docker cp nexus:/sonatype-work/db/npm.tar.gz /tmp

cd /tmp && tar xzf npm.tar.gz

安装orientdb:

cd /opt
tar xzf orientdb-community-importers-2.2.25.tar.gz
ln -s orientdb-community-importers-2.2.25 orient 

使用orient控制台命令修复:

# 设置环境变量
export ORIENTDB_HOME=/opt/orientdb 
export PATH=$PATH:$ORIENTDB_HOME/bin
# 启动控制台
${ORIENTDB_HOME}/bin/console.sh
# 连接数据库
CONNECT PLOCAL:/tmp/npm admin admin

# 修复
REBUILD INDEX *
REPAIR DATABASE --fix-graph
REPAIR DATABASE --fix-links
REPAIR DATABASE --fix-ridbags
REPAIR DATABASE --fix-bonsai
DISCONNECT

修复后传回docker容器:

cd /tmp
docker cp npm nexus:/sonatype-work/db/

# 启动容器
docker start nexus && docker logs -f nexus

启动时报错,提示文件没有写权限。
这才发现使用docker cp传回的文件都是root账号的。而nexus进程是以nexus账号运行的。

# 使用 --user参数 以root账号进入容器
docker exec -it --user root nexus /bin/bash

# 修改文件所有者为 nexus
cd /sonatype-work/db/
chown -R nexus.nexus npm

# 重启容器
docker start nexus && docker logs -f nexus

重启时报错

Caused by: com.orientechnologies.orient.core.exception.OSerializationException: Cannot load database's configuration. The database seems corrupted
        at com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:84) ~[na:na]
        at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:162) ~[na:na]
        ... 52 common frames omitted
Caused by: java.lang.NullPointerException: Name is null
        at java.lang.Enum.valueOf(Enum.java:236) ~[na:1.8.0_102]
        at com.orientechnologies.orient.core.config.OStorageClusterConfiguration$STATUS.valueOf(OStorageClusterConfiguration.java:24) ~[na:na]
        at com.orientechnologies.orient.core.config.OStorageConfiguration.fromStream(OStorageConfiguration.java:263) ~[na:na]
        at com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:82) ~[na:na]
        ... 53 common frames omitted

网上查到说2.1.x版本的数据库与2.2.x的控制台命令有兼容性问题,而且无法回退。
因此下载2.1.17版本,重新进行修复。

这次把orientdb安装到容器里,直接在容器内修复。免得通过docker cp复制来复制去了。

docker cp orientdb-community-2.1.17.tar.gz nexus:/opt/

docker exec -it --user root nexus /bin/bash

cd /opt
tar xzf orientdb-community-2.1.17.tar.gz

ln -s orientdb-community-2.1.17 orientdb

# 删除刚才用2.2.x修复过的损坏的db
cd /sonatype-work/db
rm -rf npm
# 解压原来的备份
tar xzf npm.tar.gz

# 启动控制台
export ORIENTDB_HOME=/opt/orientdb 
export PATH=$PATH:$ORIENTDB_HOME/bin
${ORIENTDB_HOME}/bin/console.sh

# 修复
CONNECT PLOCAL:/sonatype-work/db/npm admin admin

REBUILD INDEX *
REPAIR DATABASE --fix-graph
REPAIR DATABASE --fix-links
REPAIR DATABASE --fix-ridbags
REPAIR DATABASE --fix-bonsai
DISCONNECT

# 重启容器
docker start nexus && docker logs -f nexus

重启nexus,成功启动。

目录
相关文章
|
NoSQL MongoDB
MongoDB因服务器异常断电,无法启动异常的修复
本文是博主遇到MongoDB启动异常的解决方法记录,希望对大家有所帮助。
1457 0
|
2月前
|
SQL 数据挖掘 数据库
服务器数据恢复—意外断电导致XenServer虚拟机不可用的数据恢复案例
服务器数据恢复环境: 一台服务器中有一组由4块STAT硬盘通过RAID卡组建的RAID10阵列,上层是XenServer虚拟化平台,虚拟机安装Windows Server操作系统,作为Web服务器使用。 服务器故障: 因机房异常断电导致服务器中一台VPS(Xen Server虚拟机)不可用,虚拟磁盘文件丢失。
服务器数据恢复—意外断电导致XenServer虚拟机不可用的数据恢复案例
|
2月前
|
Windows
【收藏】常见WinXP启动故障及解决方法
【收藏】常见WinXP启动故障及解决方法
|
6月前
|
存储 关系型数据库 MySQL
服务器数据恢复—EVA存储异常断电重启后虚拟机无法启动的数据恢复方案
服务器存储数据恢复环境: 某品牌EVA8400,服务器上安装VMware ESXi虚拟化平台,虚拟机的虚拟磁盘包括数据盘(精简模式)+快照数据盘,部分虚拟机中运行oracle数据库和mysql数据库。 服务器存储故障&检测: 存储异常断电重启后,存储中一台虚拟机无法启动。工作人员推测故障原因是异常断电导致电源模块出现故障,清空cache后重新启动存储发现该虚拟机仍无法正常启动。
|
6月前
|
存储 运维 小程序
【服务器数据恢复】异常断电导致ESXi虚拟机数据丢失的数据恢复案例
服务器数据恢复环境: 一台服务器,虚拟化系统为esxi,上层使用iSCSI的方式实现FC SAN功能,iSCSI通过FreeNAS构建。 FreeNAS采用了UFS2文件系统,esxi虚拟化系统里有3台虚拟机:其中一台虚拟机安装FreeBSD系统,存放数据库文件;一台虚拟机存放网站数据;一台虚拟机安装Windows server系统,存放数据库数据和程序代码。 服务器故障: 机房供电不稳,服务器非正常关机,重启服务器后发现ESXI虚拟化系统无法连接存储。工作人员对服务器进行故障排查,发现UFS2文件系统出现故障,于是fsck修复UFS2文件系统并将ESXI虚拟化系统连接到存储上。 检查文件系
|
缓存 容灾 NoSQL
变形记---容灾恢复 ,异常崩溃引发服务器丢档或无法正常运行
最近我给M部门面试服务器主程序开发的职位,我只问他们的架构设计经验,我发现相当一部分5-12年“本应该有足够开发经验”的开发组长,或开发主程序缺乏设计,缺乏容错,缺乏创新,比如一些服务器宕机如何崩溃拉起恢复玩家数据,数据库的异步线程读写如何避免被其他线程写回呢,至少目前能听到合理方案的面试者的回答不多,这也是我想写这篇文章的出发点,以此来分享给大家, 不仅仅是为了应付面试,更是解决实际问题的一种思路。 如题,举例说明:游戏服务器(或者其他业务服务器)正常运行中出现了异常崩溃,可能是异常断电引发,可能是云服务商的软硬件问题引发,这种情况下,你们的服务器架构有没有做灾难恢复处理? 使得
|
运维 安全 数据挖掘
服务器数据恢复-服务器蓝屏无法启动的数据恢复案例
某公司一台华为机架式服务器,运行过程中突然蓝屏。管理员将服务器进行了重启,但是服务器操作系统仍然进入蓝屏状态。 导致服务器蓝屏的原因非常多,比较常见的有:显卡/内存/cpu或者其他板卡接触不良、硬盘出现物理故障、系统漏洞被利用,外部入侵、系统文件丢失或损坏等。这些情况都可能导致服务器蓝屏故障。 该公司将服务器送到北亚企安数据恢复中心。收到服务器后,北亚企安硬件工程师对故障服务器进行了物理故障检测,经过各方面的检测,没有发现服务器存在任何物理故障,也没有发现严重漏洞或者系统入侵的情况。初步判断服务器蓝屏的原因是操作系统损坏。
|
Ubuntu 安全
ubuntu强制关机后,硬盘启动失败修复记录
ubuntu强制关机后,硬盘启动失败修复记录
780 2
ubuntu强制关机后,硬盘启动失败修复记录
beegfs 7.3.2更新后服务无法启动
beegfs 7.3.2更新后服务无法启动
199 0