I would think that others are likely to try this, so if that version shouldn't be used, perhaps a blog post or some such is in order? I'll try the latest from packages.elastic.co next (probably tomorrow morning).
Now I followed the instructions, again from a fresh install of Ubuntu 16.04. Still no success:
root@rubix2:~# dpkg -l elasticsearch
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii elasticsearch 2.3.2 all Elasticsearch is a distributed RE
root@rubix2:~# /bin/systemctl daemon-reload
root@rubix2:~# /bin/systemctl enable elasticsearch
Synchronizing state of elasticsearch.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable elasticsearch
root@rubix2:~# curl http://localhost:9200/
curl: (7) Failed to connect to localhost port 9200: Connection refused
root@rubix2:~# sleep 10
root@rubix2:~# curl http://localhost:9200/
curl: (7) Failed to connect to localhost port 9200: Connection refused
root@rubix2:/usr/share/elasticsearch# ls /etc/elasticsearch/
elasticsearch.yml logging.yml scripts
root@rubix2:/usr/share/elasticsearch# ls
bin lib modules NOTICE.txt plugins README.textile
root@rubix2:/usr/share/elasticsearch# bin/elasticsearch
Exception in thread "main" ElasticsearchException[Failed to load logging configuration]; nested: NoSuchFileException[/usr/share/elasticsearch/config];
Likely root cause: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/config
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
at java.nio.file.Files.readAttributes(Files.java:1737)
at java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:225)
at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:322)
at java.nio.file.Files.walkFileTree(Files.java:2662)
at org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(LogConfigurator.java:142)
at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:103)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:243)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
The int script does work, but only after you enable it in systemd (in disabled/bad state it doesn't use the sysv wrapper).
root@xenial-sandbox:~# systemctl enable elasticsearch
elasticsearch.service is not a native service, redirecting to 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).
root@xenial-sandbox:~# systemctl start elasticsearch
root@xenial-sandbox:~# systemctl status elasticsearch
β elasticsearch.service - LSB: Starts elasticsearch
Loaded: loaded (/etc/init.d/elasticsearch; bad; vendor preset: enabled)
Active: active (running) since Thu 2016-05-26 10:26:36 CEST; 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 1528 ExecStart=/etc/init.d/elasticsearch start (code=exited, status=0/SUCCESS)
Tasks: 29 (limit: 512)
Memory: 213.0M
CPU: 4.960s
CGroup: /system.slice/elasticsearch.service
ββ1560 /usr/bin/java -Xms256m -Xmx1g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMe
Edit: the 1.7.3 init script refuses to work, i copied the one from the 2.3.1 package, which does.
Edit2: just upgraded systemd to 229-4ubuntu6 and now both init scripts are "broken".
It seems that to get Elasticsearch to run on 16.04 you have to set START_DAEMON to true on /etc/default/elasticsearch. It comes commented out by default, and uncommenting it makes Elasticsearch start again just fine.
Be sure to use systemctl restart instead of just start because the service is started right after installation, and apparently there's some socket/pidfile/something that systemd keeps that must be released before being able to start the service again --- I didn't bother to track that down, feel free to look for it
Here's a sample Vagrantfile for it:
Vagrant.configure(2) do |config|
config.vm.box = 'ubuntu/xenial64'
config.vm.provision 'shell', inline: <<-SHELL
sudo apt-get update
sudo apt-get install elasticsearch -y
sudo sed -i 's/#START_DAEMON/START_DAEMON/' /etc/default/elasticsearch
sudo systemctl restart elasticsearch
systemctl status elasticsearch
SHELL
end
This was a pain to trouble shoot. Thanks fcoelho. All my other installs and versions were fine was specific to this apt-get package that it just, no logs, no nothing, said was active, etc, so seemed normal.
I'd like my hour back. How can this possibly not be fixed yet? Your default install on probably your most popular platform fails with no error message and no logs. It hardly inspires faith in the platform.
I just tried the documented method of install and things started without a problem - I only needed to adjust the default heap use cause my VM was small.
If you can provide details on what is happening we can work to fix it, simply saying it's broken makes that very difficult.
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.