I am using jdbc river
for elasticsearch to fetch bulk data from MySQL.
curl -XPUT 'localhost:9200/_river/company_river/_meta' -d '{
"type": "jdbc",
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost:3306/dbname",
"user": "username",
"password": "password",
"sql": "select id as _id, name, date, code, status from tablename",
"strategy": "simple",
"poll": "2s"
},
"index": {
"index": "jdbc",
"type": "jdbc",
"versioning": true,
"digesting": true,
"bulk_size": 160,
"max_bulk_requests": 5
}
}'
The above command when I execute, It won't fetch all data from MySQL. Table contains more than 100M records.