Can't start Elasticsearch (fileInputStream Fail) - elasticsearch

I'm currently building up a test environment for HPE ALM Octane for my company. This Application uses Elasticsearch. Now I have the problem, that I can't start my Elasticsearchserver and I'm a bit at the end of my nerves ;).
Cause Octane works with Elasticsearch version 2.4.0, I'm also forced to work with this version.
I get the following Error:
Error - Console Screenshot
elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service;
enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2017-02-21 09:40:50 CET; 1h 9min ago
Process: 954 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)
Process: 949 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
Main PID: 954 (code=exited, status=1/FAILURE)
Feb 21 09:40:50 linux-rfw5 elasticsearch[954]: at java.nio.file.Files.newInputStream(Files.java:152)
Feb 21 09:40:50 linux-rfw5 elasticsearch[954]: at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1067)
Feb 21 09:40:50 linux-rfw5 elasticsearch[954]: at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:88)
Feb 21 09:40:50 linux-rfw5 elasticsearch[954]: at org.elasticsearch.bootstrap.Bootstrap.initialSettings(Bootstrap.java:218)
Feb 21 09:40:50 linux-rfw5 elasticsearch[954]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:257)
Feb 21 09:40:50 linux-rfw5 elasticsearch[954]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Feb 21 09:40:50 linux-rfw5 elasticsearch[954]: Refer to the log for complete error details.
Feb 21 09:40:50 linux-rfw5 systemd 1 : elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Feb 21 09:40:50 linux-rfw5 systemd 1 : elasticsearch.service: Unit entered failed state.
Feb 21 09:40:50 linux-rfw5 systemd 1 : elasticsearch.service: Failed with result 'exit-code'.
I configured the absolute minimum, that is possible. My Configurations:
elasticsearch.yml (/etc/elasticsearch/)
1.1 cluster.name: octane_test
1.2 node.name: elasticNode
1.3 network.host: 127.0.0.1 (yes localhost, cause I'm running the octane server on the same host)
http.port: 9200 elasticsearch (/etc/sysconfig/)
2.1 ES_HEAP_SIZE=4g (4 GB is 50% of the maximum memory)
I appreciate your help ;)
Joel

Related

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!

failed to start elasticsearch on centos8

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)

i moved elasticsearch to new folder also give new path in elasticsearch.yml file but its giving error

This is the error I am getting from elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2019-07-11 08:23:29 UTC; 1h 29min ago
Docs: http://www.elastic.co
Process: 1579 ExecStart=/usr/local/elasticsearch/bin/elasticsearch (code=exited, status=78)
Main PID: 1579 (code=exited, status=78)
This is the log file , this is what i get after using 'journalctl -u elasticsearch.service' command:
Jul 11 06:06:26 vyakar-stage-elastic systemd[1]: Started Elasticsearch.
Jul 11 06:08:28 vyakar-stage-elastic systemd[1]: Stopping Elasticsearch...
Jul 11 06:08:28 vyakar-stage-elastic systemd[1]: Stopped Elasticsearch.
Jul 11 06:34:49 vyakar-stage-elastic systemd[1]: Started Elasticsearch.
Jul 11 06:35:09 vyakar-stage-elastic systemd[1]: elasticsearch.service: Main process exited, code=exited, status=78/n/a
Jul 11 06:35:09 vyakar-stage-elastic systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jul 11 06:48:00 vyakar-stage-elastic systemd[1]: Started Elasticsearch.
Jul 11 06:48:20 vyakar-stage-elastic systemd[1]: elasticsearch.service: Main process exited, code=exited, status=78/n/a
Jul 11 06:48:20 vyakar-stage-elastic systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jul 11 06:52:21 vyakar-stage-elastic systemd[1]: Started Elasticsearch.
Jul 11 06:52:42 vyakar-stage-elastic systemd[1]: elasticsearch.service: Main process exited, code=exited, status=78/n/a
Jul 11 06:52:42 vyakar-stage-elastic systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jul 11 06:57:36 vyakar-stage-elastic systemd[1]: Started Elasticsearch.
Jul 11 06:57:57 vyakar-stage-elastic systemd[1]: elasticsearch.service: Main process exited, code=exited, status=78/n/a
Jul 11 06:57:57 vyakar-stage-elastic systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jul 11 07:46:36 vyakar-stage-elastic systemd[1]: Started Elasticsearch.
Jul 11 07:46:40 vyakar-stage-elastic elasticsearch[726]: [2019-07-11T07:46:40,490][WARN ][o.e.b.JNANatives ] [fmcn] Unable to lock JVM Memory: error=12, r
Jul 11 07:46:40 vyakar-stage-elastic elasticsearch[726]: [2019-07-11T07:46:40,501][WARN ][o.e.b.JNANatives ] [fmcn] This can result in part of the JVM bei
Jul 11 07:46:40 vyakar-stage-elastic elasticsearch[726]: [2019-07-11T07:46:40,503][WARN ][o.e.b.JNANatives ] [fmcn] Increase RLIMIT_MEMLOCK, soft limit: 1
Jul 11 07:46:40 vyakar-stage-elastic elasticsearch[726]: [2019-07-11T07:46:40,504][WARN ][o.e.b.JNANatives ] [fmcn] These can be adjusted by modifying /et
Jul 11 07:46:40 vyakar-stage-elastic elasticsearch[726]: # allow user 'elasticsearch' mlockall

