ubuntu - 如何检查 Elasticsearch 是否正在使用 CURL 运行?

标签 ubuntu elasticsearch curl kibana

我已经下载了最新的ElasticSearch & Kibana 到我的本地机器(Ubuntu 20)。
提取后执行bin/elasticsearch & bin/kibana .
执行成功,我可以在浏览器中打开运行良好的kibana http://localhost:5601/但在 CLI 中,使用 CURL 命令无法到达 curl -XGET http://localhost:9200/`
document我已关注
写了一个命令来检查elasticsearch是否启动并运行。

curl --cacert $ES_PATH_CONF/tls_auto_config_<timestamp>/http_ca.crt -u elastic https://localhost:9200
但是我不明白 $ES_PATH_CONF/tls_auto_config_<timestamp> 是什么.
有人可以帮我吗?

最佳答案

我假设您已按照以下步骤在 Linux 上安装根据文档。

curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.0.1-linux-x86_64.tar.gz
tar -xzvf elasticsearch-8.0.1-linux-x86_64.tar.gz
cd elasticsearch-8.0.1
./bin/elasticsearch
根据这一步你必须在elasticsearch-8.0.1 ./elasticsearch-8.0.1 - ES_HOME 文件夹。/elasticsearch-8.0.1/config - ES_PATH_CONF 文件夹。/elasticsearch-8.0.1/config/certs/http_ca.crt - HTTP CA 证书。
首次启动 Elasticsearch 时,会为 elastic 生成密码。用户和 TLS 会自动为您配置。
在另一个终端窗口或选项卡中打开相同的路径。
所以你需要通过http_ca.crt curl 的路径命令如下。
curl --cacert config/certs/http_ca.crt -u "elastic:password" https://localhost:9200
您也可以设置环境变量。
export ES_HOME=/path-to-ES_HOME/elasticsearch-8.0.1
export ES_PATH_CONF=/path-to-ES_HOME/elasticsearch-8.0.1/config
您可以直接在 curl 中使用环境变量
curl --cacert $ES_PATH_CONF/certs/http_ca.crt -u "elastic:password" https://localhost:9200
password安装 Elasticsearch 时必须显示。如果您没有注意,您可以使用以下命令进行更改:
bin/elasticsearch-reset-password -u elastic
你可以在这里引用更多https://www.elastic.co/guide/en/elasticsearch/reference/current/targz.html#_check_that_elasticsearch_is_running

关于ubuntu - 如何检查 Elasticsearch 是否正在使用 CURL 运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71585935/

相关文章:

web-applications - 是否将新的 .war 文件上传到 webapps 目录以强制重启 tomcat?

ubuntu - 从 Wacom 数位板仅读取数据

elasticsearch - Elasticsearch中的模式分词器在空白和特殊字符上进行拆分

php - 仅使用 curl 和 php 获取 http 状态代码

php - 使用 Shopify API 获取所有产品(超过 50,000)

c++ - 项目错误 : Unknown module(s) in QT: script?

ubuntu - 如何在 CMake 中设置 STL 实现?

elasticsearch - Dokku:如何在插件中更改Elasticsearch的版本

elasticsearch - Elasticsearch汇总存储桶结果

http - 在Logstash中按时间戳查询项目