Elasticsearch new data directory

Hello!
Why after change directory elasticsearch data path, service failed to start.
I change path in elasticsearch.yml to my directory. I make chown elasticsearch to directory and set chmod 777, but whithout changes...
I changed the path.data: /opt/logs in elasticsearch.yml.
After changes i can't start service and i have this error -

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)

I need help!

Read this and specifically the "Also be patient" part.

You will a better chance to get fast answers if you provide details, like sharing your config file. (Format with </> icon please and check the preview window)

I add my conf

Where?

I didn't change something else, i just uncomment path.data.

i just uncomment path.data.

Which means that you changed something.
So please share you elasticsearch.yml file if you need help.

My elasticsearch.yml file -

> #
> # ---------------------------------- Cluster -----------------------------------
> #
> #
> cluster.name: graylog
> #
> # ------------------------------------ Node ------------------------------------
> #
> # Use a descriptive name for the node:
> #
> #node.name: node-1
> #
> # Add custom attributes to the node:
> #
> #node.attr.rack: r1
> #
> # ----------------------------------- Paths ------------------------------------
> #
> # Path to directory where to store the data (separate multiple locations by comma):
> #
> path.data: /opt/logs
> #
> # Path to log files:
> #
> #path.logs: /opt/logs
> #
> # ----------------------------------- Memory -----------------------------------
> #
> # Lock the memory on startup:
> #
> #bootstrap.memory_lock: true
> #
> # Make sure that the heap size 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: 192.168.0.1
> #
> # Set a custom port for HTTP:
> #
> #http.port: 9200
> #
> # For more information, consult the network module documentation.
> #
> # --------------------------------- Discovery ----------------------------------
> #
> # 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 master-eligible nodes / 2 + 1):
> #
> #discovery.zen.minimum_master_nodes: 3
> #
> # For more information, consult the zen discovery module documentation.
> #
> # ---------------------------------- Gateway -----------------------------------
> #
> # Block initial recovery after a full cluster restart until N nodes are started:
> #
> #gateway.recover_after_nodes: 3
> #
> # For more information, consult the gateway module documentation.
> #
> # ---------------------------------- Various -----------------------------------
> #
> # Require explicit names when deleting indices:
> #
> #action.destructive_requires_name: true

Status elasticsearch -

● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: failed (Result: signal) since Sat 2018-02-03 17:15:09 +06; 1h 2min ago
     Docs: http://www.elastic.co
  Process: 12512 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet -Edefault.path.logs=${LOG_DIR} -Edefault.path.data=${DATA_DIR} -Edefault.path.conf=${CONF_DIR} (code=killed, signal=KILL)
  Process: 12509 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 12512 (code=killed, signal=KILL)
Feb 03 17:13:48 graylog systemd[1]: Started Elasticsearch.
Feb 03 17:14:58 graylog elasticsearch[12512]: Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007fb1aa000000, 33554432, 0) failed; e...(errno=12)
Feb 03 17:15:01 graylog elasticsearch[12512]: #
Feb 03 17:15:01 graylog elasticsearch[12512]: # There is insufficient memory for the Java Runtime Environment to continue.
Feb 03 17:15:01 graylog elasticsearch[12512]: # Native memory allocation (mmap) failed to map 33554432 bytes for committing reserved memory.
Feb 03 17:15:01 graylog elasticsearch[12512]: # An error report file with more information is saved as:
Feb 03 17:15:01 graylog elasticsearch[12512]: # /tmp/hs_err_pid12512.log
Feb 03 17:15:09 graylog systemd[1]: elasticsearch.service: main process exited, code=killed, status=9/KILL
Feb 03 17:15:09 graylog systemd[1]: Unit elasticsearch.service entered failed state.
Feb 03 17:15:09 graylog systemd[1]: elasticsearch.service failed.

Please don't use citation then code format when formatting your code.

> # This is wrong
# This is correct

Anyway, why do you mix your data and logs?

path.data: /opt/logs

looks a wrong directory IMO.

But the problem is:

Feb 03 17:15:01 graylog elasticsearch[12512]: # There is insufficient memory for the Java Runtime Environment to continue.

I'm not mix them, just create directory with name logs)) Ok, can are you explain me please, right steps for change data path in elastic?

can are you explain me please, right steps for change data path in elastic?

What you did sounds correct to me.

Your problem is not here IMO as I said previously.

What is IMO?

In My Opinion

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