Hi I have copied my Solr config from a working windows server to a new one, and it can't seem to run an import.
They're both using win server 2008 and SQL 2008R2. This is the data import config:
<dataConfig>
<dataSource type="JdbcDataSource" name="ds1"
driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost;databaseName=DB"
user="Solr"
password="pwd"/>
<document name="datas">
<entity name="data" dataSource="ds1" pk="key"
query="EXEC SOLR_COMPANY_SEARCH_DATA"
deltaImportQuery="SELECT * FROM Company_Search_Data WHERE [key]='${dataimporter.delta.key}'"
deltaQuery="SELECT [key] FROM Company_Search_Data WHERE modify_dt > '${dataimporter.last_index_time}'">
<field column="WorkDesc_Comments" name="WorkDesc_Comments_Split" />
<field column="WorkDesc_Comments" name="WorkDesc_Comments_Edge" />
</entity>
</document>
</dataConfig>
I can use MS SQL Profiler to watch the Solr user log in successfully, but then nothing. It doesn't seem to even try and execute the stored procedure. Any ideas why this would be working one server and not on another?
FTR the only thing in the tomcat catalina log is:
org.apache.solr.handler.dataimport.JdbcDataSource$1 call
INFO: Creating a connection for entity data with URL: jdbc:sqlserver://localhost;databaseName=CATLive
UPDATE:
Me and Yavar Husain from the Solr Mailing list both came up with the solution of replacing the MS JDBC Driver with an open source one - this seems to work, and means this must be a compatibility problem between the latest versions of Java, the DIH and the MS JDBC driver.
UPDATE 2:
Issues have been reported with Java 1.6.0_29 - which I am running!
http://blogs.msdn.com/b/jdbcteam/archive/2011/11/07/supported-java-versions-november-2011.aspx
This looks to have been caused by a release of Java 1.6.0_29 - which I was running:
http://blogs.msdn.com/b/jdbcteam/archive/2011/11/07/supported-java-versions-november-2011.aspx
Seeing as the problem could only be with the JDBC drivers or their config, I have worked around this issue by replacing them with the jTDS Open Source JDBC driver. My config ended up like this when I got it working with that:
<dataConfig>
<dataSource type="JdbcDataSource"
driver="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://localhost;databaseName=DBName"
user="Solr"
password="password" name="ds1"/>
<document>
<entity dataSource="ds1" name="sometext"
query="SELECT * FROM mytable">
</entity>
</document>
</dataConfig>
HTH someone - but I'm not marking this as the answer because I can't see why I can't use the MS drivers...
I guess you are missing this
url="jdbc:mysql://localhost/dbname"
dbname -> \SQL2008
I presume when you copied your Solr config to the new server you've taken the index file too. I suspect the problem is due to the fact that Solr has already indexed this data. Your query states that you only want to index files that have changes since the last index.
Does this make sense?
The issue appears to occur only on very specific releases of the java runtime, and affects applications beyond just solr. This leads me to believe that the root cause is an incompatibility or bug between the Java runtime and Microsoft SQL Server JDBC drivers rather than being a Solr issue.
In my particular case we had two groups consisting of 3 servers each. One group showed no symptoms of this problem, and the other group all exhibited issues. All servers were running Solr 3.4.0, and the same release of SQL Server JDBC drivers 3.0. All servers were also running JRE 1.6.0_20, but upon closer inspection it was identified that the problem servers were using a slightly newer package for 1.6.0_20 (a different RPM distributed via yum
for CentOS).
By downgrading the problem servers to the exact version of java on the known-good servers the problem immediately went away.
Specifically,
working:
http://pkgs.org/centos-5-rhel-5/centos-rhel-x86_64/java-1.6.0-openjdk-1.6.0.0-1.22.1.9.8.el5_6.x86_64.rpm.html
non-working:
http://pkgs.org/centos-5-rhel-5/centos-rhel-updates-x86_64/java-1.6.0-openjdk-src-1.6.0.0-1.23.1.9.10.el5_7.x86_64.rpm.html