Solr Dataimporthandler 导入MySQL 内存溢出

来源:互联网 发布:手机烧香软件 编辑:程序博客网 时间:2024/06/05 19:05

从Mysql数据库中用dataimporthandler导入Mysql的数据时,数据量较小时顺利完成,当数据量达到几百万时,出现了内存溢出错误:java.lang.RuntimeException: java.lang.RuntimeException。

原因:Solr默认不会把大量数据放到内存中,当数据量较大时就溢出了。

解决办法:修改配置文件data-config.xml如下:

<span style="white-space:pre"></span><dataSource type="JdbcDataSource"              <span style="white-space:pre"></span>driver="com.mysql.jdbc.Driver"                     <span style="white-space:pre"></span>url="jdbc:mysql://localhost:3306/xxxx"                      <span style="white-space:pre"></span>user="xxxx"                      <span style="white-space:pre"></span>password="xxxx"                       <span style="white-space:pre"></span>batchSize="-1" />


0 0
原创粉丝点击