head插件安装(es可视化界面)官方下载地址:https://www.elastic.co/cn/downloads/elasticsearch
Ik分词器安装github地址:https://github.com/mobz/elasticsearch-head
Windows版本安装 1、安装Es 1.1 下载es安装包,版本:7.15.2 1.2 修改es配置,以便能够正确使用插件(解决跨域问题)github地址:https://github.com/medcl/elasticsearch-analysis-ik
# cd D:elasticsearches7.15.2config # vim elasticsearch.yml # 添加两行配置 http.cors.enabled: true http.cors.allow-origin: "*"1.3 配置es环境变量 1.4 启动
# cd D:elasticsearches7.15.2bin # 双击 elasticsearch.bat
PS: es7是自带java11版本的,可能与本地java版本发生冲突,可在elasticsearch.bat文件中做兼容处理
# cd D:elasticsearches7.15.2bin # 7.15.2 替换成你自己的es的版本号,两处都要替换 # elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.15.2/elasticsearch-analysis-ik-7.15.2.zipLinux安装 1、安装Es 1.1 下载es安装包,版本:7.15.2 1.2 安装步骤
# 将下载好的文件上传到服务器 # cd /use/local # tar -zxvf elasticsearch-7.15.2-linux-x86_64.tar.gz # 创建新用户(es不能使用root用户启动) # groupadd els # useradd els -g els -p 密码 # 更新权限 # chown -R els:els elasticsearch-7.15.2 # 启动 # su els # ./elasticsearch-7.15.2/bin/elasticsearch # 错误一:内存过大 解决方法: # vim usr/local/elasticsearch-7.15.2/config/jvm.options # 新增两行(根据系统内容自行定义大小):-Xms512m -Xms512m1.3 解决外网无法访问问题
1.3.1 开启服务器白名单
1.3.2 防火墙放行9200端口
1.3.3 云服务器上安装 Elasticsearch7.x,外网无法通过 ip:9200 访问?
本地可访问:
进入/usr/local/elasticsearch-7.15.2/config目录,编辑elasticsearch.yml文件,打开并设置host和port,然后重启
继续报错:
ERROR: [3] bootstrap checks failed. You must address the points described in the following [3] lines before starting Elasticsearch.
bootstrap check failure [1] of [3]: initial heap size [268435456] not equal to maximum heap size [482344960]; this can cause resize pauses
bootstrap check failure [2] of [3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
# vim /etc/sysctl.conf # 添加配置 vm.max_map_count=655360 # 内核配置立即生效 # sysctl -p
继续报错:
ERROR: [2] bootstrap checks failed. You must address the points described in the following [2] lines before starting Elasticsearch.
bootstrap check failure [1] of [2]: initial heap size [268435456] not equal to maximum heap size [482344960]; this can cause resize pauses
bootstrap check failure [2] of [2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
ERROR: Elasticsearch did not exit normally - check the logs at /usr/local/elasticsearch-7.15.2/logs/elasticsearch.log
# cd /usr/local/elasticsearch-7.15.2/config # vim elasticsearch.yml # 打开 node.name: node-1 注释 # 打开 cluster.initial_master_nodes: ["node-1"] 注释,去掉里面的“node-2”1.4 修改es配置,以便能够正确使用插件(解决跨域问题)
# vim elasticsearch.yml # 添加两行配置 http.cors.enabled: true http.cors.allow-origin: "*"
大功告成
# cd /usr/local/elasticsearch-7.15.2/bin # 注意下载的版本必须与es版本相同 # ./elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.15.2/elasticsearch-analysis-ik-7.15.2.zip3、安装head
作用:es可视化管理界面
前提:安装好npm和node环境,可参考我的文章Npm、Node安装
# git clone git://github.com/mobz/elasticsearch-head.git # cd elasticsearch-head # 执行失败,可尝试使用淘宝镜像 # npm install # npm run start # 访问 http://localhost:9100
大功告成:



