1、安装JDK8
参考:Ubuntu 安装 JDK 7/JDK8 的两种方式
注:ElasticSearch 5.2.0需要JDK8,可以只装JDK8。
2、下载elasticsearch-5.2.0.tar.gz(http://download.csdn.net/detail/u014699309/9761796)
3、解压到/opt/elasticsearch-5.2.0
4、到/opt/elasticsearch-5.2.0/bin目录下运行:./elasticsearch -v
5、打开新的terminal,运行curl -X GET 'http://localhost:9200'应该可以成功查到默认信息
6、此时,只可以在本机访问ES,如果需要外网访问,按照网上找到的很多解决方法都不能成功,这一步花了我很长时间。
解决方法:
We've just patched the docs to explain a way to opt out that ought to work fine for you. It might take a while to build so here is a link to the fix: https://github.com/elastic/elasticsearch/pull/21220/files
Essentially, set http.host to the non-local IP while keeping network.host at its default. You can't form a cluster but you can test against a single node. If you want a cluster you'll need to make the bootstrap checks happy.
也就是说,只把http.host设置为本机ip,保留network.host为默认值。