SOLR数据导入错误&“无法执行查询". [英] SOLR DataImport Error "Unable to Execute Query"

查看:109
本文介绍了SOLR数据导入错误&“无法执行查询".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Amazon EC2实例上运行的网站,并且我正在尝试让Solr连接并使用我正在使用的数据库.我可以使用管理界面并为示例xml文件建立索引,但是每当我尝试导入我的数据库表之一时,都会收到错误消息

I have a website running on an Amazon EC2 Instance, and I'm trying to get Solr to interface and work with the database I'm using. I'm able to use the admin interface and have gotten the example xml files indexed, but whenever I try to import one of my database tables, I get the error

SEVERE: Exception while processing: gamelydb document : SolrInputDocument[{}]:org.apache.solr.handler.dataimport.DataImportHandlerException:
 Unable to execute query: SELECT * FROM league Processing Document # 1

这是我的data-config.xml文件.我还将dataimporthandler添加到solrconfig.xml文件中.

Here's my data-config.xml file. I also added the dataimporthandler to the solrconfig.xml file.

<dataConfig>
  <dataSource type="JdbcDataSource"
              driver="com.mysql.jdbc.Driver"
              url="jdbc:mysql://www.mysite.com/mydb"
              user="root"
              password="mypassword"/>
  <document>
    <entity name="mydb"
            query="SELECT * FROM league">
       <field column="id" name="id" />
       <field column="leaguename" name="leaguename" />
    </entity>
  </document>
</dataConfig>

知道为什么会这样吗?并且让我知道是否需要澄清任何事情.

Any idea why this is happening? And just let me know if I need to clarify anything.

因此,我稍微更改了网址并删除了"http://",该错误似乎消失了.但是,似乎没有任何信息可以通过管理员进行搜索.现在,数据目录中有一些文件(_1.fnm,_1.frq ...).这是solr打印到日志的内容.

So I changed the url a bit and removed the 'http://' and that error seemed to go away. However none of the information seems to be searchable through the admin. There are now a few files in the data directory (_1.fnm, _1.frq,...). Here is what solr prints to the log.

