user2816352
user2816352

Reputation: 335

AngularjS Connection Timeout to ElasticSearch

I have 2 servers setup, "client" with an angularjs working app, and "server" with elasticsearch running with proper indexing. I can curl from client to server and return the expected data, however my angular app cannot. I have iptables turned off, so i'm not sure why its not working. My angular connection code:

  .service('esClient', function (esFactory) {
    esClient = esFactory({
      host: 'server.develop.com:9200',
      apiVersion: '1.4',
      log: 'trace'
    });
    return esClient;
  })

The error i see:

Failed to load resource: net::ERR_CONNECTION_TIMED_OUT
elasticsearch.angular.js:34871 ERROR: 2015-02-08T19:55:39Z
  Error: Request error, retrying -- Connection Failure

Upvotes: 0

Views: 587

Answers (1)

Zouzias
Zouzias

Reputation: 2360

I think you are missing the HTTP protocol prefix. Do

host : 'http://server.develop.com:9200'

Hope this helps.

Upvotes: 1

Related Questions