ElasticSearch错误:MapperParsingException无法解析 [英] ElasticSearch Error: MapperParsingException failed to parse

查看:1783
本文介绍了ElasticSearch错误:MapperParsingException无法解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将MYSQL与ElasticSearch集成在Windows 7中,从此链接



我已经完成了以下步骤:



1:


下载&在C目录中解压缩
https://download.elasticsearch。 org / elasticsearch / elasticsearch / elasticsearch-1.3.4.zip


2:


在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:


从MYSQL网站下载MYSQL Connector mysql-connector-java-5.1.33.zip。 / p>

解压缩并复制mysql-connector-java-5.1.33-bin.jar文件。



将其放入C:\elasticsearch-1.3.4\plu gins\jdbc


我现在检查了插件目录中有两个文件




  • elasticsearch-river-jdbc-1.3.4.4.jar


  • mysql-connector-java-5.1。 33-bin




现在我试图在CMD上执行这个命令,我有错误

  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];嵌套:JsonParseException [意外字符('''(代码39)):期望一个有效的值(数字,字符串,数组,对象,'真','假'或'空')\\ @ 3cf756; line:1,column:2]]; ,
状态:400
}






  curl:(6)无法解析主机:type;主机未找到

curl:(6)无法解析主机:没有请求类型的数据记录

curl:(6)无法解析主机:jdbc,jdbc;没有请求类型的数据记录

curl:(6)无法解析主机::;没有请求类型的数据记录

curl:(3)[globbing] pos 5中不匹配的大括号5

curl:(6)无法解析主机: ;没有请求类型的数据记录

curl:(6)无法解析主机:jdbc:mysql :;没有请求类型的数据记录

curl:(6)可以不解析主机::没有请求类型的数据记录

curl:(6)无法解析主机:root,密码;没有请求的数据记录typ
e
curl: (6)无法解析主机::没有请求类型的数据记录

curl:(6)无法解析主机:pass,sql;请求类型的数据记录

curl:(6)不能r esolve host::;没有请求类型的数据记录

curl:(6)无法解析主机:select * from abc;没有请求类型的数据记录




MYSQL(5.5.37)数据库测试)只包含一个表(abc)和两列
id(pk)和地址(varchar)


我是将此 jdbc-1.3.4.4-d2e33c3 名称用作jdbc驱动程序。我从这个链接得到这个名字。

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

我已经搜索到但是找不到与mysql集成相关的任何问题。



我的问题还是没有,或者我做错了设置。

解决方案

Windows卷发行为不同。尝试使用
curl -XPUThttp://127.0.0.1:9200/index/type/id-d{attribute:name }。尝试使用这些三重引号


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.?

解决方案

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

这篇关于ElasticSearch错误:MapperParsingException无法解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