You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Solr 9.1.0本地备份失败求助:配置后仍报文件不存在错误

Solr 9.1.0本地备份失败排查方案

测试Solr 9.1.0本地目录备份功能时始终失败,已在solr_in.sh的SOLR_OPTS中配置-Dsolr.allowPaths=/store/backup,但问题未解决。已创建目标目录并为Solr进程配置对应权限。

错误响应

{
    "responseHeader": {
        "status": 500,
        "QTime": 17
    },
    "Operation backup caused exception:": "java.nio.file.NoSuchFileException:java.nio.file.NoSuchFileException: /store/backup/mybackup",
    "exception": {
        "msg": "/store/backup/mybackup",
        "rspCode": -1
    },
    "error": {
        "metadata": [
            "error-class",
            "org.apache.solr.common.SolrException",
            "root-error-class",
            "org.apache.solr.common.SolrException"
        ],
        "msg": "/store/backup/mybackup",
        "trace": "org.apache.solr.common.SolrException: /store/backup/mybackup\n\tat org.apache.solr.client.solrj.SolrResponse.getException(SolrResponse.java:61)\n\tat org.apache.solr.handler.admin.CollectionsHandler.invokeAction(CollectionsHandler.java:348)\n\tat org.apache.solr.handler.admin.CollectionsHandler.handleRequestBody(CollectionsHandler.java:297)\n\tat org.apache.solr.handler.CollectionsAPI$CollectionsCommands.backupCollection(CollectionsAPI.java:94)\n\tat org.apache.solr.api.AnnotatedApi$Cmd.invoke(AnnotatedApi.java:312)\n\tat org.apache.solr.api.AnnotatedApi.call(AnnotatedApi.java:220)\n\tat org.apache.solr.api.V2HttpCall.handleAdmin(V2HttpCall.java:396)\n\tat org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:893)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:584)\n\tat org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:250)\n\tat org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:218)\n\tat org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:257)\n\tat org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:227)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:213)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:195)\n\tat org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)\n\tat org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552)\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:1440)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505)\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:1355)\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:772)\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:487)\n\tat org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)\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.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:835)\n",
        "code": 500
    }
}

备份请求内容

{
    "backup-collection": {
      "name": "mybackup",
      "collection": "collection-test",
      "location": "file:///store/backup"
    }
}

排查思路

  • 验证目录写入权限:虽已创建/store/backup,但Solr需自动生成mybackup子目录,需确保Solr运行用户对/store/backup有写入权限。可执行su - <solr运行用户> -c "touch /store/backup/test.tmp"测试,若创建失败则需调整目录权限。
  • 修正solr.allowPaths配置:若/store/backup是挂载目录,需确保配置的是真实路径而非软链接。可尝试扩大权限范围,将配置改为-Dsolr.allowPaths=/store,/store/backup,避免路径匹配限制导致的权限问题。
  • 调整备份请求路径格式:尝试去掉location参数中的file://前缀,直接使用/store/backup作为路径值。部分场景下Solr V2 API对file://协议的解析存在兼容性问题。
  • 确认配置是否生效:重启Solr后,通过Solr Admin的「Core Admin」→「Properties」查看solr.allowPaths是否存在,或执行ps aux | grep solr检查启动参数是否正确加载该配置。
  • 排查系统安全限制:若系统开启SELinux或AppArmor,即使目录权限正确,也可能阻止Solr写入。可临时执行setenforce 0关闭SELinux测试,若恢复正常则需添加对应SELinux规则。
  • 集群节点一致性检查:若为SolrCloud集群,需确保所有节点的solr.allowPaths配置一致,且所有节点均可访问/store/backup(如使用共享存储),单个节点配置不全将导致备份失败。

内容的提问来源于stack exchange,提问作者jguerra

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.26 18:24:58