我正在尝试使用 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

请帮助我启动此搜索功能

请您参考如下方法:

对于将来可能遇到类似问题的人。

这可能是由多种原因引起的。检查这些:

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

  2. 确保将配置添加到 solrconfig.xml 中。它应该都有 <directoryFactory><lockType>hdfs</lockType> .

  3. <directoryFactory> 中描述了将 Solr 与 HDFS 数据目录结合使用时的情况 block ,所以默认 <dataDir>应该被注释掉。

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


评论关闭
IT虾米网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!