solr连接mysql建索引失败,如何使用Solr数据导入处理程序为MySQL表建立索引?

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值