Hi Shi Wei,

fyi: a fix for NUTCH-2903 is ready
  https://github.com/apache/nutch/pull/703

Sebastian


On 11/16/21 13:54, Sebastian Nagel wrote:
> Hi Shi Wei,
> 
> looks like you're the first trying to connect to ES from Nutch over
> HTTPS.  HTTP is used as default scheme and there is no way to configure
> the Elasticsearch index writer to use HTTPS.
> 
> Please open a Jira issue. It's a trivial fix.
> 
> 
> For a quick fix: in the Nutch source package (or git tree) edit the file
> 
> 
> src/plugin/indexer-elastic/src/java/org/apache/nutch/indexwriter/elastic/ElasticIndexWriter.java
> 
> and change the line
> 
>         hostsList[i++] = new HttpHost(host, port);
> into
>         hostsList[i++] = new HttpHost(host, port, "https");
> 
> After that you need to build nutch by running
> 
>    ant runtime
> 
> 
> See
> 
> https://www.javadoc.io/static/org.apache.httpcomponents/httpcore/4.3.2/org/apache/http/HttpHost.html#HttpHost(java.lang.String,%20int,%20java.lang.String)
> 
> Best,
> Sebastian
> 
> On 11/16/21 09:49, sw.l...@quandatics.com wrote:
>> Hi there,
>>
>> We encountered an issue when connecting to our Elasticsearch with HTTPS
>> connection as follow:
>>
>> 2021-11-16 16:37:22,034 DEBUG client.RestClient - request [POST
>> http://192.168.0.105:9200/_bulk?timeout=1m] failed
>> org.apache.http.ConnectionClosedException: Connection is closed
>>         at
>> org.apache.http.nio.protocol.HttpAsyncRequestExecutor.endOfInput(HttpAsyncRequestExecutor.java:356)
>>
>>         at
>> org.apache.http.impl.nio.client.InternalRequestExecutor.endOfInput(InternalRequestExecutor.java:132)
>>
>>         at
>> org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:261)
>>
>>         at
>> org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
>>
>>         at
>> org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
>>
>>         at
>> org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114)
>>
>>         at
>> org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
>>
>>         at
>> org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
>>
>>         at
>> org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
>>
>>         at
>> org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
>>
>>         at
>> org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
>>
>>         at
>> org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:591)
>>
>>         at java.lang.Thread.run(Thread.java:748)
>>
>> Looks like the HTTP connection is established instead of HTTPS. Could
>> you advise if there are any required parameters that we missed out in
>> the index-writers.xml? Attached are the log file and index-writers.xml.
>>
>> Thanks in advance!
>>
>>
>> Best Regards,
>> Shi Wei

Reply via email to