"error": "Bad Gateway"


(Jason) #1

Hello.
I have a problem about backup and restore logs. My Elasticsearch config is as below:

# ----------------------------------- Paths ------------------------------------
# 
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
path.repo: ["/var/log/back-long/repo"]
#
# Path to log files:
#
path.logs: /var/log/elastic
#

and

# ls -l
drwxr-xr-x. 3 elastic       elastic           17 Oct  2 12:30 back-long

When I write below code in "Dev Tools":

PUT /_snapshot/my_backup
{
  "type": "fs",
  "settings": {
        "compress": true,
		"location": "/var/log/back-long/repo"
  }
}

Then:

{
  "statusCode": 502,
  "error": "Bad Gateway",
  "message": "connect ECONNREFUSED 127.0.0.1:9200"
}

Why? Any idea?

Thank you.


(David Pilato) #2

What gives:

GET /

?

Anything in elasticsearch logs?


(Jason) #3

the result is:

{
  "name": "Cbg6tCU",
  "cluster_name": "elasticsearch",
  "cluster_uuid": "gQk4b-FSQ2-W-dmqcRaaOA",
  "version": {
    "number": "5.4.1",
    "build_hash": "2cfe0df",
    "build_date": "2017-05-29T16:05:51.443Z",
    "build_snapshot": false,
    "lucene_version": "6.5.1"
  },
  "tagline": "You Know, for Search"
}

(David Pilato) #4

Anything in elasticsearch logs?

Can you share your elasticsearch logs please?


(Jason) #5

Problem solved.
It is because of a directory permission "/var/log/elastic". I changed the owner of this directory to "elastic" and problem solved.


(system) #6

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.