美文网首页
elasticsearch-sql插件

elasticsearch-sql插件

作者: 佛系小懒 | 来源:发表于2020-02-07 16:27 被阅读0次

前置

elasticsearch版本:7.0.0

安装elasticsearch-sql插件

安装命令:./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.0.0/elasticsearch-sql-7.0.0.0.zip

执行测试:

curl -X GET "XXXXX:9200/_sql" -H 'Content-Type: application/json' -d'select * from tspark limit 10'

得到如下结果:{"took":146,"timed_out":false,"_shards":XXXXX}

安装过程可能出现错误信息:

uncaught exception in thread [main]

org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: Cannot replace existing handler for [/_sql] for method: POST

原因:elasticsearch-sql与自带的x-pack-sql模块冲突,vi /opt/elasticsearch/config/elasticsearch.yml 修改

xpack.sql.enabled: false重启ES,参考链接

相关文章

网友评论

      本文标题:elasticsearch-sql插件

      本文链接:https://www.haomeiwen.com/subject/iivmxhtx.html