Elasticsearch-river-jdbc, how to import data from mysql?

Hi, I try to use elasticsearch-river-jdbc to import data from mysql.
I do it according to the github QuickStarthttps://github.com/jprante/elasticsearch-river-jdbc/wiki/Quickstart,
my elasticsearch works fine and I put mysql-connector-java-5.1.27-bin.jar
in the right place. And my database connection is fine.

When I open a new terminal and try to import data using the following
command:
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type": "jdbc",
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://10.10.79.202:3306/feedback",
"user": "pvdm",
"password": "pvdm",
"sql": "select * from vrs2_playlist"
},
"index": {
"index": "tvRank",
"type": "vrs2_playlist"
}
}'

No data from table vrs2_playlist is imported, but a document is indexed
into elasticsearch, that is: _river/my_jdbc_river/_meta

What's wrong with this, or did I miss something. Please help, thanks in
advance.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Don't know if it's your issue here but we don't support uppercase index name.
Try tvrank

HTH

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

Le 26 nov. 2013 à 02:52, Daniel Guo daniel5hbs@gmail.com a écrit :

Hi, I try to use elasticsearch-river-jdbc to import data from mysql.
I do it according to the github QuickStart, my elasticsearch works fine and I put mysql-connector-java-5.1.27-bin.jar
in the right place. And my database connection is fine.

When I open a new terminal and try to import data using the following command:
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type": "jdbc",
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://10.10.79.202:3306/feedback",
"user": "pvdm",
"password": "pvdm",
"sql": "select * from vrs2_playlist"
},
"index": {
"index": "tvRank",
"type": "vrs2_playlist"
}
}'

No data from table vrs2_playlist is imported, but a document is indexed into elasticsearch, that is: _river/my_jdbc_river/_meta

What's wrong with this, or did I miss something. Please help, thanks in advance.

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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi, David:
Thanks for your tip.
You are right, the uppercase here is not correct.
While my issue is not here. Actually I have to delete the _river first,
then I can import data, for example:
first delete the river:
$ curl -XDELETE 'localhost:9200/_river'

then run the river, it works:
curl -XPUT 'localhost:9200/_river/rank_river/_meta' -d '{
"type": "jdbc",
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://10.10.79.202:3306/feedbackhttp://www.google.com/url?q=http%3A%2F%2F10.10.79.202%3A3306%2Ffeedback&sa=D&sntz=1&usg=AFQjCNF_nB7hKNiqnlBqW60d8dDw0B1Oog",

    "user": "pvdm", 
    "password": "pvdm", 
    "sql": "select * from vrs2_playlist"    

},
"index": {
"index": "rank",
"type": "playlist"
}
}'
I just don't konw why I cannot reuse the river.

On Tuesday, November 26, 2013 1:57:50 PM UTC+8, David Pilato wrote:

Don't know if it's your issue here but we don't support uppercase index
name.
Try tvrank

HTH

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

Le 26 nov. 2013 à 02:52, Daniel Guo <danie...@gmail.com <javascript:>> a
écrit :

Hi, I try to use elasticsearch-river-jdbc to import data from mysql.
I do it according to the github QuickStarthttps://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjprante%2Felasticsearch-river-jdbc%2Fwiki%2FQuickstart&sa=D&sntz=1&usg=AFQjCNETAAL7EqBjscSKSJJGvri6uCYLQg,
my elasticsearch works fine and I put mysql-connector-java-5.1.27-bin.jar
in the right place. And my database connection is fine.

When I open a new terminal and try to import data using the following
command:
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type": "jdbc",
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://10.10.79.202:3306/feedbackhttp://www.google.com/url?q=http%3A%2F%2F10.10.79.202%3A3306%2Ffeedback&sa=D&sntz=1&usg=AFQjCNF_nB7hKNiqnlBqW60d8dDw0B1Oog",

    "user": "pvdm", 
    "password": "pvdm", 
    "sql": "select * from vrs2_playlist"    
},  
"index": {  
    "index": "tvRank",  
    "type": "vrs2_playlist" 
}   

}'

No data from table vrs2_playlist is imported, but a document is indexed
into elasticsearch, that is: _river/my_jdbc_river/_meta

What's wrong with this, or did I miss something. Please help, thanks in
advance.

--
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:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

If you have already a river running, AFAIK you can not update the river settings.
So yes, removing and adding a new river is the way to do it.

My 2 cents

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 26 novembre 2013 at 09:29:59, Daniel Guo (daniel5hbs@gmail.com) a écrit:

Hi, David:
Thanks for your tip.
You are right, the uppercase here is not correct.
While my issue is not here. Actually I have to delete the _river first, then I can import data, for example:
first delete the river:
$ curl -XDELETE 'localhost:9200/_river'

