failed to start elasticsearch on centos8 - elasticsearch

I am using openjdk11 and centos8, systemctl start elasticsearch.service as sudo user
got below error stack without any log, any idea? jvm size is set as Xmx512m Xms512m
[osboxes#ansible-controller ~]$ sudo systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; ven>
Active: failed (Result: exit-code) since Thu 2021-03-11 12:01:26 EST; 6s ago
Docs: http://www.elastic.co
Process: 3435 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -Des.pidfi>
Process: 3433 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd>
Main PID: 3435 (code=exited, status=1/FAILURE)
Mar 11 12:01:26 ansible-controller systemd[1]: Starting Elasticsearch...
Mar 11 12:01:26 ansible-controller systemd[1]: Started Elasticsearch.
Mar 11 12:01:26 ansible-controller systemd[1]: elasticsearch.service: Main proc>
Mar 11 12:01:26 ansible-controller systemd[1]: elasticsearch.service: Failed wi>
lines 1-12/12 (END)...skipping...
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2021-03-11 12:01:26 EST; 6s ago
Docs: http://www.elastic.co
Process: 3435 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.defa>
Process: 3433 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
Main PID: 3435 (code=exited, status=1/FAILURE)
Mar 11 12:01:26 ansible-controller systemd[1]: Starting Elasticsearch...
Mar 11 12:01:26 ansible-controller systemd[1]: Started Elasticsearch.
Mar 11 12:01:26 ansible-controller systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Mar 11 12:01:26 ansible-controller systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
When i run ./elasticsearch --version , got below error, i read document
it said elasticsearch support openjdk11 already
Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Java version I used is openjdk 11, also added at path already as below shown
[osboxes#ansible-controller bin]$ java -version
openjdk version "11.0.9.1" 2020-11-04 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.9.1+1-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.9.1+1-LTS, mixed mode, sharing)

Related

SonarQube on http:/localhost:9000 cannot be reached

I'm running SonarQube on CentOS 7. It is correctly running on the terminal, but if I try to access it through the browser (http:/localhost:9000 or http:/localhost:9001 ) it can't be reached. Can someone help me?
[root#192 logs]# systemctl status sonarqube
● sonarqube.service - SonarQube service
Loaded: loaded (/etc/systemd/system/sonarqube.service; enabled; vendor preset: disabled)
Active: active (running) since ven 2022-10-07 12:48:37 CEST; 3s ago
Process: 23246 ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop (code=exited, status=0/SUCCESS)
Process: 23275 ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start (code=exited, status=0/SUCCESS)
Main PID: 23298 (java)
Tasks: 43
CGroup: /system.slice/sonarqube.service
├─23298 java -Xms8m -Xmx32m --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens...
└─23321 /usr/lib/jvm/java-11-openjdk-11.0.16.1.1-1.el7_9.x86_64/bin/java -XX:+UseG1GC -Djava.io.tmpdir=/opt/sonarqube/temp -XX:ErrorFile...
ott 07 12:48:37 192.168.1.24 systemd[1]: Starting SonarQube service...
ott 07 12:48:37 192.168.1.24 sonar.sh[23275]: /usr/bin/java
ott 07 12:48:37 192.168.1.24 sonar.sh[23275]: Starting SonarQube...
ott 07 12:48:37 192.168.1.24 systemd[1]: Started SonarQube service.
Unable to connect localhost

Error when I trying to start Elasticsearch

I've installed ElasticSearch and I'm trying to start, before installing Magento. I'm getting this error:
sudo 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.
systemctl status elasticsearch.service -l
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2021-04-26 14:15:09 -03; 7s ago
Docs: https://www.elastic.co
Process: 3062 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 3062 (code=exited, status=1/FAILURE)
CGroup: /system.slice/elasticsearch.service
Apr 26 14:15:08 vps-5443219.labarba.digital systemd-entrypoint[3062]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)Apr 26 14:15:08 vps-5443219.labarba.digital systemd-entrypoint[3062]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75)
Apr 26 14:15:08 vps-5443219.labarba.digital systemd-entrypoint[3062]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116)Apr 26 14:15:08 vps-5443219.labarba.digital systemd-entrypoint[3062]: at org.elasticsearch.cli.Command.main(Command.java:79)
Apr 26 14:15:08 vps-5443219.labarba.digital systemd-entrypoint[3062]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
Apr 26 14:15:08 vps-5443219.labarba.digital systemd-entrypoint[3062]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81)
Apr 26 14:15:09 vps-5443219.labarba.digital systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Apr 26 14:15:09 vps-5443219.labarba.digital systemd[1]: Failed to start Elasticsearch.
Apr 26 14:15:09 vps-5443219.labarba.digital systemd[1]: Unit elasticsearch.service entered failed state.
Apr 26 14:15:09 vps-5443219.labarba.digital systemd[1]: elasticsearch.service failed.
I tried to follow this link to solve this problem: https://stackoverflow.com/questions/58656747/elasticsearch-job-for-elasticsearch-service-failed
None of these solutions works for me.
Any help, please?
Ps1.: I'm using VPS Hostgator.
Ps2.: To install, I'm following this link: https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html
I solved!
Just change in /etc/elasticsearch/jvm.options:
OLD: #-Djava.io.tmpdir=${ES_TMPDIR}
NEW: -Djava.io.tmpdir=/var/log/elasticsearch
For me, the problem is solved!

