我已经开始使用 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:没有这样的文件或目录
请建议如何解决这个问题。