Elasticsearch jdbc-river do not import data from mysql


(Ikaros andi) #1

I do as doc(here https://github.com/jprante/elasticsearch-river-jdbc)
says,

PUT /_river/my_jdbc_river/_meta -d
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://localhost:3306/test",
"user" : "root",
"password" : "123123",
"sql" : "select * from test limit 100",
"index" : "test",
"type" : "test"
}
}

GET /test/test/_search?pretty&q=*

result:

{
"took": 5,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}

and es cmd print below msg

[2014-08-02 15:58:14,387][WARN ][river.routing ] [Lynx] no river _meta
document found after 5 attempts

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a55c1a5e-ea43-494c-86c2-569ab16ea65e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Jörg Prante) #2

You are using Sense?

Use

PUT /_river/my_jdbc_river/_meta

not

PUT /_river/my_jdbc_river/_meta -d

Jörg

On Sat, Aug 2, 2014 at 10:43 AM, Ikaros andi android.ikaros@gmail.com
wrote:

I do as doc(here https://github.com/jprante/elasticsearch-river-jdbc)
says,

PUT /_river/my_jdbc_river/_meta -d
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://localhost:3306/test",
"user" : "root",
"password" : "123123",
"sql" : "select * from test limit 100",
"index" : "test",
"type" : "test"
}
}

GET /test/test/_search?pretty&q=*

result:

{
"took": 5,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}

and es cmd print below msg

[2014-08-02 15:58:14,387][WARN ][river.routing ] [Lynx] no river _meta
document found after 5 attempts

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/a55c1a5e-ea43-494c-86c2-569ab16ea65e%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/a55c1a5e-ea43-494c-86c2-569ab16ea65e%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ70tbF5xrcOajMQdE0EvUAdS-ogn8J6YUVnYRMujZWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Ikaros andi) #3

Yeah, I'm using Sense.Thank you for pointing out that, but GET
/test/test/_search?pretty&q=* result do not change.

On Saturday, August 2, 2014 10:36:00 PM UTC+8, Jörg Prante wrote:

You are using Sense?

Use

PUT /_river/my_jdbc_river/_meta

not

PUT /_river/my_jdbc_river/_meta -d

Jörg

On Sat, Aug 2, 2014 at 10:43 AM, Ikaros andi <android...@gmail.com
<javascript:>> wrote:

I do as doc(here https://github.com/jprante/elasticsearch-river-jdbc)
says,

PUT /_river/my_jdbc_river/_meta -d
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://localhost:3306/test",
"user" : "root",
"password" : "123123",
"sql" : "select * from test limit 100",
"index" : "test",
"type" : "test"
}
}

GET /test/test/_search?pretty&q=*

result:

{
"took": 5,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}

and es cmd print below msg

[2014-08-02 15:58:14,387][WARN ][river.routing ] [Lynx] no river _meta
document found after 5 attempts

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/a55c1a5e-ea43-494c-86c2-569ab16ea65e%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/a55c1a5e-ea43-494c-86c2-569ab16ea65e%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8c850491-d4cd-40a3-a239-d07557dde192%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Ikaros andi) #4

There is a error seems be the key.

[2014-08-03 09:10:57,791][DEBUG][action.index ] [Amina Synge]

[_river][0], node[95_1PcghS5aXgd3PQqqBFA], [P]
, s[STARTED]: Failed to execute [index {[_river][my_jdbc_river][_meta],
source[{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://127.0.0.1:3306/test",
"user" : "root",
"password" : "123123",
"sql" : "select id as _id from documents",
"index" : "test",
"type" : "test",
}
}
]}]
org.elasticsearch.index.mapper.MapperParsingException: failed to parse
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:536)
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:462)
at
org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:394)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:194)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationActi
on.performOnPrimary(TransportShardReplicationOperationAction.java:534)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationActi
on$1.run(TransportShardReplicationOperationAction.java:433)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.elasticsearch.common.jackson.core.JsonParseException:
Unexpected character ('}' (code 125)): was expectin
g either valid name character (for unquoted name) or double-quote (for
quoted) to start field name
at [Source: [B@3f0cb9e7; line: 10, column: 6]
at
org.elasticsearch.common.jackson.core.JsonParser._constructError(JsonParser.java:1524)
at
org.elasticsearch.common.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:557)
at
org.elasticsearch.common.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:475
)
at
org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser._handleOddName(UTF8StreamJsonParser.java:1792
)
at
org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser._parseName(UTF8StreamJsonParser.java:1480)
at
org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:700)
at
org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:50)
at
org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:492)
at
org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:538)
at
org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:480)
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:515)
... 8 more

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d1d2610c-da58-41e5-abc0-f84aede089fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(David Pilato) #5

