redash添加elasticsearch数据源

使用redash提供的Ubuntu script 在Ubuntu部署redash,下一步添加DataSource
BASE_URL 这是个什么东西???
google了好久都是only ip&port
可我怎么试connection refused
无奈采取看源代码

def test_connection(self):
    try:
        r = requests.get("{0}/_cluster/health".format(self.server_url), auth=self.auth)
        r.raise_for_status()
    except requests.HTTPError as e:
        logger.exception(e)
        raise Exception("Failed to execute query. Return Code: {0}   Reason: {1}".format(r.status_code, r.text))
    except requests.exceptions.RequestException as e:
        logger.exception(e)
        raise Exception("Connection refused")

还要对requests有一点了解,requests的入参形式是http://ip:port
修改base_url 连接成功!

你可能感兴趣的:(redash,elasticsearch,redash)