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"

相关推荐
码海浮生10 分钟前
人工智能日报 每日AI新闻(2026年5月25日):Google I/O余波下的AI安全、多模态生成与搜索体验分化
大数据·人工智能·安全
dingzd9511 分钟前
Pinterest年度色彩发布后跨境内容团队如何统一视觉风格与选题方向
大数据·人工智能·新媒体运营·市场营销·跨境
多年小白20 分钟前
开盘策略】2026年5月28日(周四)
大数据·人工智能·物联网·金融·区块链
AI周红伟1 小时前
agent-skills 一键落地实操指南-运行指南-周红伟
大数据·人工智能·elasticsearch·搜索引擎
代码女神经1 小时前
用AI思维,重构供应链物流产品闭环
大数据·人工智能·重构
眷蓝天1 小时前
Jenkins部署与配置
运维·jenkins
计算机安禾2 小时前
【算法分析与设计】第13篇:最小生成树:Prim算法与Kruskal算法的比较研究
大数据·人工智能·算法
易观Analysys2 小时前
企业拥抱Agent行动指南——《重构与崛起——OpenClaw时代的中国Agent产业生态报告》解读四
大数据·人工智能
newsxun2 小时前
AI进入真实照护场景:添康加速构建智慧康养新能力
大数据·人工智能·物联网
m0_46644103詹湛3 小时前
定价的艺术
大数据·人工智能·ai·创业创新