Checked the presence of Java and got the following versions
openjdk version "11.0.7" 2020-04-14 OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu218.04) OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing)
I think this is where something is going wrong. In the training video I am following, the trainer is getting java version "1.7.0_111" along with the above versions but I am not. Please advise if it is ok.
Added the package sudo dpkg -i elasticsearch-7.8.0-amd64.deb
Added some default values sudo update-rc.d elasticsearch defaults 95 10 Here the trainer got an output saying Adding system startup for but I did not get any output.
Finally, tried to start elasticsearch sudo /etc/init.d/elasticsearch start
but continuously getting this error
....] Starting elasticsearch (via systemctl): elasticsearch.serviceJob for elasticsearch.service failed because the control process exited with error code. See "systemctl status elasticsearch.service" and "journalctl -xe" for details. failed!
I have followed the tips offered in other threads like editing the nano text file and so on, but nothing worked. Please help me
Edit: I entered the yml file and did the following changes:
@prajwalgmpp
ES 7.8 requires JDK 1.8 or 11. systemctl status elasticsearch.service will show you that service was not started. So connection refused for curl is expected.
Can you post elasticsearch.yml and output of journalctl -u elasticsearch.service?
Also you should start service using sudo systemctl start elasticsearch.service.
The start is still failing with the below error even with 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.`
The output for journalctl -u elasticsearch.service is
Jul 13 12:17:29 ip-172-31-6-123 systemd[1]: Starting Elasticsearch...
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: output:
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: #
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: # There is insufficient memory for the Java Runtime Environment to continue.
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: # Native memory allocation (mmap) failed to map 1073741824 bytes for committing reserved memory.
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: # An error report file with more information is saved as:
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: # /var/log/elasticsearch/hs_err_pid22238.log
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: error:
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error='Not enough space' (errno=12)
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: at org.elasticsearch.tools.launchers.JvmErgonomics.flagsFinal(JvmErgonomics.java:126)
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: at org.elasticsearch.tools.launchers.JvmErgonomics.finalJvmOptions(JvmErgonomics.java:88)
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:59)
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:137)
Jul 13 12:17:31 ip-172-31-6-123 systemd-entrypoint[22108]: at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:95)
Jul 13 12:17:31 ip-172-31-6-123 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jul 13 12:17:31 ip-172-31-6-123 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jul 13 12:17:31 ip-172-31-6-123 systemd[1]: Failed to start Elasticsearch.
It appears that there is insufficient memory, but in /etc/elasticsearch/jvm.options it is showing as -Xms1g -Xmx1g
which is normal right?
Please advise.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.