【问题标题】:Hdfs + solr installation error cannot create core collection1hdfs + solr 安装错误无法创建核心集合1
【发布时间】:2014-01-28 21:00:49
【问题描述】:

我正在尝试使用 Solr 在 HDFS 上实现搜索引擎我已经成功安装了 Hadoop,但是在配置 Solr 时遇到了一些错误……我对 Solr 非常陌生,请帮助解决这个问题

solrconfig.xml

 <directoryFactory name="DirectoryFactory" class="solr.HdfsDirectoryFactory">
      <str name="solr.hdfs.home">hdfs://127.0.0.1:10001/home/hadoop/hadoop-datastore/tmp/dfs/solr</str>
      <str name="solr.hdfs.confdir">/home/hadoop/hadoop-1.2.1/conf</str>
    <bool name="solr.hdfs.blockcache.enabled">true</bool>
      <int name="solr.hdfs.blockcache.slab.count">1</int>
      <bool name="solr.hdfs.blockcache.direct.memory.allocation">true</bool>
      <int name="solr.hdfs.blockcache.blocksperbank">16384</int>
      <bool name="solr.hdfs.blockcache.read.enabled">true</bool>
      <bool name="solr.hdfs.blockcache.write.enabled">true</bool>
      <bool name="solr.hdfs.nrtcachingdirectory.enable">true</bool>
      <int name="solr.hdfs.nrtcachingdirectory.maxmergesizemb">16</int>
      <int name="solr.hdfs.nrtcachingdirectory.maxcachedmb">192</int>
    </directoryFactory>

请让我知道我在这个文件上的错误是什么

我正在尝试启动 Solr,请让我知道这是否正确

java -Dsolr.directoryFactory=HdfsDirectoryFactory -Dsolr.lock.type=hdfs -Dsolr.hdfs.home=hdfs://127.0.0.1:10001/home/hadoop/hadoop-datastore/tmp/dfs/solr -Dsolr.hdfs.confdir=/home/hadoop/hadoop-1.2.1/conf -jar start.jar

启动时出现错误消息

  ERROR org.apache.solr.core.CoreContainer  – Unable to create core: collection1
org.apache.solr.common.SolrException: Problem creating directory: hdfs://127.0.0.1:10001/home/hadoop/hadoop-datastore/tmp/dfs/solr/collection1/data
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:834)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:625)
at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:557)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:592)
at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:271)
at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:263)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.RuntimeException: Problem creating directory:     hdfs://127.0.0.1:10001/home/hadoop/hadoop-datastore/tmp/dfs/solr/collection1/data
at org.apache.solr.store.hdfs.HdfsDirectory.<init>(HdfsDirectory.java:68)
at org.apache.solr.core.HdfsDirectoryFactory.create(HdfsDirectoryFactory.java:154)

我正在使用 Hadoop 1.2.1

请帮助我启动此搜索功能

【问题讨论】:

  • 这表明 protobuffer 与使用 SOLR 的 protobuffer HDFS 版本不兼容的问题。虽然我仍在努力寻找解决此问题的方法
  • 我遇到了缺少罐子的问题。我将所有 jar 保存在一个目录中,效果很好。

标签: java hadoop solr


【解决方案1】:

致未来可能面临类似问题的人。

这可能是由几件事引起的。检查这些:

  1. 确保使用正确的 HDFS NameNode 主机名/端口。在 OP 的配置中,它是 hdfs://127.0.0.1:10001,但 NN RPC 的默认端口是 8020。

  2. 确保将配置添加到 solrconfig.xml。它应该同时具有&lt;directoryFactory&gt;&lt;lockType&gt;hdfs&lt;/lockType&gt;

  3. &lt;directoryFactory&gt; 块中描述了将 Solr 与 HDFS 数据目录一起使用时,因此应将默认的 &lt;dataDir&gt; 注释掉。

  4. 用户 solr 应该是 HDFS 上 solr 数据根目录的所有者。如果在 root 或 hdfs 用户下使用 CLI 创建集合,这可能会搞砸。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-22
    • 2017-03-11
    • 1970-01-01
    相关资源
    最近更新 更多