I tried to use elasticsearch, but have an issue
Invalid NEST response built from a unsuccessful low level call on PUT: /mytweetindex/tweet/1
Audit trail of this API call:
[1] BadRequest: Node: http://127.0.0.1:9200/ Took: 00:00:01.0227803
OriginalException: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 192.168.100.34:9200
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at Elasticsearch.Net.HttpConnection.Request[TReturn](RequestData requestData) in C:\Projects\elastic\net-5\src\Elasticsearch.Net\Connection\HttpConnection.cs:line 149
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:
<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
this is code
private static ElasticClient client;
public void StartClient()
{
var node = new Uri("http://192.168.100.34:9200");
var settings = new ConnectionSettings(node);
client = new ElasticClient(settings);
var tweet = new Tweet
{
Id = 1,
User = "kimchy",
PostDate = new DateTime(2009, 11, 15),
Message = "Trying out NEST, so far so good?"
};
var response = client.Index(tweet, idx => idx.Index("mytweetindex"));
}
}`
I disable fairwall and windows defender
Also I tried open app as administrator
Yes, exactly, I forgot about run elasticsearch instance
So, right now I trying to start it, but it a bit difficult. I tried to start but file, but it closed in a moment.
Maybe you can help me with run elasticsearch bat file?
I got the similar error , eventhough the elastic search is running well in our product box. please help.
"Invalid NEST response built from a unsuccessful low level call on GET: /apifrecord360%2A/_settings\r\n# Audit trail of this API call:\r\n - [1] BadResponse: Node: http://XXXXXXX.cloudapp.azure.com:9200/ Took: 00:00:21.4285309\r\n# OriginalException: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xx.xxx.xx.xx:8080\r\n at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)\r\n at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)\r\n --- End of inner exception stack trace ---\r\n at System.Net.HttpWebRequest.GetResponse()\r\n at Elasticsearch.Net.HttpConnection.Request[TReturn](RequestData requestData) in C:\Projects\elastic\net-5\src\Elasticsearch.Net\Connection\HttpConnection.cs:line 164\r\n# Request:\r\n<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>\r\n# Response:\r\n<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>\r\n"
the following is my connectsettings:
node = new Uri((Properties.Settings.Default.URI));
var settings = new ConnectionSettings(node).RequestTimeout(TimeSpan.FromMinutes(2));
client = new ElasticClient(settings);
So you've switched to pointing it towards your remote Elastic rather than local?
Is it possible there are some firewall rules you aren't accounting for? This seems like it could be a networking issue moreso than a problem with Elasticsearch configuration.
I would see if you can resolve the issue by making sure your network rules are configured properly and just hitting the node with a GET on the root via some API testing tool like postman. Make sure you include whatever auth you need in the request.
GET HTTP/1.1
Host: {{ElasticUrl}}
Content-Type: application/json
Cache-Control: no-cache
Where {{ElasticUrl}} is pointing to your environment. Add basic auth if you've configured it in such a way.
Once you see a response similar to this, go back to configuring your NEST client:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.