注:本台虚拟机必须安装jdk环境(jdk要求1.8.20以上)
#上传es安装包并解压es
tar -zxvf elasticsearch-5.4.3.tar.gz -C /bigdata/
#修改配置
vi /bigdata/elasticsearch-5.4.3/config/elasticsearch.yml
#es绑定的ip地址
network.host: 192.168.10.16
#开启远程连接
编辑elasticsearch-5.4.3/config/elasticsearch.yml,加入以下内容:
http.cors.enabled: true
http.cors.allow-origin: "*"
#给elasticsearch相应的目录添加权限
chown -R ess:ess ./elasticsearch-5.4.3
#进入ess用户启动elasticsearch
elasticsearch-5.4.3/bin/elasticsearch -d
#出现错误
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
#修改错误
#用户最大可创建文件数太小
sudo vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
#查看可打开文件数量
ulimit -Hn
#最大虚拟内存太小
sudo vi /etc/sysctl.conf
vm.max_map_count=262144
#查看虚拟内存的大小
sudo sysctl -p
#重启linux
shutdown -r now
#通过浏览器访问ES
192.168.253.205:9200