es-sql(5.4.0)安装过程(步履艰辛)
1、下载插件包
1、第一步
首先吐槽一下es-sql github,没看懂那个过程,下面进入正题,下载插件
./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.0.0/elasticsearch-sql-5.4.0.0.zip
2、第二步
github标注5.0之上需要下载下面这个玩意,老老实实下载
wget https://github.com/NLPchina/elasticsearch-sql/releases/download/5.4.1.0/es-sql-site-standalone.zip
2、解压操作
1、解压上面第二步安装的
unzip es-sql-site-standalone.zip
2、进行目标文件夹
cd es-sql-site
cd site-server
3、下一步操作
npm install express --save
4、这里成功
node node-server.js
如果上面3有问题,linux没有装npm ,请进行以下操作,一行一行来
curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
yum install -y nodejs
npm install -g cnpm --registry=https://registry.npm.taobao.org
npm install
npm run buildnpm -v
最终出现这个就可再返回上面进行第3步
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-WmEb6sFc-1627728886662)(../AppData/Roaming/Typora/typora-user-images/image-20210731184456204.png)]](https://img-blog.csdnimg.cn/60d8756acbb44aa38d4581ff38961d9e.png)
3、访问
默认的es-sql端口号是8080,如有冲突需要修改,下面操作
cd es-sql-site/site-server
vim site_configuration.json
出现如图表示没问题![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jZn9L0zr-1627728886663)(../AppData/Roaming/Typora/typora-user-images/image-20210731184844783.png)]](https://img-blog.csdnimg.cn/d7d8f6f73f214fb9a9a73daa157e32d3.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3hpYW95b3VwZWk=,size_16,color_FFFFFF,t_70)
4、最后一步
有的小伙伴可能会在上图出错,报错:Error:Error occured! response is not avalible. ,那是需要修改elasticsearch配置文件,添加下面代码
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
5、重启es
重新启动es,打开es-sql web页面,就可以写sql啦,默认的库相当于索引
|