I think connecting part is poorly documented (or I could not find it - google takes me to broken elastic search documentation, which is readable only when using google cached version) and from some of the evidence I’m afraid we’re using it wrong in current project.
Currently we’re doing it like this:
var connectionPool = new SingleNodeConnectionPool(new Uri(url));
var connectionSettings = new ConnectionSettings(connectionPool)
.BasicAuthentication(username, password)
.DefaultIndex(null)
.EnableHttpCompression()
.MaximumRetries(3)
.ThrowExceptions()
.UserAgent("my-app");
var client = new ElasticClient(connectionSettings);
and the mysterious part is connection pool creation.
From AWS documentation, I understood, that in front of their OpenSearch cluster there’s load balancer, which basically hides nodes behind him, meaning that I have single address that I use when configuring client. And that would be great, if I would not see sometimes following in logs:
Node {
DeadUntil: 2022-09-05T16:20:15.6225674Z
FailedAttempts: 5
IsAlive:false
Uri: https://vpc-my-open-search-domain.us-east-2.es.amazonaws.com/
...
}
So, node is marked as Dead and Uri is from load balancer. Interestingly enough, documentation in elastic search cached docs version says: “Single node connection pool doesn’t opt in to sniffing or pinging behavior and will never mark nodes dead or alive.”
So may be it marks node as DeadUntil, but actually ignores this property and I can sleep well during the night?
¯_(ツ)_/¯
Or may be I need somewhat differently connect to AWS OpenSearch instance?
On the side node I could not figure out how to create tag for opensearch-net, I did not found such in given list.