then run the river, it works:
curl -XPUT 'localhost:9200/_river/rank_river/_meta' -d '{
"type": "jdbc",
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://10.10.79.202:3306/feedback",
"user": "pvdm",
"password": "pvdm",
"sql": "select * from vrs2_playlist"
},
"index": {
"index": "rank",
"type": "playlist"
}
}'
I just don't konw why I cannot reuse the river.

On Tuesday, November 26, 2013 1:57:50 PM UTC+8, David Pilato wrote:
Don't know if it's your issue here but we don't support uppercase index name.
Try tvrank

HTH

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

Le 26 nov. 2013 à 02:52, Daniel Guo danie...@gmail.com a écrit :

Hi, I try to use elasticsearch-river-jdbc to import data from mysql.
I do it according to the github QuickStart, my elasticsearch works fine and I put mysql-connector-java-5.1.27-bin.jar
in the right place. And my database connection is fine.

When I open a new terminal and try to import data using the following command:
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type": "jdbc",
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://10.10.79.202:3306/feedback",
"user": "pvdm",
"password": "pvdm",
"sql": "select * from vrs2_playlist"
},
"index": {
"index": "tvRank",
"type": "vrs2_playlist"
}
}'

No data from table vrs2_playlist is imported, but a document is indexed into elasticsearch, that is: _river/my_jdbc_river/_meta

What's wrong with this, or did I miss something. Please help, thanks in advance.

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.
For more options, visit https://groups.google.com/groups/opt_out.

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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Got it, thank you!

On Tuesday, November 26, 2013 4:31:27 PM UTC+8, David Pilato wrote:

If you have already a river running, AFAIK you can not update the river
settings.
So yes, removing and adding a new river is the way to do it.

My 2 cents

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonethttps://www.google.com/url?q=https%3A%2F%2Ftwitter.com%2Fdadoonet&sa=D&sntz=1&usg=AFQjCNE-DMC3YEu3X_lhRIhUzuSZGsaSqA
| @elasticsearchfrhttps://www.google.com/url?q=https%3A%2F%2Ftwitter.com%2Felasticsearchfr&sa=D&sntz=1&usg=AFQjCNGfXdQ98RWFMJXdiqpKnZb5GMg0zA

Le 26 novembre 2013 at 09:29:59, Daniel Guo (danie...@gmail.com<javascript:>)
a écrit:

Hi, David:
Thanks for your tip.
You are right, the uppercase here is not correct.
While my issue is not here. Actually I have to delete the _river first,
then I can import data, for example:
first delete the river:
$ curl -XDELETE 'localhost:9200/_river'

then run the river, it works:
curl -XPUT 'localhost:9200/_river/rank_river/_meta' -d '{
"type": "jdbc",
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://10.10.79.202:3306/feedbackhttp://www.google.com/url?q=http%3A%2F%2F10.10.79.202%3A3306%2Ffeedback&sa=D&sntz=1&usg=AFQjCNF_nB7hKNiqnlBqW60d8dDw0B1Oog",

    "user": "pvdm",
    "password": "pvdm",
    "sql": "select * from vrs2_playlist"    

},
"index": {
"index": "rank",
"type": "playlist"
}
}'
I just don't konw why I cannot reuse the river.

On Tuesday, November 26, 2013 1:57:50 PM UTC+8, David Pilato wrote:

Don't know if it's your issue here but we don't support uppercase index
name.
Try tvrank

HTH

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

Le 26 nov. 2013 à 02:52, Daniel Guo danie...@gmail.com a écrit :

Hi, I try to use elasticsearch-river-jdbc to import data from mysql.
I do it according to the github QuickStarthttps://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjprante%2Felasticsearch-river-jdbc%2Fwiki%2FQuickstart&sa=D&sntz=1&usg=AFQjCNETAAL7EqBjscSKSJJGvri6uCYLQg,
my elasticsearch works fine and I put mysql-connector-java-5.1.27-bin.jar
in the right place. And my database connection is fine.

When I open a new terminal and try to import data using the following
command:
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type": "jdbc",
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://10.10.79.202:3306/feedbackhttp://www.google.com/url?q=http%3A%2F%2F10.10.79.202%3A3306%2Ffeedback&sa=D&sntz=1&usg=AFQjCNF_nB7hKNiqnlBqW60d8dDw0B1Oog",

     "user": "pvdm", 
     "password": "pvdm", 
     "sql": "select * from vrs2_playlist"    
 },  
 "index": {  
     "index": "tvRank",  
     "type": "vrs2_playlist" 
 }   

}'

No data from table vrs2_playlist is imported, but a document is indexed
into elasticsearch, that is: _river/my_jdbc_river/_meta

What's wrong with this, or did I miss something. Please help, thanks in
advance.

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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.