elasticsearch安装:
1.选定版本从官网下载
https://www.elastic.co/cn/downloads/enterprise-search
2.解压修改配置文件
tar xvf elasticsearch-6.4.0.tar.gz
vi elasticsearch-6.4.0/config/elasticsearch.yml
如果需要外网访问,设置 network.host:XX.XX.XX.XX
http.port:9200
末尾加上配置
http.cors.enabled: true
http.cors.allow-origin: "*"
3.新增es启动用户
启动时如果报错can not run elasticsearch as root则说明你使用的root用户启动es,这是被es所禁止的
adduser es
设置密码之后,切换到root用户为刚刚新建的es用户赋予操作es的权限
3.1增加权限
chown -R es elasticsearch-6.4.0/
3.2修改文件打开数配置
出现报错:max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
找到文件 /etc/security/limits.conf,编辑,在文件的最后追加如下配置:
es soft nofile 65535
es hard nofile 65537
3.3修改虚拟机最大内存
出现报