getredash / redash

Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data.
http://redash.io/
BSD 2-Clause "Simplified" License
26.5k stars 4.39k forks source link

unable to connect to Elasticsearch #7044

Open hellojph opened 5 months ago

hellojph commented 5 months ago

Issue Summary

When using the redash/redash:preview image, it is unable to connect to Elasticsearch. When testing the connection, it returns: "Connection Test Failed: 'server'"; 20240703-180907

HomiGrotas commented 6 days ago

Hi, Please make sure your creds are correct and the server is up and running:

from elasticsearch import Elasticsearch

# Password for the 'elastic' user generated by Elasticsearch
ELASTIC_PASSWORD = "<password>"

# Create the client instance
client = Elasticsearch(
    "https://localhost:9200",
    ca_certs="/path/to/http_ca.crt",
    basic_auth=("elastic", ELASTIC_PASSWORD)
)

# Successful response!
client.info()
# {'name': 'instance-0000000000', 'cluster_name': ...}