博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ElasticSearch-SQL 5.5 安装及配置
阅读量:4041 次
发布时间:2019-05-24

本文共 1586 字,大约阅读时间需要 5 分钟。

elasticSearch-sql是提供es的类SQL查询的相关接口,支持大部分的SQL语句的查询的插件,

官方网址:

安装环境:

elasticsearch 5.5.0

jdk1.8 

centos 7

1.安装es-sql依赖node npm

es-sql 5.x版本以后,安装需要依赖node 和 npm ,先安装node和npm,安装后在检查node及npm的安装,命令如下:

  1. yum -y install nodejs npm

  2. node -v 

  3. npm -v

2.切换到es的安装目录,执行下面命令(不同版本对应不同的es-sql),安装es-sql插件,安装完后plugin文件下可以看到

./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.0.0/elasticsearch-sql-5.5.0.1.zip

3.安装es-sql的前端

下载安装包:sudo wget https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/es-sql-site-standalone.zip

解压: sudo unzip es-sql-site-standalone.zip

赋权限给centos用户:sudo chown -R centos:centos site-server/

进入site-server文件夹执行命令:npm install express --save

可以修改site_configuration.json中启动端口

4.重启es,然后启动es-sql前端

node node-server.js &

5.浏览器访问es-sql前端安装服务器,例如:

6.安装完后的执行SQL语句,遇到的异常以及修改办法。

问题1:"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot POST /_sql</pre>\n</body>\n</html>

---这个是因为help左边栏(上图红框)中默认是es-sql的端口号,需要修改为es的对外请求端口号9200

在查这个问题时,服务器上执行SQL也报错,拒绝连接

这样是因为es的配置文件elasticsearch.yml中指定了network的host仅一个外网访问,加上127.0.0.1就可以,多个用,分隔

 问题2:上述修改完后,报Error:Error occured! response is not avalible.

 Error:Error occured! response is not avalible.Provisional headers are shown

---es的配置文件elasticsearch.yml中增加配置

http.cors.enabled: true

http.cors.allow-credentials: true
http.cors.allow-origin: "/.*/"
http.cors.allow-headers: WWW-Authenticate,X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization

报错原因是测试服务器中的配置,将allow-origin进行了限制访问

 

另外如果安装了x-pack权限验证,需要关掉

转载地址:http://kxadi.baihongyu.com/

你可能感兴趣的文章
flutter-解析json
查看>>
android中shader的使用
查看>>
java LinkedList与ArrayList迭代器遍历和for遍历对比
查看>>
drat中构造方法
查看>>
JavaScript的一些基础-数据类型
查看>>
JavaScript基础知识(2)
查看>>
转载一个webview开车指南以及实际项目中的使用
查看>>
android中对于非属性动画的整理
查看>>
一个简单的TabLayout的使用
查看>>
ReactNative使用Redux例子
查看>>
Promise的基本使用
查看>>
coursesa课程 Python 3 programming 统计文件有多少单词
查看>>
coursesa课程 Python 3 programming 输出每一行句子的第三个单词
查看>>
Returning a value from a function
查看>>
coursesa课程 Python 3 programming Functions can call other functions 函数调用另一个函数
查看>>
coursesa课程 Python 3 programming The while Statement
查看>>
course_2_assessment_6
查看>>
coursesa课程 Python 3 programming course_2_assessment_7 多参数函数练习题
查看>>
coursesa课程 Python 3 programming course_2_assessment_8 sorted练习题
查看>>
在unity中建立最小的shader(Minimal Shader)
查看>>