I installed Elasticsearch & Kibana in Linux Mint 20.3 localhost with archive option because installation from Debian Package does not work as expected: Install Elasticsearch from archive on Linux or MacOS | Elasticsearch Guide [8.3] | Elastic.
Everything works perfectly in the browser if I start the service in the terminal with: ./bin/elasticsearch (from the folder where I installed Elasticsearch).
The problem is that the following CL commands do not activate the services at startup as long as the installation is from the archive (direct) and not through the package manager.
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
So I had to create a symlink:
ln -s /home/marius/software/elasticsearch/elasticsearch-8.3.2/bin/elasticsearch /usr/share/elasticsearch/bin/elasticsearch
After restart:
sudo /bin/systemctl status elasticsearch.service
Result:
elasticsearch.service - Elasticsearch
Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-07-13 19:58:44 EEST; 1h 28min ago
Docs: http://www.elastic.co
Process: 1528 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 1528 (code=exited, status=1/FAILURE)
Jul 13 19:58:44 marius systemd[1]: Started Elasticsearch.
Jul 13 19:58:44 marius elasticsearch[1528]: /usr/share/elasticsearch/bin/elasticsearch: line 5: /usr/share/elasticsearch/bin/elasticsearch-cli: No such file or directory
Jul 13 19:58:44 marius systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jul 13 19:58:44 marius systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
However I try to create the simlink I get various errors.
The question is: How do I create a symlink and enable Elasticsearch to start at startup? I repeat what I said at the beginning; "Everything works perfectly in the browser if I start the service in the terminal with: ./bin/elasticsearch".