I have followed the guide here to install ELK in CentOS 7, and it worked.
The next day, I tried to change the path of the data and logs on another volume, but failed, so I changed it to local directory. ( /etc/elasticsearch/elasticsearch.yml)
Here's my config
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /opt/elasticsearch/data
path.logs: /opt/elasticsearch/logs
But, when I restart ElasticSearch this is what I get:
elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2016-01-25 06:33:40 UTC; 9s ago
Docs: http://www.elastic.co
Process: 22213 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -Des.pidfile=${PID_DIR}/elasticsearch.pid -Des.default.path.home=${ES_HOME} -Des.default.path.logs=${LOG_DIR} -Des.default.path.data=${DATA_DIR} -Des.default.path.conf=${CONF_DIR} (code=exited, status=1/FAILURE)
Process: 22212 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
Main PID: 22213 (code=exited, status=1/FAILURE)
elasticsearch[22213]: at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1074)
elasticsearch[22213]: at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1061)
elasticsearch[22213]: at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:88)
elasticsearch[22213]: at org.elasticsearch.bootstrap.Bootstrap.initialSettings(Bootstrap.java:217)
elasticsearch[22213]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:256)
elasticsearch[22213]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
elasticsearch[22213]: Refer to the log for complete error details.
systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
systemd[1]: Unit elasticsearch.service entered failed state.
systemd[1]: elasticsearch.service failed.
I did set the ownership to elasticsearch:
/opt/elasticsearch
[root@localhost elasticsearch]# ls -al
total 4
drwxr-xr-x. 4 elasticsearch elasticsearch 28 Jan 26 07:29 .
drwxr-xr-x. 7 root root 4096 Jan 26 07:29 ..
drwxr-xr-x. 2 elasticsearch elasticsearch 6 Jan 26 07:29 data
drwxr-xr-x. 2 elasticsearch elasticsearch 6 Jan 26 07:29 logs
I even tried on a fresh CentOS 7, but the outcome is same. What am I missing here?
Note: I'm new to this ELK, and just started experimenting with it as alternative for Splunk.
I will appreciate for any help I can get.
Thanks!