When I try to import a mysql table by loading this in the browser:
http://192.168.136.129:8983/solr/dataimport?command=full-import
I get this error:
HTTP ERROR 404
Problem accessing /solr/dataimport. Reason:
NOT_FOUND
Powered by Jetty://
I'm following this tutorial from the official Solr wiki to get started with the DIH:
As per the tutorial I added this to my solrconfig.xml:
data-config.xml
in data-config.xml I have the following:
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/site"
user="root"
password="123"/>
query="select user_id,about,music,movies,occupation from profiles">
And these are the fields defined in my schema.xml:
user_id
So what am I doing wrong? I imagine it may have something to do with the data-config.xml file. In it I don't know if a certain path to the MySQL driver is being assumed. I downloaded the MySQL JDBC driver from here:
and put it in my /solr/lib directory.
When I downloaded the driver and extracted it there was a bunch of folders inside one folder called "mysql-connector-java-3.0.17-ga".
I do notice that inside that there is a dir called: com and inside that mysql and inside that jbdc and inside that there is a file called Driver.class.
Is this what is being referenced from data-config.xml? If so why isn't the initial directory not mentioned.
Basically I have no idea what the issue is, can someone help please.
解决方案
just make sure you have these lines of code in solrconfig.xml file
make sure the path of those jar files and those jar files should be available physically at that path. If you don't have then please add that and try to restart the tomacat server and hopefully it will be resolved.