Elasticsearch入门安装

1、下载安装

(1)安装Elasticsearch

下载地址:https://www.elastic.co/cn/downloads/elasticsearch

解压后运行 /bin/elasticsearch.bat

运行后访问 http://127.0.0.1:9200/即可

ps1:若无法访问且控制台打印

复制代码
received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/127.0.0.1:9200, remoteAddress=/127.0.0.1:54622}

原因是高版本Elasticsearch在Windows下开启了安全认证。

修改配置文件 /config/elasticsearch.yml中两处:

复制代码
xpack.security.enabled: false
xpack.security.http.ssl:
  enabled: false

ps2:低版本es对jdk有要求,高版本8.+会自动忽略本地环境不合适的jdk

ps3:低版本没有自带ingest-attachment插件,需要使用文件检索时,需要到安装目录下执行elasticsearch-plugin install ingest-attachment 安装

ps4:文件上传时定义文本抽取管道:

复制代码
PUT /_ingest/pipeline/attachment
{
    "description": "Extract attachment information",
    "processors": [
        {
            "attachment": {
                "field": "content",
                "ignore_missing": true
            }
        },
        {
            "remove": {
                "field": "content"
            }
        }
    ]
}

在 attachment 中指定要过滤的字段为 content,所以写入 es时需要将文档内容放在 content 字段。

比如文档:

复制代码
PUT /fileindex
{
  "mappings": {
    "properties": {
      "id":{
        "type": "keyword"
      },
      "name":{
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "type":{
        "type": "keyword"
      },
      "attachment": {
        "properties": {
          "content":{
            "type": "text"
          }
        }
      },
      "caseId":{
        "type": "text"
      },
      "caseArea":{
        "type": "text"
      },
      "caseName":{
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "caseType":{
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "startDate":{
        "type": "date"
      },
      "endDate":{
        "type": "date"
      },
      "signDate":{
        "type": "date"
      }
    }
  }
}

(2)安装分词器ik(按需)

下载地址:https://release.infinilabs.com/analysis-ik/stable/

解压到es目录/plugins下 ,重启es即可

2、安装elasticsearch-head

(1)安装nodejs

下载地址:https://nodejs.org/en/download/

cmd输入 node -v 命令,输出了版本号,则node安装成功。

(2)安装grunt

下载地址:CMD中执行 npm install -g grunt-cli

(3)安装

下载地址:elasticsearch-head

https://download.csdn.net/download/weixin_45003809/89510856

解压后进入安装目录,执行 npm install

再执行 npm run start 启动服务

即可通过 http://localhost:9100/ 访问

ps:如果无法发现ES节点,尝试在ES配置文件/config/elasticsearch.yml中配置允许跨域

http.cors.enabled: true

http.cors.allow-origin: "*"

3、安装kibana

下载地址:https://www.elastic.co/cn/downloads/past-releases#kibana

解压后运行 /bin/kibana.bat

ps1:

可以在配置文件 /config/kibana.yml 中更改语言
i18n.locale: "zh-CN"

相关推荐
sichuanwuyi5 小时前
Wydevops工具的价值分析
linux·微服务·架构·kubernetes·jenkins
秦拿希6 小时前
【paimon-trino】trino整合paimon元数据访问s3
大数据·trino·paimon
kuankeTech6 小时前
解决内外贸双轨制难题,外贸ERP智能引擎同步管理国内外合规与标准
大数据·人工智能·数据可视化·软件开发·erp
q_35488851537 小时前
AI大模型:python新能源汽车推荐系统 协同过滤推荐算法 Echarts可视化 Django框架 大数据毕业设计(源码+文档)✅
大数据·人工智能·python·机器学习·信息可视化·汽车·推荐算法
一只专注api接口开发的技术猿12 小时前
微服务架构下集成淘宝商品 API 的实践与思考
java·大数据·开发语言·数据库·微服务·架构
AC赳赳老秦12 小时前
Dify工作流+DeepSeek:运维自动化闭环(数据采集→报告生成)
android·大数据·运维·数据库·人工智能·golang·deepseek
明洞日记12 小时前
【软考每日一练009】计算机系统性能评价:基准程序分类与 TPC 实战案例详解
大数据·数据库
李慕婉学姐12 小时前
【开题答辩过程】以《基于Spring Boot和大数据的医院挂号系统的设计与实现》为例,不知道这个选题怎么做的,不知道这个选题怎么开题答辩的可以进来看看
大数据·spring boot·后端
汽车仪器仪表相关领域13 小时前
全程高温伴热,NOx瞬态精准捕捉:MEXA-1170HCLD加热型NOx测定装置项目实战全解
大数据·服务器·网络·人工智能·功能测试·单元测试·可用性测试