Fix log directory of Elasticsearch

Logs should be stored in /var/log/kolla/elasticsearch.

Change-Id: If3ba4ec6ce2dbe9859ca604f0ee2df7fc4d15bd9
Closes-bug: #1634046
This commit is contained in:
Christian Berendt 2016-10-17 10:46:02 +02:00
parent fbdcf34db7
commit 4223fdfbeb
3 changed files with 13 additions and 1 deletions

View File

@ -13,6 +13,11 @@
"path": "/var/lib/elasticsearch",
"owner": "elasticsearch:elasticsearch",
"recurse": true
},
{
"path": "/var/log/kolla/elasticsearch",
"owner": "elasticsearch:elasticsearch",
"recurse": true
}
]
}

View File

@ -15,5 +15,5 @@ gateway.recover_after_time: "5m"
gateway.recover_after_nodes: {{ recover_after_nodes }}
path.conf: "/etc/elasticsearch"
path.data: "/var/lib/elasticsearch/data"
path.logs: "/var/log/elasticsearch"
path.logs: "/var/log/kolla/elasticsearch"
path.scripts: "/etc/elasticsearch/scripts"

View File

@ -1,5 +1,12 @@
#!/bin/bash
if [[ ! -d "/var/log/kolla/elasticsearch" ]]; then
mkdir -p /var/log/kolla/elasticsearch
fi
if [[ $(stat -c %a /var/log/kolla/elasticsearch) != "755" ]]; then
chmod 755 /var/log/kolla/elasticsearch
fi
# Only update permissions if permissions need to be updated
if [[ $(stat -c %U:%G /var/lib/elasticsearch/data) != "elasticsearch:elasticsearch" ]]; then
sudo chown elasticsearch: /var/lib/elasticsearch/data