Followers

Thursday, April 4, 2013

Solr with Remote DB.

Solr with Remote DB.

Issue:

I tried to connect to SOLR ( Preprocess and build index). It failed with following error.


INFO: Data import process was unsuccessful. An unrecoverable error has occurred.
Throwable occurred: org.apache.solr.client.solrj.SolrServerException: org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 100 ms
                at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:480)
                at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:246)
                at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
                at com.ibm.commerce.foundation.dataimport.process.util.SolrUtil.makeDataImportNoCleanCommand(SolrUtil.java:301)
                at com.ibm.commerce.foundation.dataimport.process.DataImportProcessorMain.fullDataImport(DataImportProcessorMain.java:1379)
                at com.ibm.commerce.foundation.dataimport.process.DataImportProcessorMain.executeDIH(DataImportProcessorMain.java:759)
                at com.ibm.commerce.foundation.dataimport.process.DataImportProcessorMain.main(DataImportProcessorMain.java:312)


Then I tried to increase timeout like this:
C:\WCDE_ENT70\bin> di-buildindex.bat -masterCatalogId 10001 -solrConnTimeout 15000

Then I got:
org.apache.solr.client.solrj.SolrServerException: java.net.ConnectException: Connection refused: connect

SOLUTION:

Connection setting in DB for SOLR was wrong in remote DB ( which is running in Linux)
I have to update the tables SRCHCONF and SRCHCONFEXT to point it to local toolkit server.

update SRCHCONF set config='IndexScopeTag=0,SearchServerPort=80,SearchServerName=localhost,PreProcessConfigDirectory=C:\WCDE_E~1\search\pre-processConfig\MC_10001\DB2' where indextype='CatalogEntry';

update SRCHCONF set config='IndexScopeTag=1,SearchServerPort=80,SearchServerName=localhost,PreProcessConfigDirectory=C:\WCDE_E~1\search\pre-processConfig\MC_10001\DB2\CatalogGroup' where indextype='CatalogGroup';

update SRCHCONFEXT set config ='SearchServerPort=80,SearchServerName=localhost';


Restarted server and it worked. Earlier these config values were pointing to wrong servers ( Linux machines).

Server and port names should match with workspace\WC\xml\config\com.ibm.commerce.catalog-fep\wc-search.xml