The latest comma?
"type" : "test",

Should be
"type" : "test"

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 août 2014 à 03:14, mithril android.ikaros@gmail.com a écrit :

There is a error seems be the key.

[2014-08-03 09:10:57,791][DEBUG][action.index ] [Amina Synge] [_river][0], node[95_1PcghS5aXgd3PQqqBFA], [P]
, s[STARTED]: Failed to execute [index {[_river][my_jdbc_river][_meta], source[{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://127.0.0.1:3306/test",
"user" : "root",
"password" : "123123",
"sql" : "select id as _id from documents",
"index" : "test",
"type" : "test",
}
}
]}]
org.elasticsearch.index.mapper.MapperParsingException: failed to parse
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:536)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:462)
at org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:394)
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:194)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationActi
on.performOnPrimary(TransportShardReplicationOperationAction.java:534)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationActi
on$1.run(TransportShardReplicationOperationAction.java:433)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.elasticsearch.common.jackson.core.JsonParseException: Unexpected character ('}' (code 125)): was expectin
g either valid name character (for unquoted name) or double-quote (for quoted) to start field name
at [Source: [B@3f0cb9e7; line: 10, column: 6]
at org.elasticsearch.common.jackson.core.JsonParser._constructError(JsonParser.java:1524)
at org.elasticsearch.common.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:557)
at org.elasticsearch.common.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:475
)
at org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser._handleOddName(UTF8StreamJsonParser.java:1792
)
at org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser._parseName(UTF8StreamJsonParser.java:1480)
at org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:700)
at org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:50)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:492)
at org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:538)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:480)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:515)
... 8 more

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d1d2610c-da58-41e5-abc0-f84aede089fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/23E0C76F-DA43-4137-A27E-3AEBF8B094DF%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.


(Jörg Prante) #6

As the error message indicates, at line 10, you have a comma after

"type" : "test",

and before a closing "}", which is invalid JSON syntax.

Jörg

On Sun, Aug 3, 2014 at 3:14 AM, mithril android.ikaros@gmail.com wrote:

There is a error seems be the key.

[2014-08-03 09:10:57,791][DEBUG][action.index ] [Amina Synge]

[_river][0], node[95_1PcghS5aXgd3PQqqBFA], [P]
, s[STARTED]: Failed to execute [index {[_river][my_jdbc_river][_meta],
source[{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://127.0.0.1:3306/test",
"user" : "root",
"password" : "123123",
"sql" : "select id as _id from documents",
"index" : "test",
"type" : "test",
}
}
]}]
org.elasticsearch.index.mapper.MapperParsingException: failed to parse
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:536)
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:462)
at
org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:394)
at
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:194)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationActi
on.performOnPrimary(TransportShardReplicationOperationAction.java:534)
at
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationActi
on$1.run(TransportShardReplicationOperationAction.java:433)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.elasticsearch.common.jackson.core.JsonParseException:
Unexpected character ('}' (code 125)): was expectin
g either valid name character (for unquoted name) or double-quote (for
quoted) to start field name
at [Source: [B@3f0cb9e7; line: 10, column: 6]
at
org.elasticsearch.common.jackson.core.JsonParser._constructError(JsonParser.java:1524)
at
org.elasticsearch.common.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:557)
at
org.elasticsearch.common.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:475
)
at
org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser._handleOddName(UTF8StreamJsonParser.java:1792
)
at
org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser._parseName(UTF8StreamJsonParser.java:1480)
at
org.elasticsearch.common.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:700)
at
org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:50)
at
org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:492)
at
org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:538)
at
org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:480)
at
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:515)
... 8 more

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/d1d2610c-da58-41e5-abc0-f84aede089fd%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/d1d2610c-da58-41e5-abc0-f84aede089fd%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoF-qm1Dfd9zrHntd92tp_gRCoKjhEtwckxynRDNwOe%2BWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #7