【问题标题】:Issue while creating Solr core on HDFS在 HDFS 上创建 Solr 核心时出现问题
【发布时间】:2016-01-11 11:17:05
【问题描述】:

我正在尝试在独立实例(solr-5.3.0 和 Hadoop 2.7)中在 HDFS 上创建 solr 核心。我已经启动了如下服务,

$ bin/solr start -Dsolr.directoryFactory=HdfsDirectoryFactory -Dsolr.lock.type=hdfs -Dsolr.data.dir=hdfs://localhost:9000/tmp -Dsolr.updatelog=hdfs://localhost:9000/tmp -s solr-cores/core1

等待 30 秒才能看到 Solr 在端口 8983 上运行 [/] 在端口 8983 (pid=42277) 上启动 Solr 服务器。祝您搜索愉快!

并尝试创建如下所示的核心,

bin/solr create -c hdfsstarted -d /home/admin/HadoopTools/solr-5.3.0/server/solr/configsets/data_driven_schema_configs_hdfs/conf -n hdfsstarted

但出现以下错误:

设置新的核心实例目录: /home/admin/HadoopTools/solr-5.3.0/solr-cores/core1/hdfsstarted

使用命令创建新核心“hdfsstarted”: http://localhost:8983/solr/admin/cores?action=CREATE&name=hdfsstarted&instanceDir=hdfsstarted

ERROR: Error CREATEing SolrCore 'hdfsstarted': Unable to create core [hdfsstarted] Caused by: Protocol message end-group tag does not match expected tag.

我已经像下面这样修改了 solrconfig.xml,

<directoryFactory name="DirectoryFactory" class="solr.HdfsDirectoryFactory">
    <str name="solr.hdfs.home">hdfs://10.67.5.244:50070/tmp</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">false</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">false</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>
<lockType>
   hdfs
</lockType>

请告诉我如何在 HDFS 中正确创建核心。

【问题讨论】:

  • 你能解决这个问题吗?在使用 solr 5.2.1 和 hdp 2.4 的 Solr->HDFS 配置中看到相同的错误。

标签: solr hdfs


【解决方案1】:

原因:协议消息结束组标记与预期标记不匹配。

发生此错误是因为您使用了不正确的 HDFS 端口。见hdfs - ls: Failed on local exception: com.google.protobuf.InvalidProtocolBufferException:

这里您需要将端口从 50070(看起来像 NameNode web ui 端口)更改为 8020 或您用作 NameNode RPC 端口的任何端口:

<str name="solr.hdfs.home">hdfs://10.67.5.244:50070/tmp</str>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-12-21
    • 1970-01-01
    • 2017-03-11
    • 2020-02-15
    • 2014-04-23
    • 1970-01-01
    • 2021-05-11
    • 2014-03-29
    相关资源
    最近更新 更多