我是新手,使用 AWS(Amazon Web Services)控制台配置域以使用 ElasticSearch。 配置 Http 请求的使用。 从https://www.elastic.co/guide/en/elasticsearch/client/net-api/1.x/security.html阅读创建 ElasticSearch 客户端的文档。
var response = client.RootNodeInfo(c => c
.RequestConfiguration(rc => rc
.BasicAuthentication("UserName", "Password")
));
对我来说很好用(响应是200)。 但当我尝试像这样配置认证凭据并将配置传递给客户端构造函数时,我需要拥有“cloudId”,在AWS上没有找到它在哪里可以搜索?或者我该怎么做?
我的客户端代码:
BasicAuthenticationCredentials credentials = new BasicAuthenticationCredentials("UserName", "Password");
var config = new ConnectionSettings("cloudId???", credentials);
var client = new ElasticClient(config);
var response = client.Ping();