elasticsearch-sql插件使用
1、2,elasticsearch-sql安裝:
第一安裝:當前的es版本如果是6.8.10,你要去下載es的sql插件版本也是6.8.10
2.根據es版本下載相應的es-sql
https://github.com/NLPchina/elasticsearch-sql
3.1離線安裝
在es的插件目錄下新建文件夾sql,將解壓的文件夾中的文件復制到sql中;
3,es-sql-site-standalone安裝
管理后台:
https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/es-sql-site-standalone.zip
Then
start the web front-end like this:
cd site-server
npm install express --save
node node-server.js
3.修改elasticsearch配置文件,增加下面參數配置 【看樣子應該是允許跨域訪問的配置,因為下面的elasticsearch-sql web界面安裝需要跨域訪問】
vim /data/elasticsearch/config/elasticsearch.yml
3.修改elasticsearch配置文件,增加下面參數配置 【看樣子應該是允許跨域訪問的配置,因為下面的elasticsearch-sql web界面安裝需要跨域訪問】
vim /data/elasticsearch/config/elasticsearch.yml
訪問:http://localhost:8082站點成功(手動修改site_configuration.json中默認端口)
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
7.安裝nodejs
linux版本有專門的node js版本
1、下載地址:http://nodejs.cn/download/
1、查看sql插件github
https://github.com/NLPchina/elasticsearch-sql
2、安裝
1、cd elasticsearch #進入目錄 2、./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.3.0/elasticsearch-sql-5.4.3.0.zip
3、下載SQL的Server
wget https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/es-sql-site-standalone.zip
4、解壓編譯安裝
unzip es-sql-site-standalone.zip cd site-server/ npm install express --save
5、修改啟動端口,然后啟動server
1、修改SQL的Server的端口 vi site_configuration.json 2、啟動服務 node node-server.js &
啟動之后我們就可以進行es的管理后台頁面了

現在我們來驗證下整個sql插件的功能,我們先使用kibana,創建一個索引數據
我們來查詢的時候,我們如何使用這個插件了
只顯示需要的字段
使用where參數