Я новичок в упругом поиске.я создал пример проекта для индексации данных в эластичное облако.в моем локальном компьютере мой упругий поиск API работает нормально, но во время хостинга выдает ошибку «Была сделана попытка доступа к сокету способом, запрещенным его правами доступа».
как устранить эту ошибку?
Мой пример кода в c #
var uri = new Uri("https://elastic:passowrd@cloud url");
var settings = new ConnectionSettings(uri).DisableDirectStreaming();
var client = new ElasticClient(settings);
var response1 = client.ClusterHealth();
_logger.Error("debug info");
if (response1.DebugInformation != null)
_logger.Error(response1.DebugInformation );
Полный вывод сообщения об ошибке, как показано ниже: -
Invalid NEST response built from a unsuccessful low level call on GET: /_cluster/health
# Audit trail of this API call:
- [1] BadRequest: Node: https://elastic:pt8wcFiAaGdjrz1sJKSI5FfW@4b9793e5c28e4c42ba30026f534b8593.europe-west1.gcp.cloud.es.io:9243/ Took: 00:00:00.0553689
# OriginalException: System.Net.Http.HttpRequestException: An attempt was made to access a socket in a way forbidden by its access permissions ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask`1 creationTask)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Elasticsearch.Net.HttpConnection.Request[TResponse](RequestData requestData)
# Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
# Response: