I’m wondering if there’s any solution to this stupid problem.
I set up an hadoop cluster made up with 3 namenodes and 5 datanodes. Then I created a solr9 cluster and told it to save the indexed on hadoop.
The point is that in hadoop there is a single active server and, when it will fail, solr will be offline from the new active one.
I set up a loadbalancing service with haproxy but when change the solr variable from
SOLR_OPTS="$SOLR_OPTS -Dsolr.hdfs.home=hdfs://ACTIVE_NODE:PORT/solr"
to
SOLR_OPTS="$SOLR_OPTS -Dsolr.hdfs.home=hdfs://LOADBALANCER:PORT/solr"
solr stops saving data on hadoop.
With the command
curl --request POST
--url http://LOADBALANCER:PORT/api/collections
--header 'Content-Type: application/json'
--data '{
"name": "prova_115",
"numShards": 1,
"replicationFactor": 1
}'
I get this error
{"responseHeader":{"status":400,"QTime":153},"error":{"metadata":{"error-class":"org.apache.solr.common.SolrException","root-error-class":"org.apache.solr.common.SolrException"},"msg":"collection already exists: prova_114","code":400}}%`
on SOLR9 side I see these messages saying that it received the request :
2024-08-28 14:50:26.306 INFO (OverseerThreadFactory-17-thread-5) [c:prova_115 s: r: x: t:] o.a.s.c.a.c.CreateCollectionCmd Create collection prova_115
2024-08-28 14:50:26.808 INFO (OverseerStateUpdate-72057594639679509-solr1:8993_solr-n_0000000095) [c: s: r: x: t:] o.a.s.c.o.SliceMutator createReplica() {
"core":"prova_115_shard1_replica_n1",
"node_name":"solr5:8993_solr",
"base_url":"http://solr5:8993/solr",
"collection":"prova_115",
"shard":"shard1",
"state":"down",
"type":"NRT",
"operation":"ADDREPLICA",
"waitForFinalState":"false"}
2024-08-28 14:50:26.915 INFO (zkCallback-11-thread-6) [c: s: r: x: t:] o.a.s.c.c.ZkStateReader A cluster state change: [WatchedEvent state:SyncConnected type:NodeDataChanged path:/collections/prova_115/state.json zxid: 42949761278] for collection [prova_115] has occurred - updating... (live nodes size: [5])
then the datanode who received the order to create di collection tries to save the data but gives back this :
2024-08-28 14:50:27.022 ERROR (OverseerThreadFactory-17-thread-5) [c:prova_115 s: r: x: t:] o.a.s.c.a.c.CollectionHandlingUtils Error from shard: http://solr5:8993/solr => org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException: Error from server at http://solr5:8993/solr/admin/cores: Error CREATEing SolrCore 'prova_115_shard1_replica_n1': Unable to create core [prova_115_shard1_replica_n1] Caused by: Connection refused
at org.apache.solr.client.solrj.impl.HttpSolrClientBase.processErrorsAndResponse(HttpSolrClientBase.java:297)
org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException: Error from server at http://solr5:8993/solr/admin/cores: Error CREATEing SolrCore 'prova_115_shard1_replica_n1': Unable to create core [prova_115_shard1_replica_n1] Caused by: Connection refused
at org.apache.solr.client.solrj.impl.HttpSolrClientBase.processErrorsAndResponse(HttpSolrClientBase.java:297) ~[?:?]
at org.apache.solr.client.solrj.impl.Http2SolrClient.processErrorsAndResponse(Http2SolrClient.java:570) ~[?:?]
at org.apache.solr.client.solrj.impl.Http2SolrClient$1.lambda$onHeaders$0(Http2SolrClient.java:472) ~[?:?]
at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:363) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
2024-08-28 14:50:27.022 ERROR (OverseerThreadFactory-17-thread-5) [c:prova_115 s: r: x: t:] o.a.s.c.a.c.CollectionHandlingUtils Cleaning up collection [prova_115].
it looks like haproxy does not forward the calls to the servers but it does.
1