How to resolve the starting error in sonarqube?

While giving sudo update-rc.d -f sonar remove I'm getting the below error
insserv: warning: script 'K01sonarqube' missing LSB tags and overrides
insserv: warning: script 'sonarqube' missing LSB tags and overrides
insserv: warning: script 'sonar' missing LSB tags and overrides
While starting sonarqube i'm getting
● sonarqube.service - SonarQube service
Loaded: loaded (/etc/systemd/system/sonarqube.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Fri 2018-10-19 12:48:24 IST; 14s ago
Process: 11420 ExecStop=/opt/sonarqube/sonarqube-6.7.5/bin/linux-x86-64/sonar.sh stop (code=exited, status=0/SUCCESS)
Process: 11372 ExecStart=/opt/sonarqube/sonarqube-6.7.5/bin/linux-x86-64/sonar.sh start (code=exited, status=0/SUCCESS)
Main PID: 984 (code=exited, status=1/FAILURE)
Oct 19 12:48:24 master-VB systemd[1]: Started SonarQube service.
Oct 19 12:48:24 master-VB systemd[1]: sonarqube.service: Service hold-off time over, scheduling restart.
Oct 19 12:48:24 master-VB systemd[1]: Stopped SonarQube service.
Oct 19 12:48:24 master-VB systemd[1]: sonarqube.service: Start request repeated too quickly.
Oct 19 12:48:24 master-VB systemd[1]: Failed to start SonarQube service.

how to fix icinga2.service: main proces exited

Hello i have got one problem with icinga. There is a log.
root#fejt-vxp:~# systemctl status icinga2
● icinga2.service - Icinga host/service/network monitoring system
Loaded: loaded (/lib/systemd/system/icinga2.service; enabled)
Drop-In: /etc/systemd/system/icinga2.service.d
└─limits.conf
Active: failed (Result: exit-code) since Mon 2018-08-27 12:06:08 CEST; 37s ago
Process: 4346 ExecStart=/usr/sbin/icinga2 daemon -e ${ICINGA2_ERROR_LOG} (code=exited, status=203/EXEC)
Process: 4338 ExecStartPre=/usr/lib/icinga2/prepare-dirs /usr/lib/icinga2/icinga2 (code=exited, status=0/SUCCESS)
Main PID: 4346 (code=exited, status=203/EXEC)
Aug 27 12:06:08 fejt-vxp systemd[1]: Started Icinga host/service/network monitoring system.
Aug 27 12:06:08 fejt-vxp systemd[1]: icinga2.service: main process exited, code=exited, status=203/EXEC
Aug 27 12:06:08 fejt-vxp systemd[1]: Unit icinga2.service entered failed state.
When i wrote systemctl start icinga2 or /etc/init.d/icinga2 start
without action.
thank you
Addition:
Each other applications are ready responding: mysql, apache2
the most useful debugging informations why icinga2 does not start you can find in
/var/log/icinga2/startup.log
or via
journalctl -xe

How to restart my elasticsearch?

I installed it yesterday on my desktop(Ubuntu 16.04)
elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since уто 2018-04-17 10:18:51 CEST; 2min 58s ago
Docs: http://www.elastic.co
Main PID: 20185 (code=exited, status=1/FAILURE)
апр 17 10:18:44 jh-System-Product-Name systemd[1]: Started Elasticsearch.
апр 17 10:18:51 jh-System-Product-Name systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
апр 17 10:18:51 jh-System-Product-Name systemd[1]: elasticsearch.service: Unit entered failed state.
апр 17 10:18:51 jh-System-Product-Name systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
I have tried both
sudo update-rc.d elasticsearch defaults 95 10
sudo systemctl start elasticsearch
I have changed network.host and port in elasticsearch.yml
network.host: 192.168.0.1
http.port: 9200
I have done what Val suggested
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
If I go for
sudo journalctl -f
then I have
kibana[16891]: {"type":"log","#timestamp":"2018-04-17T08:37:39Z","tags":["warning","elasticsearch","admin"],"pid":16891,"message":"Unable to revive connection: http://localhost:9200/"}
kibana[16891]: {"type":"log","#timestamp":"2018-04-17T08:37:39Z","tags":["warning","elasticsearch","admin"],"pid":16891,"message":"No living connections"}
I have tried to restart again
elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
elasticsearch.service: Unit entered failed state.
elasticsearch.service: Failed with result 'exit-code'.
milenko : TTY=pts/1 ; PWD=/home/milenko ; USER=root ; COMMAND=/bin/journalctl -f
What does this output mean?
I do not understant what is wrong,I have the same problem.

Resources