"error": "Bad Gateway"

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


# 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"


  "statusCode": 502,
  "error": "Bad Gateway",
  "message": "connect ECONNREFUSED"

Why? Any idea?

Thank you.

What gives:



Anything in elasticsearch logs?

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"

Anything in elasticsearch logs?

Can you share your elasticsearch logs please?

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

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