# Not able to make elasticsearch work on our website

**URL:** <https://discuss.elastic.co/t/not-able-to-make-elasticsearch-work-on-our-website/39426>\
**Category:** Elasticsearch\
**Created:** [January 18, 2016, 8:59am UTC](https://discuss.elastic.co/t/not-able-to-make-elasticsearch-work-on-our-website/39426 "2016-01-18T08:59:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Warns](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Warns](https://discuss.elastic.co/u/Warns)\
**Post date:** [January 18, 2016, 8:59am UTC](https://discuss.elastic.co/t/not-able-to-make-elasticsearch-work-on-our-website/39426/1 "2016-01-18T08:59:16Z")

</div>

We are trying to set elasticsearch on our website but we are probably missing something in the configs that is preventing it to function on the website even though when we run:

curl -XGET "[http://localhost:9200/](http://localhost:9200/)

We get the output indicating that it is working fine.

ES\_HEAP\_SIZE is also set correctly as half of our server's memory

elasticsearch.yml file is as below:

```
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please see the documentation for further information on configuration options:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html>
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
# cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
# node.name: node-1
#
# Add custom attributes to the node:
#
# node.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
# path.data: /path/to/data
#
# Path to log files:
#
# path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.mlockall: true
#
# Make sure that the `ES_HEAP_SIZE` environment variable is set to about half the memory
# available on the system and that the owner of the process is allowed to use this limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 127.0.0.1
#
# network.bind_host: localhost
# network.publish_host: localhost
#
# Set a custom port for HTTP:
#
http.port: 9200
# 
# script.disable_dynamic: true
# 
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
# 
# ----------expose elasticsearch APIs over HTTP-------------Umid------
# 
# http.cors.enabled: true
# http.cors.allow-origin: /.*/
# http.cors.allow-credentials: true
# 
# ---------------------------------- Gateway -----------------------------------
# 
# Block initial recovery after a full cluster restart until N nodes are started:
# 
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
#
# --------------------------------- Discovery ----------------------------------
#
# Elasticsearch nodes will find each other via unicast, by default.
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#
# discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
# discovery.zen.minimum_master_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
#
# ---------------------------------- Various -----------------------------------
#
# Disable starting multiple nodes on a single system:
#
# node.max_local_storage_nodes: 1
#
# Require explicit names when deleting indices:
#
# action.destructive_requires_name: t

```

What are we missing here? Something with IP mismatch? Do we need to use our website's IP? Isn't the insecure? Thanks

EDIT:

elasticsearch.php content:

```
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$config['es_server'] = '192.168.1.1:9200';
$config['index'] = 'website';
?>
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 18, 2016, 9:04am UTC](https://discuss.elastic.co/t/not-able-to-make-elasticsearch-work-on-our-website/39426/2 "2016-01-18T09:04:14Z")

</div>

Since you're not saying much about the symptoms (an error message from the web site backend would help) it's hard to guess, but

```
network.host: 127.0.0.1

```

looks suspicious. Is the backend really running on the same host as ES?

---

<div class="post-metadata">

**Author:** ![Warns](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Warns](https://discuss.elastic.co/u/Warns)\
**Post date:** [January 18, 2016, 9:09am UTC](https://discuss.elastic.co/t/not-able-to-make-elasticsearch-work-on-our-website/39426/4 "2016-01-18T09:09:58Z")

</div>

Hi, thanks for your quick reply, I wasn't sure what to post to be helpful I am willing to provide any necessary information to debug this.

On the website when inspecting console it shows: 500 (Internal Server Error)

Our server is on DigitalOcean (Ubuntu 15.10) and we have installed ES on the server. So it is not on our local actually

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 18, 2016, 9:48am UTC](https://discuss.elastic.co/t/not-able-to-make-elasticsearch-work-on-our-website/39426/5 "2016-01-18T09:48:14Z")

</div>

> On the website when inspecting console it shows: 500 (Internal Server Error)

Client-side error messages are typically not useful. Read the server log.

> Our server is on DigitalOcean (Ubuntu 15.10) and we have installed ES on the server. So it is not on our local actually

This is contradictory. Are you running ES and the web backend on the same server?

---

<div class="post-metadata">

**Author:** ![Warns](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Warns](https://discuss.elastic.co/u/Warns)\
**Post date:** [January 18, 2016, 6:04pm UTC](https://discuss.elastic.co/t/not-able-to-make-elasticsearch-work-on-our-website/39426/6 "2016-01-18T18:04:29Z")

</div>

Here are last logs in elasticsearch.log

```
[2016-01-18 06:48:59,809][INFO][node] [Donald Ritter] version[2.1.1], pid[12152], build[40e2c53/2015-12-15T13:05:55Z]
[2016-01-18 06:48:59,809][INFO][node] [Donald Ritter] initializing ...
[2016-01-18 06:48:59,957][INFO][plugins] [Donald Ritter] loaded [], sites [kopf]
[2016-01-18 06:48:59,985][INFO][env] [Donald Ritter] using [1] data paths, mounts [[/ (/dev/vda1)]], net usable_space [46.3gb], net total_space [58.9gb], spins? [possibly], types [ext4]
[2016-01-18 06:49:01,998][INFO][node] [Donald Ritter] initialized
[2016-01-18 06:49:01,999][INFO][node] [Donald Ritter] starting ...
[2016-01-18 06:49:02,076][INFO][transport] [Donald Ritter] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}
[2016-01-18 06:49:02,086][INFO][discovery] [Donald Ritter] elasticsearch/Yasdflkj1UDKJl-pV8hgw
[2016-01-18 06:49:05,128][INFO][cluster.service] [Donald Ritter] new_master {Donald Ritter}{Ybzg1oPvREeMObz-pV8hgw}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2016-01-18 06:49:05,150][INFO][http] [Donald Ritter] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
[2016-01-18 06:49:05,150][INFO][node] [Donald Ritter] started
[2016-01-18 06:49:05,320][INFO][gateway] [Donald Ritter] recovered [1] indices into cluster_state
#tail -f /var/log/elasticsearch/elasticsearch.log
[2016-01-18 06:48:59,957][INFO][plugins] [Donald Ritter] loaded [], sites [kopf]
[2016-01-18 06:48:59,985][INFO][env] [Donald Ritter] using [1] data paths, mounts [[/ (/dev/vda1)]], net usable_space [46.3gb], net total_space [58.9gb], spins? [possibly], types [ext4]
[2016-01-18 06:49:01,998][INFO][node] [Donald Ritter] initialized
[2016-01-18 06:49:01,999][INFO][node] [Donald Ritter] starting ...
[2016-01-18 06:49:02,076][INFO][transport] [Donald Ritter] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}
[2016-01-18 06:49:02,086][INFO][discovery] [Donald Ritter] elasticsearch/Ybzg1oPvREeMObz-pV8hgw
[2016-01-18 06:49:05,128][INFO][cluster.service] [Donald Ritter] new_master {Donald Ritter}{Ybzg1oPvREeMObz-pV8hgw}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)
[2016-01-18 06:49:05,150][INFO][http] [Donald Ritter] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
[2016-01-18 06:49:05,150][INFO][node] [Donald Ritter] started
[2016-01-18 06:49:05,320][INFO][gateway] [Donald Ritter] recovered [1] indices into cluster_state

```

> This is contradictory. Are you running ES and the web backend on the same server?

I'm not sure if I understood what you exactly mean. But our website is on DigitalOcean and we use PHP and Codeigniter to create json files of the content on the website for ES to read when doing a search.

---

<div class="post-metadata">

**Author:** ![Warns](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Warns](https://discuss.elastic.co/u/Warns)\
**Post date:** [January 19, 2016, 3:07pm UTC](https://discuss.elastic.co/t/not-able-to-make-elasticsearch-work-on-our-website/39426/7 "2016-01-19T15:07:08Z")

</div>

Any help please?

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [January 20, 2016, 12:57am UTC](https://discuss.elastic.co/t/not-able-to-make-elasticsearch-work-on-our-website/39426/8 "2016-01-20T00:57:25Z")

</div>

It appears elasticsearch is working, but your client cannot connect to it.  
As Magnus already commented, your network.host setting might be incorrect.  
Can you connect via curl?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:23pm UTC](https://discuss.elastic.co/t/not-able-to-make-elasticsearch-work-on-our-website/39426/9 "2017-07-05T23:23:13Z")

</div>


