<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<title>ERROR: The requested URL could not be retrieved</title>
<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
</head><body>
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
<hr>
<p>The following error was encountered while trying to retrieve the URL: <a href="http://localhost:9200/_cluster/health?">http://localhost:9200/_cluster/health?</a></p>
<blockquote>
<p><b>Connection to 127.0.0.1 failed.</b></p>
</blockquote>
<p>The system returned: <i>(111) Connection refused</i></p>
<p>The remote host or network may be down. Please try the request again.</p>
<p>Your cache administrator is <a href="mailto:root?subject=CacheErrorInfo%20-%20ERR_CONNECT_FAIL&body=CacheHost%3A%20squid2%0D%0AErrPage%3A%20ERR_CONNECT_FAIL%0D%0AErr%3A%20(111)%20Connection%20refused%0D%0ATimeStamp%3A%20Mon,%2017%20Dec%202018%2008%3A07%3A36%20GMT%0D%0A%0D%0AClientIP%3A%20192.168.13.14%0D%0AServerIP%3A%20127.0.0.1%0D%0A%0D%0AHTTP%20Request%3A%0D%0AGET%20%2F_cluster%2Fhealth%3Fpretty%20HTTP%2F1.1%0AUser-Agent%3A%20curl%2F7.29.0%0D%0AHost%3A%20localhost%3A9200%0D%0AAccept%3A%20*%2F*%0D%0AProxy-Connection%3A%20Keep-Alive%0D%0A%0D%0A%0D%0A">root</a>.</p>
<br>
<hr>
<div id="footer">Generated Mon, 17 Dec 2018 08:07:36 GMT by squid2 (squid/3.0.STABLE25)</div>
</body></html>
# curl -XGET localhost:9200/_cat/indices
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<title>ERROR: The requested URL could not be retrieved</title>
<style type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></style>
</head><body>
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
<hr>
<p>The following error was encountered while trying to retrieve the URL: <a href="http://localhost:9200/_cat/indices">http://localhost:9200/_cat/indices</a></p>
<blockquote>
<p><b>Connection to 127.0.0.1 failed.</b></p>
</blockquote>
<p>The system returned: <i>(111) Connection refused</i></p>
<p>The remote host or network may be down. Please try the request again.</p>
<p>Your cache administrator is <a href="mailto:root?subject=CacheErrorInfo%20-%20ERR_CONNECT_FAIL&body=CacheHost%3A%20squid2%0D%0AErrPage%3A%20ERR_CONNECT_FAIL%0D%0AErr%3A%20(111)%20Connection%20refused%0D%0ATimeStamp%3A%20Mon,%2017%20Dec%202018%2008%3A10%3A09%20GMT%0D%0A%0D%0AClientIP%3A%20192.168.13.14%0D%0AServerIP%3A%20127.0.0.1%0D%0A%0D%0AHTTP%20Request%3A%0D%0AGET%20%2F_cat%2Findices%20HTTP%2F1.1%0AUser-Agent%3A%20curl%2F7.29.0%0D%0AHost%3A%20localhost%3A9200%0D%0AAccept%3A%20*%2F*%0D%0AProxy-Connection%3A%20Keep-Alive%0D%0A%0D%0A%0D%0A">root</a>.</p>
<br>
<hr>
<div id="footer">Generated Mon, 17 Dec 2018 08:10:09 GMT by squid2 (squid/3.0.STABLE25)</div>
</body></html>
6条答案
按热度按时间toe950271#
要检查elasticsearch集群的健康状况,您需要使用
关于cat API here的更多信息。
我通常使用elasticsearch-head插件来可视化它。
你可以找到它的github项目here。
安装
sudo $ES_HOME/bin/plugin -i mobz/elasticsearch-head
很容易,然后你可以在浏览器中打开localhost:9200/_plugin/head/
。你应该有这样的东西:
eiee3dmh2#
您可以使用elasticsearch提供的(CURL)和Cluster API来检查elasticsearch集群健康:
这将为您提供所需的状态和其他相关数据。
uubf1zoe3#
_cluster/health
API可以做的远不止大多数人看到的典型输出:Elasticsearch中的大多数API都可以接受各种参数来增加输出。这也适用于Cluster Health API。
示例
API也有各种
wait_*
选项,它将在立即返回之前或在某些指定的timeout
之后等待各种状态更改。mw3dktmi4#
如果Elasticsearch集群不可访问(例如防火墙后),但Kibana是:
Kibana => DevTools =>控制台:
oalqel3c5#
如果您启用了身份验证和ssl/tls,请在运行Elasticsearch的节点上使用以下命令:
其中
elastic
是用户名,12345678
是密码(在您的情况下会有所不同),https://localhost:9200
是主机名,由于ssl/tls的原因,https
协议和--insecure
用于访问它而不使用ssl/tls,所以您不必提及SSL证书。c8ib6hqw6#
问题:-
有时,Localhost可能无法解决。所以它倾向于返回如下所示的输出:
# curl -XGET localhost:9200/_cluster/health?漂亮的
# curl -XGET localhost:9200/_cat/indices
解决方案:-
我猜,这个错误很可能是由部署在服务器上的Local Squid返回的。
因此,在将localhost替换为部署了ElasticSearch的local_ip后,它工作得很好。