切换到elasticsearch的home目录执行:
bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/7.0.0.0/elasticsearch-sql-7.0.0.0.zip
修改config/elasticsearch.yml:添加一行
xpack.sql.enabled: false
elasticsearch7.x不支持xpack和sql同时使用,所以禁用。
下载es-sql-site-standalone.zip(ES的home目录下)
5.0以上版本还需要下载:
wget https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/es-sql-site-standalone.zip
这个es-sql-site-standalone.zip没有版本之分,统一下载这个。
unzip es-sql-site-standalone.zip
cd es-sql-site-standalone/site-server
npm install express --save
node node-server.js
默认端口是8080,需要修改的话可以改site-server/site_configuration.json
文件。
如果是生产环境,可能无法通过npm安装依赖,这里提供一个我安装完后打包的版本: