XenForo Enhanced Search - Failed to start Elasticsearch.

Thanos Crax

Collaborate
Collaborate
Registered
Joined
Sep 25, 2020
Messages
325
Points
73

Reputation:

Code:
systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2022-12-30 02:16:25 +08; 24s ago
     Docs: https://www.elastic.co
  Process: 17077 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
 Main PID: 17077 (code=exited, status=1/FAILURE)

Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:169)
Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160)
Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.cli.Command.main(Command.java:77)
Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125)
Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
Dec 30 02:16:25 server systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Dec 30 02:16:25 server systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Dec 30 02:16:25 server systemd[1]: Failed to start Elasticsearch.

I tried installing 7.x and 8.x both almost 7 times and always ended up on this issue when trying to start it

Guide used: https://www.elastic.co/guide/en/elasticsearch/reference/7.17/deb.html#install-deb

Debian 10

@BattleKing
 

thomsa

Moderator
Staff member
Moderator
S.V.I.P Member
Collaborate
Registered
Joined
Jun 22, 2019
Messages
1,169
Points
173

Reputation:

Code:
systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2022-12-30 02:16:25 +08; 24s ago
     Docs: https://www.elastic.co
  Process: 17077 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
 Main PID: 17077 (code=exited, status=1/FAILURE)

Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:169)
Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160)
Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.cli.Command.main(Command.java:77)
Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125)
Dec 30 02:16:22 server systemd-entrypoint[17077]:         at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
Dec 30 02:16:25 server systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Dec 30 02:16:25 server systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Dec 30 02:16:25 server systemd[1]: Failed to start Elasticsearch.

I tried installing 7.x and 8.x both almost 7 times and always ended up on this issue when trying to start it

Guide used: https://www.elastic.co/guide/en/elasticsearch/reference/7.17/deb.html#install-deb

Debian 10

@BattleKing
Thanos Craxinstall with https://www.elastic.co/guide/en/elasticsearch/reference/7.17/deb.html
debian 11
Bash:
root@debian:~# apt-get install elasticsearch
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-image-5.10.0-18-arm64
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
  elasticsearch
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 313 MB of archives.
After this operation, 526 MB of additional disk space will be used.
Get:1 https://artifacts.elastic.co/packages/7.x/apt stable/main arm64 elasticsearch arm64 7.17.8 [313 MB]
Fetched 313 MB in 3min 4s (1,701 kB/s)
Selecting previously unselected package elasticsearch.
(Reading database ... 99678 files and directories currently installed.)
Preparing to unpack .../elasticsearch_7.17.8_arm64.deb ...
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Unpacking elasticsearch (7.17.8) ...
Setting up elasticsearch (7.17.8) ...
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
 sudo systemctl start elasticsearch.service
Created elasticsearch keystore in /etc/elasticsearch/elasticsearch.keystore
root@debian:~# systemctl start elasticsearch.service
root@debian:~#
 

Thanos Crax

Collaborate
Collaborate
Registered
Joined
Sep 25, 2020
Messages
325
Points
73

Reputation:

install with https://www.elastic.co/guide/en/elasticsearch/reference/7.17/deb.html
debian 11
Bash:
root@debian:~# apt-get install elasticsearch
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-image-5.10.0-18-arm64
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
  elasticsearch
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 313 MB of archives.
After this operation, 526 MB of additional disk space will be used.
Get:1 https://artifacts.elastic.co/packages/7.x/apt stable/main arm64 elasticsearch arm64 7.17.8 [313 MB]
Fetched 313 MB in 3min 4s (1,701 kB/s)
Selecting previously unselected package elasticsearch.
(Reading database ... 99678 files and directories currently installed.)
Preparing to unpack .../elasticsearch_7.17.8_arm64.deb ...
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Unpacking elasticsearch (7.17.8) ...
Setting up elasticsearch (7.17.8) ...
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
 sudo systemctl start elasticsearch.service
Created elasticsearch keystore in /etc/elasticsearch/elasticsearch.keystore
root@debian:~# systemctl start elasticsearch.service
root@debian:~#
thomsa
Bash:
root@th:~# apt-get install elasticsearch
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libunwind8 libvarnishapi2 linux-image-4.19.0-18-amd64
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
  elasticsearch
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 315 MB of archives.
After this operation, 526 MB of additional disk space will be used.
Get:1 https://artifacts.elastic.co/packages/7.x/apt stable/main amd64 elasticsearch amd64 7.17.8 [315 MB]
Fetched 315 MB in 20s (15.6 MB/s)
Selecting previously unselected package elasticsearch.
(Reading database ... 152324 files and directories currently installed.)
Preparing to unpack .../elasticsearch_7.17.8_amd64.deb ...
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Unpacking elasticsearch (7.17.8) ...
Setting up elasticsearch (7.17.8) ...
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
 sudo systemctl start elasticsearch.service
Created elasticsearch keystore in /etc/elasticsearch/elasticsearch.keystore
Processing triggers for systemd (241-7~deb10u8) ...
root@th:~# systemctl daemon-reload
root@th:~# systemctl enable elasticsearch.service
Synchronizing state of elasticsearch.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable elasticsearch
insserv: warning: current start runlevel(s) (empty) of script `elasticsearch' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `elasticsearch' overrides LSB defaults (0 1 6).
Created symlink /etc/systemd/system/multi-user.target.wants/elasticsearch.service → /lib/systemd/system/elasticsearch.service.
root@th:~#  systemctl start elasticsearch.service
Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.
root@th:~#

Removed all old elasticsearch shit including repo and cache....

then followed the guide from start to end

Finally when starting again:

Bash:
root@th:~#  systemctl start elasticsearch.service
Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.
root@th:~#


Bash:
root@th:~# systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2022-12-30 22:27:44 +08; 4min 17s ago
     Docs: https://www.elastic.co
  Process: 18113 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exi
 Main PID: 18113 (code=exited, status=1/FAILURE)

Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.bootstrap.Elasticsearch.
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.cli.EnvironmentAwareComm
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.cli.Command.mainWithoutE
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.cli.Command.main(Command
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.bootstrap.Elasticsearch.
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.bootstrap.Elasticsearch.
Dec 30 22:27:42 server systemd-entrypoint[18113]: For complete error details, refer to the log at /var/
Dec 30 22:27:44 server systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FA
Dec 30 22:27:44 server systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Dec 30 22:27:44 server systemd[1]: Failed to start Elasticsearch.
lines 1-17/17 (END)
 
View previous replies…

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,532
Points
523

Reputation:

Bash:
root@th:~# apt-get install elasticsearch
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libunwind8 libvarnishapi2 linux-image-4.19.0-18-amd64
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
  elasticsearch
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 315 MB of archives.
After this operation, 526 MB of additional disk space will be used.
Get:1 https://artifacts.elastic.co/packages/7.x/apt stable/main amd64 elasticsearch amd64 7.17.8 [315 MB]
Fetched 315 MB in 20s (15.6 MB/s)
Selecting previously unselected package elasticsearch.
(Reading database ... 152324 files and directories currently installed.)
Preparing to unpack .../elasticsearch_7.17.8_amd64.deb ...
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Unpacking elasticsearch (7.17.8) ...
Setting up elasticsearch (7.17.8) ...
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
 sudo systemctl start elasticsearch.service
Created elasticsearch keystore in /etc/elasticsearch/elasticsearch.keystore
Processing triggers for systemd (241-7~deb10u8) ...
root@th:~# systemctl daemon-reload
root@th:~# systemctl enable elasticsearch.service
Synchronizing state of elasticsearch.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable elasticsearch
insserv: warning: current start runlevel(s) (empty) of script `elasticsearch' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `elasticsearch' overrides LSB defaults (0 1 6).
Created symlink /etc/systemd/system/multi-user.target.wants/elasticsearch.service → /lib/systemd/system/elasticsearch.service.
root@th:~#  systemctl start elasticsearch.service
Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.
root@th:~#

Removed all old elasticsearch shit including repo and cache....

then followed the guide from start to end

Finally when starting again:

Bash:
root@th:~#  systemctl start elasticsearch.service
Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.
root@th:~#


Bash:
root@th:~# systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2022-12-30 22:27:44 +08; 4min 17s ago
     Docs: https://www.elastic.co
  Process: 18113 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exi
 Main PID: 18113 (code=exited, status=1/FAILURE)

Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.bootstrap.Elasticsearch.
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.cli.EnvironmentAwareComm
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.cli.Command.mainWithoutE
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.cli.Command.main(Command
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.bootstrap.Elasticsearch.
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.bootstrap.Elasticsearch.
Dec 30 22:27:42 server systemd-entrypoint[18113]: For complete error details, refer to the log at /var/
Dec 30 22:27:44 server systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FA
Dec 30 22:27:44 server systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Dec 30 22:27:44 server systemd[1]: Failed to start Elasticsearch.
lines 1-17/17 (END)
Thanos Craxwhich version is it?

have you check the heapmemory? Try to execute

sudo dpkg --configure -a

Did you checked permissions and configuration file? What is written in the mentioned log file
 

thomsa

Moderator
Staff member
Moderator
S.V.I.P Member
Collaborate
Registered
Joined
Jun 22, 2019
Messages
1,169
Points
173

Reputation:

Bash:
root@th:~# apt-get install elasticsearch
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libunwind8 libvarnishapi2 linux-image-4.19.0-18-amd64
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
  elasticsearch
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 315 MB of archives.
After this operation, 526 MB of additional disk space will be used.
Get:1 https://artifacts.elastic.co/packages/7.x/apt stable/main amd64 elasticsearch amd64 7.17.8 [315 MB]
Fetched 315 MB in 20s (15.6 MB/s)
Selecting previously unselected package elasticsearch.
(Reading database ... 152324 files and directories currently installed.)
Preparing to unpack .../elasticsearch_7.17.8_amd64.deb ...
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Unpacking elasticsearch (7.17.8) ...
Setting up elasticsearch (7.17.8) ...
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
 sudo systemctl start elasticsearch.service
Created elasticsearch keystore in /etc/elasticsearch/elasticsearch.keystore
Processing triggers for systemd (241-7~deb10u8) ...
root@th:~# systemctl daemon-reload
root@th:~# systemctl enable elasticsearch.service
Synchronizing state of elasticsearch.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable elasticsearch
insserv: warning: current start runlevel(s) (empty) of script `elasticsearch' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `elasticsearch' overrides LSB defaults (0 1 6).
Created symlink /etc/systemd/system/multi-user.target.wants/elasticsearch.service → /lib/systemd/system/elasticsearch.service.
root@th:~#  systemctl start elasticsearch.service
Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.
root@th:~#

Removed all old elasticsearch shit including repo and cache....

then followed the guide from start to end

Finally when starting again:

Bash:
root@th:~#  systemctl start elasticsearch.service
Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.
root@th:~#


Bash:
root@th:~# systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2022-12-30 22:27:44 +08; 4min 17s ago
     Docs: https://www.elastic.co
  Process: 18113 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exi
 Main PID: 18113 (code=exited, status=1/FAILURE)

Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.bootstrap.Elasticsearch.
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.cli.EnvironmentAwareComm
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.cli.Command.mainWithoutE
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.cli.Command.main(Command
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.bootstrap.Elasticsearch.
Dec 30 22:27:42 server systemd-entrypoint[18113]:         at org.elasticsearch.bootstrap.Elasticsearch.
Dec 30 22:27:42 server systemd-entrypoint[18113]: For complete error details, refer to the log at /var/
Dec 30 22:27:44 server systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FA
Dec 30 22:27:44 server systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Dec 30 22:27:44 server systemd[1]: Failed to start Elasticsearch.
lines 1-17/17 (END)
Thanos CraxDebian version ?

Error
Bash:
insserv: warning: current start runlevel(s) (empty) of script `elasticsearch' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `elasticsearch' overrides LSB defaults (0 1 6).
 

Thanos Crax

Collaborate
Collaborate
Registered
Joined
Sep 25, 2020
Messages
325
Points
73

Reputation:

Debian version ?

Error
Bash:
insserv: warning: current start runlevel(s) (empty) of script `elasticsearch' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `elasticsearch' overrides LSB defaults (0 1 6).
thomsaI'm using debian 10 currently
 

thomsa

Moderator
Staff member
Moderator
S.V.I.P Member
Collaborate
Registered
Joined
Jun 22, 2019
Messages
1,169
Points
173

Reputation:

I'm using debian 10 currently
Thanos Craxthat error from init.d your install .deb to remove it first.

dpkg -P elasticsearch-7.17.8-amd64.deb

apt-get remove elasticsearch

and reinstall it agian.
 

Thanos Crax

Collaborate
Collaborate
Registered
Joined
Sep 25, 2020
Messages
325
Points
73

Reputation:

that error from init.d your install .deb to remove it first.

dpkg -P elasticsearch-7.17.8-amd64.deb

apt-get remove elasticsearch

and reinstall it agian.
thomsaI did that before. This time I installed it using apt and again same error.
 

Thanos Crax

Collaborate
Collaborate
Registered
Joined
Sep 25, 2020
Messages
325
Points
73

Reputation:

try

sudo apt-get purge elasticsearch-7.17.8-amd64.deb

sudo apt-get purge elasticsearch
thomsa
Code:
root@th:~# apt-get purge elasticsearch-7.17.8-amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package elasticsearch-7.17.8-amd64.deb
E: Couldn't find any package by glob 'elasticsearch-7.17.8-amd64.deb'
E: Couldn't find any package by regex 'elasticsearch-7.17.8-amd64.deb'
root@th:~# locate elasticsearch-7.17.8-amd64.deb
root@th:~# find elasticsearch-7.17.8-amd64.deb
elasticsearch-7.17.8-amd64.deb
root@th:~# rm elasticsearch-7.17.8-amd64.deb
root@th:~# find elasticsearch-7.17.8-amd64.deb
find: ‘elasticsearch-7.17.8-amd64.deb’: No such file or directory
root@th:~# apt-get purge elasticsearch
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libunwind8 libvarnishapi2 linux-image-4.19.0-18-amd64
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  elasticsearch*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 526 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 153420 files and directories currently installed.)
Removing elasticsearch (7.17.8) ...
Stopping elasticsearch service... OK
Deleting log directory... OK
(Reading database ... 152336 files and directories currently installed.)
Purging configuration files for elasticsearch (7.17.8) ...
dpkg: warning: while removing elasticsearch, directory '/var/lib/elasticsearch' not empty so not removed
Processing triggers for systemd (241-7~deb10u8) ...
root@th:~# rm /var/lib/elasticsearch/
rm: cannot remove '/var/lib/elasticsearch/': Is a directory
root@th:~# apt install elasticsearch
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libunwind8 libvarnishapi2 linux-image-4.19.0-18-amd64
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
  elasticsearch
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/315 MB of archives.
After this operation, 526 MB of additional disk space will be used.
Selecting previously unselected package elasticsearch.
(Reading database ... 152324 files and directories currently installed.)
Preparing to unpack .../elasticsearch_7.17.8_amd64.deb ...
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Unpacking elasticsearch (7.17.8) ...
Setting up elasticsearch (7.17.8) ...
### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
 sudo systemctl daemon-reload
 sudo systemctl enable elasticsearch.service
### You can start elasticsearch service by executing
 sudo systemctl start elasticsearch.service
Created elasticsearch keystore in /etc/elasticsearch/elasticsearch.keystore
Processing triggers for systemd (241-7~deb10u8) ...
root@th:~# ^C
root@th:~# find elasticsearch_7.17.8_amd64.deb
find: ‘elasticsearch_7.17.8_amd64.deb’: No such file or directory
root@th:~# find elasticsearch_7.17.8
find: ‘elasticsearch_7.17.8’: No such file or directory
root@th:~# ^C
root@th:~# systemctl daemon-reload
root@th:~# ^C
root@th:~# systemctl enable elasticsearch.service
Synchronizing state of elasticsearch.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable elasticsearch
Created symlink /etc/systemd/system/multi-user.target.wants/elasticsearch.service → /lib/systemd/system/elasticsearch.service.
root@th:~# ^C
root@th:~# service elasticsearch start
Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.
root@th:~# ^C
root@th:~# systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2022-12-31 20:48:01 +08; 6s ago
     Docs: https://www.elastic.co
  Process: 3822 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
 Main PID: 3822 (code=exited, status=1/FAILURE)

Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.cli.Command.main(Command.java:77)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
Dec 31 20:48:00 server systemd-entrypoint[3822]: For complete error details, refer to the log at /var/log/elasticsearch/elasticsearch.log
Dec 31 20:48:01 server systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Dec 31 20:48:01 server systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Dec 31 20:48:01 server systemd[1]: Failed to start Elasticsearch.
root@th:~#

Did it twice. Also deleted old deb file and then again same issue
 

Thanos Crax

Collaborate
Collaborate
Registered
Joined
Sep 25, 2020
Messages
325
Points
73

Reputation:

try

sudo apt-get purge elasticsearch-7.17.8-amd64.deb

sudo apt-get purge elasticsearch
thomsa
Code:
Dec 31 20:48:00 server systemd-entrypoint[3822]: uncaught exception in thread [main]
Dec 31 20:48:00 server systemd-entrypoint[3822]: java.lang.IllegalStateException: Unable to access 'path.data' (/var/lib/elasticsearch)
Dec 31 20:48:00 server systemd-entrypoint[3822]: Likely root cause: java.nio.file.AccessDeniedException: /var/lib/elasticsearch
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at java.base/sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:313)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:314)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:64)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:226)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:168)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Security.configure(Security.java:115)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:229)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:169)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.cli.Command.main(Command.java:77)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125)
Dec 31 20:48:00 server systemd-entrypoint[3822]:         at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
Dec 31 20:48:00 server systemd-entrypoint[3822]: For complete error details, refer to the log at /var/log/elasticsearch/elasticsearch.log
Dec 31 20:48:01 server systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit elasticsearch.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Dec 31 20:48:01 server systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit elasticsearch.service has entered the 'failed' state with result 'exit-code'.
Dec 31 20:48:01 server systemd[1]: Failed to start Elasticsearch.
-- Subject: A start job for unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit elasticsearch.service has finished with a failure.
--
-- The job identifier is 114745 and the job result is failed.

Found this in journal
 

Thanos Crax

Collaborate
Collaborate
Registered
Joined
Sep 25, 2020
Messages
325
Points
73

Reputation:

Thanos Crax

Collaborate
Collaborate
Registered
Joined
Sep 25, 2020
Messages
325
Points
73

Reputation:

try

sudo apt-get purge elasticsearch-7.17.8-amd64.deb

sudo apt-get purge elasticsearch
thomsaNew users who just installed enhanced search will notice it uses all your ram.
Like now its using 40-50gigs of my ram

so to fix this you need to set a limit for it using these commands:

Make a file with .options at end like this:
nano /etc/elasticsearch/jvm.options.d/my.options

then enter the limit:
-Xms20g -Xmx20g

then save and restart elasticsearch
 
Top