elasticsearch Elasticsearch 7 SQL CLI:./x-pack-env:没有此类文件或目录错误,elasticsearch,elasticsearch-7,elasticsearch-sql,elasticsearch,Elasticsearch 7,Elasticsearch Sql" /> elasticsearch Elasticsearch 7 SQL CLI:./x-pack-env:没有此类文件或目录错误,elasticsearch,elasticsearch-7,elasticsearch-sql,elasticsearch,Elasticsearch 7,Elasticsearch Sql" />

elasticsearch Elasticsearch 7 SQL CLI:./x-pack-env:没有此类文件或目录错误

elasticsearch Elasticsearch 7 SQL CLI:./x-pack-env:没有此类文件或目录错误,elasticsearch,elasticsearch-7,elasticsearch-sql,elasticsearch,Elasticsearch 7,Elasticsearch Sql,我已开始使用Elasticsearch 7,并尝试使用以下命令启动Elasticsearch sql cli: ~/Documents/backups/es7/bin$ ./elasticsearch-sql-cli 但它未启动,并出现以下错误: ./elasticsearch-sql-cli: line 9: ./x-pack-env: No such file or directory 我打开了./x-pack-env文件,发现它使用的是ES_HOME环境变量。以下是x-pack-env

我已开始使用Elasticsearch 7,并尝试使用以下命令启动Elasticsearch sql cli:

~/Documents/backups/es7/bin$ ./elasticsearch-sql-cli
但它未启动,并出现以下错误:

./elasticsearch-sql-cli: line 9: ./x-pack-env: No such file or directory
我打开了./x-pack-env文件,发现它使用的是ES_HOME环境变量。以下是x-pack-env文件的内容:

#!/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.

# include x-pack-core jars in classpath
ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/modules/x-pack-core/*"
所以我在bash_profile中添加了环境变量

#ES
export ES_HOME=/Users/Documents/backups/es7
export PATH=$ES_HOME/bin:$PATH
但我还是得到了同样的错误

./elasticsearch sql cli:第9行:./x-pack-env:没有这样的文件或目录


请建议如何解决此问题。

在7.4.2中有相同的问题,并设法解决。该x-pack-env文件位于/usr/share/elasticsearch/bin/(至少在Linux中是这样)。我在编辑器中打开了elasticsearch sql cli文件,注释掉了原始行并替换了它:

#source "`dirname "$0"`"/x-pack-env
source /usr/share/elasticsearch/bin/x-pack-env
另外,仅供参考,它希望看到Elasticsearch在本地主机上运行,否则将失败。我在虚拟机上运行我的,并使用IP。要启动它,请运行类似这样的操作,但将URI更改为运行Elasticsearch的内容。命令假定您在/usr/share/elasticsearch/bin中

./elasticsearch-sql-cli uri=http://10.10.12.22:9200/
想象一下,如果更改路径格式和路径但不确定,这将在Windows上起作用