--下载有两个版本
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.2.tar.gz
--请选择一个
wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.4.0/elasticsearch-2.4.0.tar.gz
--解压缩
tar -zxvf elasticsearch-2.4.0.tar.gz
--启动
sh /usr/local/elasticsearch-2.4.0/bin/elasticsearch
如果出现内存不够 则改内存(使用5的版本)
由于elasticsearch5.0默认分配jvm空间大小为2g,修改jvm空间分配
不能使用root用户操作
useradd xxx
passwd xxx
chown -r xxx文件夹 (授权给某个用户)
常见的错误解决方案 :
https://blog.youkuaiyun.com/qq_21387171/article/details/53577115
补充说明(报权限不足 ,添加两行)
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
elasticsearch安装时遇到的错误
问题翻译过来就是:elasticsearch用户拥有的可创建文件描述的权限太低,至少需要65536;
解决办法:
#切换到root用户修改
vim /etc/security/limits.conf
# 在最后面追加下面内容
*** hard nofile 65536
*** soft nofile 65536
*** 是启动ES的用户
阿里云后台管理,开放9200 和9300
远程head 插件连接 (需要加跨域访问)
修改elasticsearch.yml,增加如下字段
http.cors.enabled: true
http.cors.allow-origin: "*"
cros为: Cross-origin resource sharing ,即跨域访问。
默认值为false,在elasticsearch安装集群之外的一台机上用head等监控插件访问elasticsearch是不允许的。这个字段最早1.4.x版本,而非5.x开始存在的。