Web search results: [1] "Another way is to simply run elasticsearch as ./elasticsearch…
- User
Web search results:
[1] "Another way is to simply run elasticsearch as ./elasticsearch -E xpack.security.enabled=false It basically runs it with SSL disabled, allowing you to create HTTP connections with it. Share Follow answered Jan 23 at 21:49 bappak 717 6 21 Add a comment 0" URL: https://stackoverflow.com/questions/71492404/elasticsearch-showing-received-plaintext-http-traffic-on-an-https-channel-in-con
[2] "Hi, Im trying to specify xpack.security.enabled as an environment variable for the Elasticsearch container in the docker-compose configuration of T-Pot, a honeypot framework. However, the following statement does not work. (This setting is reflected as an environment variable in the container. See the reproduction procedure.)" URL: https://discuss.elastic.co/t/environment-xpack-security-enabled-true-does-not-work-with-docker-compose/290389
[3] "Defaults to the value of # the elasticsearch.requestTimeout setting. #elasticsearch.pingTimeout: 1500 # Time in milliseconds to wait for responses from the back end or Elasticsearch. This value # must be a positive integer. #elasticsearch.requestTimeout: 30000 # List of Kibana client-side headers to send to Elasticsearch." URL: https://stackoverflow.com/questions/66946925/kibana-server-is-not-ready-yet-security-exception-unable-to-authenticate-use Current date: 2023/3/13
Instructions: Using the provided web search results, write a comprehensive reply to the given query. Make sure to cite results using [number] notation after the reference. If the provided search results refer to multiple subjects with the same name, write separate answers for each subject. Query: 有關Elasticsearch的問題: 我在docker-compose檔中有設置 xpack.security.http.ssl.enabled: "false" 但是在瀏覽器中輸入http://localhost:9200/ 沒辦法返回資料,必須輸入https 想請問是什麼原因?Copy to Clipboard
- Assistant
根據提供的網絡搜索結果,您似乎在使用Docker Compose檔案設置Elasticsearch時遇到了問題,當您在瀏覽器中輸入"http://localhost:9200/"時,沒有返回任何數據,且必須輸入"https"。 根據結果[1],您可以使用以下命令運行Elasticsearch以禁用SSL:
./elasticsearch -E xpack.security.enabled=false這將禁用SSL,使您可以通過HTTP與其建立連接,以解決您遇到的問題。如果您需要在Docker Compose文件中設置xpack.security.enabled為環境變量,請參考[2]以進行更多調整。
此外,如果您在Kibana中設置了Elasticsearch作為後端,並且遇到類似“Kibana server is not ready yet”或“Unable to authenticate user”等錯誤,請參考[3],了解有關Kibana客戶端與Elasticsearch之間通信的其他參數設置。
- User
請提供更多細節說明
- Assistant
當您在Docker Compose文件中設置
xpack.security.http.ssl.enabled: "false"以禁用SSL時,您可能需要進一步確認以下事項:- Elasticsearch是否已經重新啟動並重新加載了配置文件。如果沒有,請確保重新啟動Elasticsearch並重新加載配置文件以使更改生效。
- 如果您使用的是自簽名證書,則瀏覽器可能會將其標記為不安全的連接。在這種情況下,您可以選擇繼續訪問網站,或者將證書添加到受信任的根證書授權機構中。
- 確保您正在使用正確的端口號。默認情況下,Elasticsearch HTTP使用9200端口,而HTTPS使用9243端口。如果您的配置文件中已禁用了SSL,請確保您正在使用9200端口。
如果您已經確認了以上問題,並且仍然無法通過HTTP訪問Elasticsearch,您可以查看Elasticsearch的日誌文件以查看任何錯誤或異常信息。您可以使用以下命令來檢查Elasticsearch的日誌文件:
phpdocker logs <elasticsearch_container_name> | less請將
<elasticsearch_container_name>替換為您的Elasticsearch容器的名稱。在日誌文件中,您可以查看任何錯誤或異常信息,並根據需要進行調整。 - User
如何執行 請確保重新啟動Elasticsearch並重新加載配置文件以使更改生效 請說明
- Assistant
要重新啟動Elasticsearch並重新加載配置文件,您需要執行以下步驟:
- 確保您的Elasticsearch容器正在運行。您可以使用以下命令檢查容器的狀態:
codedocker ps如果您的Elasticsearch容器已經停止,您需要使用以下命令啟動它:
phpdocker start <elasticsearch_container_name>請將
<elasticsearch_container_name>替換為您的Elasticsearch容器的名稱。- 停止Elasticsearch容器。您可以使用以下命令停止容器:
phpdocker stop <elasticsearch_container_name>請將
<elasticsearch_container_name>替換為您的Elasticsearch容器的名稱。- 在停止容器後,您需要重新加載配置文件。您可以使用以下命令進入容器內部:
pythondocker exec -it <elasticsearch_container_name> /bin/bash請將
<elasticsearch_container_name>替換為您的Elasticsearch容器的名稱。- 在容器內部,您可以使用以下命令重新加載配置文件:
pythonbin/elasticsearch-setup-passwords auto這個命令將會提示您輸入一個初始的超級用戶密碼,該密碼用於設置Elasticsearch內置的安全性功能。
- 重新啟動Elasticsearch容器。您可以使用以下命令重新啟動容器:
phpdocker start <elasticsearch_container_name>