网站首页 > 开源技术 正文
今天在云服务器上,通过下载源码包完成有认证配置的Elasticsearch部署后,准备执行如下命令进入Elasticsearch SQL进行一些SQL语句的操作:
bin/elasticsearch-sql-cli uri=http://elastic:ESabc+2333@10.66.66.2:9200/
但执行后,发现使用bin/elasticsearch-sql-cli登录时,出错提示./x-pack-env: No such file or directory,莫名其妙,随即查看下该脚本,内容如下:
#!/bin/bash
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License;
# you may not use this file except in compliance with the Elastic License.
source "`dirname "$0"`"/elasticsearch-env
source "`dirname "$0"`"/x-pack-env
CLI_JAR=$(ls $ES_HOME/bin/elasticsearch-sql-cli-*.jar)
exec \
"$JAVA" \
-jar "$CLI_JAR" \
"$@"
其中有效行第二行的source "`dirname "$0"`"/x-pack-env看来执行起来有问题,估计是在依赖导入生效时找不到路径。经过一番折腾,解决了该问题,即将该行替换为如下命令:
# source "`dirname "$0"`"/x-pack-env
source /usr/share/elasticsearch/bin/x-pack-env
即将引入依赖的路径写死即可,使用时请根据实际路径修改x-pack-env的指向路径。
修改完后,再用刚才的命令启动Elasticsearch SQL,正常进入,完美结局。
后来又仔细查找了下资料,发现该问题是Elasticsearch 7.4版本的一个小bug,在Elasticsearch 7.8的包内,bin/elasticsearch-sql-cli这个脚本内容已经修改为:
#!/bin/bash
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License;
# you may not use this file except in compliance with the Elastic License.
source "`dirname "$0"`"/elasticsearch-env
source "$ES_HOME"/bin/x-pack-env
CLI_JAR=$(ls "$ES_HOME"/bin/elasticsearch-sql-cli-*.jar)
exec \
"$JAVA" \
"$XSHARE" \
-jar "$CLI_JAR" \
"$@"
也就是说,如果Elasticsearch 7.8安装时,操作系统环境变量内$ES_HOME能够正确设置的话,就可以正常启动Elasticsearch SQL了。这样比直接修改产品本身脚本来说要规范的多了。
猜你喜欢
- 2024-11-14 「实战」 elasticsearch 写入速度提升的案例分享
- 2024-11-14 ElasticSearch & Kibana版本选择与安装
- 2024-11-14 elasticsearch 集群内部安全通信,避免数据泄露
- 2024-11-14 腾云忆想架构师分析Elasticsearch集群异常状态原因
- 2024-11-14 ElasticSearch从入门到精通:基础知识
- 2024-11-14 Elasticsearch 7.x 之节点、集群、分片及副本
- 2024-11-14 查询ElasticSearch:用SQL代替DSL(es sql查询)
- 2024-11-14 ELKStack的安全性如何保障?(elk stack权威指南)
- 2024-11-14 ELK Stack系列之基础篇(六) - ES6常用插件的推荐安装
- 2024-11-14 elastic_search 入门使用(elasticsearch搜索流程)
你 发表评论:
欢迎- 最近发表
-
- 10款鲜为人知的PHP框架(10款鲜为人知的php框架代码)
- 3分钟搞懂反弹shell(反弹shell的常用命令)
- 计算机专业必须掌握的脚本开发语言—shell
- shell 基本语法(shell基本语法set)
- 学习Shell 教程(shell编程学习)
- 一个有意思的PHP Webshell,利用伪协议执行代码
- Linux入门-shell编程-适合小白(linux shell编程是什么)
- GrayLog开源日志管理平台技术文章合集【共58篇】
- AI大模型 MiniMax 基于 Apache Doris 的日志系统,PB 级秒级查询响应
- 互联网大厂后端必看!手把手教你替换 Spring Boot 中的日志框架
- 标签列表
-
- jdk (81)
- putty (66)
- rufus (78)
- 内网穿透 (89)
- okhttp (70)
- powertoys (74)
- windowsterminal (81)
- netcat (65)
- ghostscript (65)
- veracrypt (65)
- asp.netcore (70)
- wrk (67)
- aspose.words (80)
- itk (80)
- ajaxfileupload.js (66)
- sqlhelper (67)
- express.js (67)
- phpmailer (67)
- xjar (70)
- redisclient (78)
- wakeonlan (66)
- tinygo (85)
- startbbs (72)
- webftp (82)
- vsvim (79)
本文暂时没有评论,来添加一个吧(●'◡'●)