Reputation: 298
I searched the errors on Google and referred to them, but I couldn't solve the problem.
How can I do systemctl restart elasticsearch. Can I use the service command?
elasticsearch.yml
(/etc/elasticsearch)
node.name: node-1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
cluster.initial_master_nodes: ["node-1", "node-2"]
systemctl status elasticsearch.service
command use but error occured (pic1)
journalctl -xe
May 27 06:36:54 elk sshd[29380]: Invalid user administrator from 36.65.172.36 port 55685
May 27 06:36:55 elk sshd[29380]: Connection closed by invalid user administrator 36.65.172.36 port 55685 [preauth]
May 27 06:36:59 elk sudo[29399]: injekim97 : TTY=pts/1 ; PWD=/ ; USER=root ; COMMAND=/usr/bin/systemctl restart elasticsearch.service
May 27 06:36:59 elk sudo[29399]: pam_unix(sudo:session): session opened for user root by injekim97(uid=0)
May 27 06:36:59 elk systemd[1]: Starting Elasticsearch...
-- Subject: A start job for unit elasticsearch.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit elasticsearch.service has begun execution.
--
-- The job identifier is 3563.
May 27 06:36:59 elk systemd-entrypoint[29402]: /usr/share/elasticsearch/bin/elasticsearch-env: line 87: /etc/default/elasticsearch: Permission denied
May 27 06:36:59 elk systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit elasticsearch.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
May 27 06:36:59 elk systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit elasticsearch.service has entered the 'failed' state with result 'exit-code'.
May 27 06:36:59 elk systemd[1]: Failed to start Elasticsearch.
-- Subject: A start job for unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit elasticsearch.service has finished with a failure.
--
-- The job identifier is 3563 and the job result is failed.
May 27 06:36:59 elk sudo[29399]: pam_unix(sudo:session): session closed for user root
May 27 06:37:03 elk sshd[29463]: Invalid user administrator from 36.65.172.36 port 55888
May 27 06:37:03 elk sshd[29463]: Connection closed by invalid user administrator 36.65.172.36 port 55888 [preauth]
my attempt
May 27 06:36:59 elk systemd-entrypoint[29402]: /usr/share/elasticsearch/bin/elasticsearch-env: line 87: /etc/default/elasticsearch: Permission denied
sudo chown -R user:user /usr/share/elasticsearch/bin
-> but error occured
how to use command
systemctl restart elasticsearch
in linux?
Upvotes: 1
Views: 4019
Reputation: 105
Can you do an ls -l
on the directory? Make sure it is owned by elasticsearch. Try this command sudo chown -R elasticsearch:elasticsearch /etc/default/elasticsearch
. Remember also that Elasticsearch cannot start from root when build as source.
Upvotes: 1