无法使用solr cloud 8.10版本在本地上进行备份,LocalFileSystemRepository出现ClassNotFoundException

rks48beu  于 2022-11-05  发布在  Solr
关注(0)|答案(1)|浏览(208)

我尝试在本地备份文档中描述的solr云集合,我将其添加到了我的solr.xml

<backup>
    <repository name="local_repo" class="org.apache.solr.core.backup.repository.LocalFileSytemRepository" default="true">
      <str name="location">/var/solr/backup_data</str>
    </repository>
</backup>

并尝试备份

curl --location --request POST 'http://localhost:8983/solr/admin/collections?action=BACKUP&name=name&collection=name&location=/var/solr/data'

但我得到了这个错误:

{
    "responseHeader": {
        "status": 500,
        "QTime": 11
    },
    "error": {
        "metadata": [
            "error-class",
            "org.apache.solr.common.SolrException",
            "root-error-class",
            "java.lang.ClassNotFoundException"
        ],
        "msg": "Error loading class 'org.apache.solr.core.backup.repository.LocalFileSytemRepository'",
        "trace": "org.apache.solr.common.SolrException: Error loading class 'org.apache.solr.core.backup.repository.LocalFileSytemRepository'\n\tat org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:554)\n\tat org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:612)\n\tat org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:607)\n\tat org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:599)\n\tat org.apache.solr.core.backup.repository.BackupRepositoryFactory.newInstance(BackupRepositoryFactory.java:75)\n\tat org.apache.solr.core.CoreContainer.newBackupRepository(CoreContainer.java:282)\n\tat org.apache.solr.handler.admin.CollectionsHandler$CollectionOperation.lambda$static$33(CollectionsHandler.java:1115)\n\tat org.apache.solr.handler.admin.CollectionsHandler$CollectionOperation.execute(CollectionsHandler.java:1453)\n\tat org.apache.solr.handler.admin.CollectionsHandler.invokeAction(CollectionsHandler.java:285)\n\tat org.apache.solr.handler.admin.CollectionsHandler.handleRequestBody(CollectionsHandler.java:257)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:216)\n\tat org.apache.solr.servlet.HttpSolrCall.handleAdmin(HttpSolrCall.java:836)\n\tat org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:800)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:545)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:427)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:357)\n\tat org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)\n\tat org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)\n\tat org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.java:177)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n\tat org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)\n\tat org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:763)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:516)\n\tat org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)\n\tat org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)\n\tat org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)\n\tat org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)\n\tat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)\n\tat java.base/java.lang.Thread.run(Thread.java:829)\nCaused by: java.lang.ClassNotFoundException: org.apache.solr.core.backup.repository.LocalFileSytemRepository\n\tat java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)\n\tat java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)\n\tat java.base/java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:899)\n\tat java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)\n\tat java.base/java.lang.Class.forName0(Native Method)\n\tat java.base/java.lang.Class.forName(Class.java:398)\n\tat org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:538)\n\t... 54 more\n",
        "code": 500
    }
}

我试着复制从/opt/solr/dist/opt/solr/server/solr/lib//opt/solr/server/solr-webapp/webapp/WEB-INF/lib/的所有东西,并重新启动solr,但没有运气:(
我错过了什么?

lxkprmvk

lxkprmvk1#

从local_repo的文档中提取的示例中有一个打字错误。类名LocalFileSytemRepository应该是LocalFileSystemRepository。这个类已经在solr-core.jar中,所以你不需要做任何特殊的操作就可以将它放入库中。只需更正solr.xml并重新加载,一切就应该开始工作了。
正确的代码段应如下所示:

<backup>
    <repository name="local_repo" class="org.apache.solr.core.backup.repository.LocalFileSystemRepository" default="true">
      <str name="location">/var/solr/backup_data</str>
    </repository>
</backup>

相关问题