一、安装elasticsearch-rtf
1.jdk 1.8 安装教程 :https://blog.csdn.net/weixin_36634753/article/details/101079873
2.下载elastisearch-rtf 加了中文搜索:https://github.com/TBirdsWR/elasticsearch-rtf (最好下载zip包)
3.上传服务器上解压 解压命令:unzip 包名
4.修改权限 chmod -R 755 包名
5.新建用户 用户组
groupadd es
useradd es -g es -p es
chown -R es:es es/elasticsearch-rtf
su es
6.修改属主chown -R 用户名:用户组 包名 (不能是root,因为elasticsearch启动不能用root用户)
7.如果内存不大,要修改config/jvm.options内存大小,512m
8.在root用户,编辑/etc/security/limits.conf添加类似如下内容
~ vim /etc/security/limits.conf
修改内容:* soft nofile 65536
9.然后重新登录一下用户输入ulimit -Hn
10.在切回root用户 vim /etc/sysctl.conf 在最后面添加
vm.max_map_count=262144
11. 查看是否修改成功sysctl -a|grep vm.max_map_count
12.修改外网访问权限 在/config/elasticsearch.yml添加下面配置
network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-methods: OPTIONS,HEAD,GET,POST,PUT,DELETE
http.cors.allow-headers: "X-Requested-With,Content-Type,Content-Length, X-User"
13.到bin下启动
14.访问上面红框里的地址(记得要添加端口号)
二、安装elasticsearch-head
1.下载搜索界面 https://github.com/TBirdsWR/elasticsearch-head
2.unzip 解压
需要使用node 先安装node
安装node教程https://blog.csdn.net/weixin_36634753/article/details/101079873
3.
然后切回刚才下载的elasticsearch-head 目录执行
npm install
npm run start
4.访问地址