I am using Elasticsearch 1.3.0 in production cluster. ( I know river has been deprecated in latest version (2.0)) . Since few days I am getting error Communications link failure. I tried with increasing query_timeout. Is there any way we can fix this at river end.
Stack Trace:
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 500,000 milliseconds ago. The last packet sent successfully to the server was 500
,010 milliseconds ago.
at sun.reflect.GeneratedConstructorAccessor118.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1137)
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:673)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:427)
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3222)
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2393)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2816)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2820)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2769)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1569)
at org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.executeQuery(SimpleRiverSource.java:587)
at org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.execute(SimpleRiverSource.java:318)
at org.xbib.elasticsearch.river.jdbc.strategy.simple.SimpleRiverSource.fetch(SimpleRiverSource.java:287)
... 10 more
My river command look like.
{
"type": "jdbc",
"jdbc": {
"strategy": "simple",
"fetchsize": "50",
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost:3306/mydb",
"user": "root",
"password": "",
"sql": [{
"statement": "select * from table"
}],
"index": "index",
"type": "type",
"schedule": "0 */59 0-23 ? * ** *",
"query_timeout": 5400
},
"index": {
"index": "index",
"type": "type",
"versioning": false
}
}