Jul 13, 2011 1:19:45 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/dataimport params={} status=0 QTime=4
Jul 13, 2011 1:19:48 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/dataimport params={command=full-import} status=0 QTime=4
Jul 13, 2011 1:19:48 PM org.apache.solr.handler.dataimport.DataImporter doFullImport
INFO: Starting Full Import
Jul 13, 2011 1:19:48 PM org.apache.solr.handler.dataimport.SolrWriter readIndexerProperties
INFO: Read dataimport.properties
Jul 13, 2011 1:19:48 PM org.apache.solr.update.DirectUpdateHandler2 deleteAll
INFO: [] REMOVING ALL DOCUMENTS FROM INDEX
Jul 13, 2011 1:19:48 PM org.apache.solr.core.SolrDeletionPolicy onInit
INFO: SolrDeletionPolicy.onInit: commits:num=1
        commit{dir=/home/ec2-user/public_html/solr/example/solr/data/index,segFN=segments_2,version=1310405039852,generation=2,filenames=[_0.tis, _0.nrm, _0.fnm, _0.tii, _0.frq, segments_2, _0.fdx, _0.fdt]
Jul 13, 2011 1:19:48 PM org.apache.solr.core.SolrDeletionPolicy updateCommits
INFO: newest commit = 1310405039852
Jul 13, 2011 1:19:48 PM org.apache.solr.handler.dataimport.JdbcDataSource$1 call
INFO: Creating a connection for entity gamelydb with URL: jdbc:mysql://www.gamely.us/gamelydb
Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.JdbcDataSource$1 call
INFO: Time taken for getConnection(): 667
Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.DocBuilder finish
INFO: Import completed successfully
Jul 13, 2011 1:19:49 PM org.apache.solr.update.DirectUpdateHandler2 commit
INFO: start commit(optimize=true,waitFlush=false,waitSearcher=true,expungeDeletes=false)
Jul 13, 2011 1:19:49 PM org.apache.solr.core.SolrDeletionPolicy onCommit
INFO: SolrDeletionPolicy.onCommit: commits:num=2
        commit{dir=/home/ec2-user/public_html/solr/example/solr/data/index,segFN=segments_2,version=1310405039852,generation=2,filenames=[_0.tis, _0.nrm, _0.fnm, _0.tii, _0.frq, segments_2, _0.fdx, _0.fdt]
        commit{dir=/home/ec2-user/public_html/solr/example/solr/data/index,segFN=segments_3,version=1310405039855,generation=3,filenames=[_1.fdx, _1.tis, _1.frq, _1.fdt, _1.tii, _1.fnm, _1.nrm, segments_3]
Jul 13, 2011 1:19:49 PM org.apache.solr.core.SolrDeletionPolicy updateCommits
INFO: newest commit = 1310405039855
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher <init>
INFO: Opening Searcher@1c4795e main
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming Searcher@1c4795e main from Searcher@1d38b87 main
        fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming result for Searcher@1c4795e main
        fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming Searcher@1c4795e main from Searcher@1d38b87 main
        filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming result for Searcher@1c4795e main
        filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming Searcher@1c4795e main from Searcher@1d38b87 main
        queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=1,evictions=0,size=1,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming result for Searcher@1c4795e main
        queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming Searcher@1c4795e main from Searcher@1d38b87 main
        documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher warm
INFO: autowarming result for Searcher@1c4795e main
        documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.core.QuerySenderListener newSearcher
INFO: QuerySenderListener sending requests to Searcher@1c4795e main
Jul 13, 2011 1:19:49 PM org.apache.solr.core.QuerySenderListener newSearcher
INFO: QuerySenderListener done.
Jul 13, 2011 1:19:49 PM org.apache.solr.update.DirectUpdateHandler2 commit
INFO: end_commit_flush
Jul 13, 2011 1:19:49 PM org.apache.solr.core.SolrCore registerSearcher
INFO: [] Registered new searcher Searcher@1c4795e main
Jul 13, 2011 1:19:49 PM org.apache.solr.search.SolrIndexSearcher close
INFO: Closing Searcher@1d38b87 main
        fieldValueCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
        filterCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
        queryResultCache{lookups=0,hits=0,hitratio=0.00,inserts=1,evictions=0,size=1,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
        documentCache{lookups=0,hits=0,hitratio=0.00,inserts=0,evictions=0,size=0,warmupTime=0,cumulative_lookups=0,cumulative_hits=0,cumulative_hitratio=0.00,cumulative_inserts=0,cumulative_evictions=0}
Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.SolrWriter readIndexerProperties
INFO: Read dataimport.properties
Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.SolrWriter persist
INFO: Wrote last indexed time to /home/ec2-user/public_html/solr/example/solr/./conf/dataimport.properties
Jul 13, 2011 1:19:49 PM org.apache.solr.update.processor.LogUpdateProcessor finish
INFO: {deleteByQuery=*:*,add=[9, 10, 11, 12, 13, 14],optimize=} 0 4
Jul 13, 2011 1:19:49 PM org.apache.solr.handler.dataimport.DocBuilder execute
INFO: Time taken = 0:0:1.66

如果您在这里找到了可以降低的价格,请告诉我,以便我进行修复.

If you find something on here that's downvotable, please just let me know so I can fix it.

推荐答案

我认为问题出在url参数. 如果MySQL数据库位于同一台计算机上,请使用url="jdbc:mysql://localhost/mydb" 如果它在www.mysite.com上,则使用url="jdbc:mysql://www.mysite.com/mydb"

I think the problem is with the url parameter. If the MySQL database is on the same machine, then use url="jdbc:mysql://localhost/mydb" If its on www.mysite.com, then use url="jdbc:mysql://www.mysite.com/mydb"

此外,您的日志文件可能包含有关该错误的更多详细信息-请遍历日志并在此处张贴相应的条目.

Also, your log files may have more details regarding the error - please go through the logs and post the appropriate entries here.

这篇关于SOLR数据导入错误&“无法执行查询".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