错误:“对HEAD上的不成功低级别调用构建的无效NEST响应:步骤2中的审计异常PingFailure:\ r \ nElasticsearch.Net.PipelineException:尝试与指定节点建立连接时发生错误。\ r \ n \ n“
private static ElasticClient GetESClient(Uri[] nodes, string username, string password)
{
var connectionPool = new SniffingConnectionPool(nodes);
var setting = new ConnectionSettings(connectionPool)
.SniffOnConnectionFault(false)
.SniffOnStartup(false)
.SniffLifeSpan(TimeSpan.FromMinutes(1)).DisableDirectStreaming()
.BasicAuthentication(username, password)
.MaximumRetries(5);
setting.DefaultIndex(ConfigurationManager.AppSettings["ElasticSearch_val"].ToString());
var esClient = new ElasticClient(setting);
return esClient;
}