Configure kibana with SSL

I want to configure Kibana, so, that I can access over https.
I did following changes in Kibana config file (/etc/kibana/kibana.yml):
server.host: 0.0.0.0
server.ssl.enabled: true
server.ssl.key: /etc/elasticsearch/privkey.pem // Using same SSL that I created for elasticsearch
server.ssl.certificate: /etc/elasticsearch/cert.pem // Using same SSL that I created for elasticsearch
elasticsearch.url: https://127.0.0.1:9200
elasticsearch.ssl.verificationMode: none
elasticsearch.username: kibanaserver
elasticsearch.password: kibanaserver
elasticsearch.requestHeadersWhitelist: ["securitytenant","Authorization"]
opendistro_security.multitenancy.enabled: true
opendistro_security.multitenancy.tenants.preferred: ["Private", "Global"]
opendistro_security.readonly_mode.roles: ["kibana_read_only"]
When I restart/start Kibana, it's giving me below error:
● kibana.service - Kibana
Loaded: loaded (/etc/systemd/system/kibana.service; disabled; vendor preset: enabled)
Active: failed (Result: start-limit-hit) since Wed 2019-06-05 14:20:12 UTC; 382ms ago
Process: 32505 ExecStart=/usr/share/kibana/bin/kibana -c /etc/kibana/kibana.yml (code=exited, status=1/FAILURE)
Main PID: 32505 (code=exited, status=1/FAILURE)
Jun 05 14:20:11 mts-elk-test systemd[1]: kibana.service: Main process exited, code=exited, status=1/FAILURE
Jun 05 14:20:11 mts-elk-test systemd[1]: kibana.service: Unit entered failed state.
Jun 05 14:20:11 mts-elk-test systemd[1]: kibana.service: Failed with result 'exit-code'.
Jun 05 14:20:12 mts-elk-test systemd[1]: kibana.service: Service hold-off time over, scheduling restart.
Jun 05 14:20:12 mts-elk-test systemd[1]: Stopped Kibana.
Jun 05 14:20:12 mts-elk-test systemd[1]: kibana.service: Start request repeated too quickly.
Jun 05 14:20:12 mts-elk-test systemd[1]: Failed to start Kibana.
Jun 05 14:20:12 mts-elk-test systemd[1]: kibana.service: Unit entered failed state.
Jun 05 14:20:12 mts-elk-test systemd[1]: kibana.service: Failed with result 'start-limit-hit'.
root#mts-elk-test:/home/ronak# vi /etc/kibana/kibana.yml
I found the solution. There was a problem with file permission.
I copied cert.pem and privkey.pem files from elasticsearch directory to kibana and changed owner with kibana user:
chown kibana:kibana /etc/kibana/cert.pem
chown kibana:kibana /etc/kibana/privkey.pem
Changed path in kibana.yml file:
server.ssl.key: /etc/kibana/privkey.pem
server.ssl.certificate: /etc/kibana/cert.pem
Rstart kibana: service kibana restart
And it worked!

elasticsearch connection refused error

I am following this article to install and configure elasticsearch on my system, both the installation and configuration worked fine but when i try to run elasticsearch:
curl -X GET 'http://localhost:9200'
i get this error:
curl: (7) Failed to connect to localhost port 9200: Connection refused
EDIT: 1
after #val suggestion:
sudo systemctl status elasticsearch
it returned as:
elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendo
Active: failed (Result: exit-code) since Wed 2017-05-24 09:11:16 IST; 2h 17mi
Docs: http://www.elastic.co
Process: 5043 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DI
Process: 5039 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-
Main PID: 5043 (code=exited, status=1/FAILURE)
May 24 09:11:16 ahmed-pc systemd[1]: Starting Elasticsearch...
May 24 09:11:16 ahmed-pc systemd[1]: Started Elasticsearch.
May 24 09:11:16 ahmed-pc systemd[1]: elasticsearch.service: Main process exited,
May 24 09:11:16 ahmed-pc systemd[1]: elasticsearch.service: Unit entered failed
May 24 09:11:16 ahmed-pc systemd[1]: elasticsearch.service: Failed with result '
lines 1-13/13 (END)
Edit 2:
journalctrl -f results
May 25 08:35:31 ahmed-pc systemd[1]: Starting Elasticsearch...
May 25 08:35:31 ahmed-pc systemd[1]: Started Elasticsearch.
May 25 08:35:31 ahmed-pc sudo[6256]: pam_unix(sudo:session): session closed for user root
May 25 08:35:42 ahmed-pc dhclient[3644]: DHCPREQUEST of 192.168.43.121 on wlp3s0 to 192.168.43.1 port 67 (xid=0x4be71b5a)
May 25 08:35:42 ahmed-pc dhclient[3644]: DHCPACK of 192.168.43.121 from 192.168.43.1
May 25 08:35:42 ahmed-pc dhclient[3644]: bound to 192.168.43.121 -- renewal in 1339 seconds.
May 25 08:35:43 ahmed-pc systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
May 25 08:35:43 ahmed-pc systemd[1]: elasticsearch.service: Unit entered failed state.
May 25 08:35:43 ahmed-pc systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

Resources