I have a mysql database with over 400,000,000 records in one table.
Solr import works fine when I set a limit. My last test was 10,000,000, and it worked successfully after about 5 minutes. A complete dataset is required in Solr, and when I remove the limit, solr reports that it has lost connection to mysql.
I believe that I am faced with what seems to be the wrong configuration or limitation of my current configuration.
Here is the catalina.out directory from tomcat
Caused by: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query: SELECT id as solr_id, id,firstname, lastname, state from names Processing Document
MySQL Log
130616 16:15:29 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 130616 16:15:29 [Warning] option 'max_allowed_packet': unsigned value 53687091200 adjusted to 1073741824 130616 16:15:29 InnoDB: Initializing buffer pool, size = 22.0G 130616 16:15:30 InnoDB: Completed initialization of buffer pool 130616 16:15:31 InnoDB: Started; log sequence number 49 1885610091 130616 16:15:31 [Note] Event Scheduler: Loaded 0 events 130616 16:15:31 [Note] /usr/libexec/mysqld: ready for connections. Version: '5.1.69' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
MySQL table
CREATE TABLE `names` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `state` varchar(12) DEFAULT NULL, `source` varchar(128) DEFAULT NULL, `lastname` varchar(128) DEFAULT NULL, `firstname` varchar(128) DEFAULT NULL, PRIMARY KEY (`id`), KEY `source-state` (`source`,`state`), KEY `first-last` (`firstname`,`lastname`), KEY `first-last-state` (`firstname`,`lastname`,`state`) ) ENGINE=InnoDB AUTO_INCREMENT=433924211 DEFAULT CHARSET=utf8;
MySQL configuration
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 wait_timeout=66600 net_read_timeout=66600 interactive_timeout=666666 max_allowed_packet=50G max_connect_errors=666666 innodb_buffer_pool_size=22GB innodb_flush_log_at_trx_commit = 2 thread_cache_size=4 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
Solr data-config.xml
<dataConfig> <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://127.0.0.1:3306/databasename?zeroDateTimeBehavior=convertToNull" user="root" password="password" stream="true"/> <document name="content"> <entity name="names" pk="id" query="SELECT id as solr_id, id,firstname, lastname, state from names limit 10000000"> <field column="solr_id" name="solr_id" /> <field column="id" name="id" /> <field column="firstname" name="firstname" /> <field column="lastname" name="lastname" /> <field column="state" name="state" /> </entity> </document> </dataConfig>