Nutch 1.15 просто не будет указывать на Elasticsearch - PullRequest
0 голосов
/ 24 декабря 2018

Редактировать: Решено переключением на Elasticsearch версии 5.3.3.

Я перепробовал все.Я изменил index-writers.xml всеми возможными способами, я установил свои настройкиasticsearch в nutch-site.xml и правильно установил свои плагины в nutch-site.xml.

Это всераньше работал с Nutch 2.0, и я слышал, что он работал с Nutch 1.0 и старше.Что-то другое с 1.15?Это просто не работает?Я что-то упускаю?

Это ошибка, которую я всегда получаю:

Indexing job did not succeed, job status:FAILED, reason: NA
Indexer: java.lang.RuntimeException: Indexing job did not succeed, job 
status:FAILED, reason: NA
        at org.apache.nutch.indexer.IndexingJob.index(IndexingJob.java:152)
        at org.apache.nutch.indexer.IndexingJob.run(IndexingJob.java:235)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.nutch.indexer.IndexingJob.main(IndexingJob.java:244)

Вот мои различные настройки:

index-writers.xml:

<writer id="indexer_elastic_1" class="org.apache.nutch.indexwriter.elastic.ElasticIndexWriter">
    <parameters>
      <param name="host" value="localhost"/>
      <param name="port" value="9300"/>
      <param name="cluster" value="elasticsearch"/>
      <param name="index" value="nutch"/>
      <param name="max.bulk.docs" value="250"/>
      <param name="max.bulk.size" value="2500500"/>
      <param name="exponential.backoff.millis" value="100"/>
      <param name="exponential.backoff.retries" value="10"/>
      <param name="bulk.close.timeout" value="600"/>
    </parameters>
    <mapping>
      <copy>
        <field source="title" dest="title,search"/>
      </copy>
      <rename />
      <remove />
    </mapping>
  </writer>
  <writer id="indexer_elastic_rest_1" class="org.apache.nutch.indexwriter.elasticrest.ElasticRestIndexWriter">
    <parameters>
      <param name="host" value="localhost"/>
      <param name="port" value="9200"/>
      <param name="index" value="nutch"/>
      <param name="max.bulk.docs" value="250"/>
      <param name="max.bulk.size" value="2500500"/>
      <param name="type" value="doc"/>
      <param name="https" value="false"/>
      <param name="trustallhostnames" value="false"/>
      <param name="languages" value=""/>
      <param name="separator" value="_"/>
      <param name="sink" value="others"/>
    </parameters>
    <mapping>
      <copy>
        <field source="title" dest="search"/>
      </copy>
      <rename />
      <remove />
    </mapping>
  </writer>

плагины nutch-site.xml:

<property>
    <name>plugin.includes</name>
    <value>protocol-http|urlfilter-regex|parse-(html|tika)|index-(basic|anchor)|indexer-elastic|scoring-opic|urlnormalizer-(pass|regex|basic)</value>
</property>

и мои настройки настройки nutch-site.xml:

    <property>
  <name>elastic.host</name>
  <value></value>
  <description>localhost</description>
</property>

<property> 
  <name>elastic.port</name>
  <value>9300</value>
  <description>The port to connect to using TransportClient.</description>
</property>

<property> 
  <name>elastic.cluster</name>
  <value>elasticsearch</value>
  <description>The cluster name to discover. Either host and port must be defined
  or cluster.</description>
</property>

<property> 
  <name>elastic.index</name>
  <value>nutch</value> 
  <description>Default index to send documents to.</description>
</property>

<property> 
  <name>elastic.max.bulk.docs</name>
  <value>250</value> 
  <description>Maximum size of the bulk in number of documents.</description>
</property>

<property> 
  <name>elastic.max.bulk.size</name>
  <value>2500500</value> 
  <description>Maximum size of the bulk in bytes.</description>
</property>

<property>
  <name>elastic.exponential.backoff.millis</name>
  <value>100</value>
  <description>Initial delay for the BulkProcessor's exponential backoff policy.
  </description>
</property>

<property>
  <name>elastic.exponential.backoff.retries</name>
  <value>10</value>
  <description>Number of times the BulkProcessor's exponential backoff policy
  should retry bulk operations.</description>
</property>
...