Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticSearch Error: MapperParsingException failed to parse

I am trying to integrate MYSQL in ElasticSearch On windows 7 from this link

I have completed the following steps:

1:

Download & Unzip in C Directory https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.4.zip

2:

Run this command on CMD ./bin/plugin --install jdbc --url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/1.3.4.4/elasticsearch-river-jdbc-1.3.4.4-plugin.zip

3:

Download MYSQL Connector mysql-connector-java-5.1.33.zip from MYSQL website.

Unzip and copy mysql-connector-java-5.1.33-bin.jar file.

Place it into C:\elasticsearch-1.3.4\plugins\jdbc

I have checked now there are two files in plugins directory

  • elasticsearch-river-jdbc-1.3.4.4.jar

  • mysql-connector-java-5.1.33-bin

Now I tried to execute this command on CMD and I got error

curl -XPUT 'localhost:9200/_river/jdbc-1.3.4.4-d2e33c3/_meta' -d '{
    "type" : "jdbc",
    "jdbc" : {
        "url" : "jdbc:mysql://localhost:3306/test",
        "user" : "root",
        "password" : "pass",
        "sql" : "select * from abc"
    }
}'

{
  "error": "MapperParsingException[failed to parse]; nested: JsonParseException[Unexpected character (''' (code 39)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: [B@3cf756; line: 1, column:2]]; ",
  "status": 400
}

curl: (6) Could not resolve host: type; Host not found

curl: (6) Could not resolve host: :; No data record of requested type

curl: (6) Could not resolve host: jdbc,jdbc; No data record of requested type

curl: (6) Could not resolve host: :; No data record of requested type

curl: (3) [globbing] unmatched brace at pos 5

curl: (6) Could not resolve host: :; No data record of requested type

curl: (6) Could not resolve host: jdbc:mysql:; No data record of requested type

curl: (6) Could not resolve host: :; No data record of requested type

curl: (6) Could not resolve host: root,password; No data record of requested typ
e
curl: (6) Could not resolve host: :; No data record of requested type

curl: (6) Could not resolve host: pass,sql; No data record of requested type

curl: (6) Could not resolve host: :; No data record of requested type

curl: (6) Could not resolve host: select * from abc; No data record of requested type

MYSQL(5.5.37) Database (test) contains just one table (abc) with two columns id(pk) and address (varchar)

I am using this jdbc-1.3.4.4-d2e33c3 name as jdbc driver. I get this name from this link.

http://localhost:9200/_nodes?settings=true&pretty=true

I have searched on it but cannot found any issue like this related to mysql integration.

My Question is anything still missing or I am doing wrong setup.?

like image 814
Shoaib Ijaz Avatar asked Aug 04 '26 01:08

Shoaib Ijaz


1 Answers

On Windows curls acts differently. Try using curl -XPUT "http://127.0.0.1:9200/index/type/id" -d "{ """attribute""" : """name""" }".Try with those triple quotes

like image 98
atkawa7 Avatar answered Aug 05 '26 20:08

atkawa7



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!