【ES】elasticsearch8.3.3

这里仅实践操作并根据实际问题进行记录笔记。

运行 ES8

我们需要在自己的电脑上安装好 Docker Desktop。接着我们运行如下的命令:出现两个异常,一个是需要使用winpty因为我使用win的docker desktop,另外一个问题是docker启动elasticsearchERROR: Elasticsearch did not exit normally - check the logs at xxx。解决办法:在运行命令中添加 -e "discovery.type=single-node"。最终运行命令

shell 复制代码
$ docker network create elastic
$ docker pull docker.elastic.co/elasticsearch/elasticsearch:8.3.3
winpty docker run  -e ES_JAVA_OPTS="-Xms1024m -Xmx1024m" -e "discovery.type=single-node" --name es-node01 --net elastic -p 9200:9200 -p 9300:9300 -it docker.elastic.co/elasticsearch/elasticsearch:8.3.3

$ docker logs es-node01 -f --tail 1000

$ docker pull docker.elastic.co/kibana/kibana:8.3.3
$ winpty docker run --name kib-01 --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:8.3.3

最后显示图,如下:

验证访问

shell 复制代码
$ docker cp es-node01:/usr/share/elasticsearch/config/certs/http_ca.crt .
$ curl -X GET --cacert ./http_ca.crt -u elastic:8-u-CiRMc1FgM8k*fNRY https://localhost:9200/

{
  "name" : "80785c9c7f2e",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "yfxAwhuwSdiAXYgrXSfp-Q",
  "version" : {
    "number" : "8.3.3",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "801fed82df74dbe537f89b71b098ccaff88d2c56",
    "build_date" : "2022-07-23T19:30:09.227964828Z",
    "build_snapshot" : false,
    "lucene_version" : "9.2.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

安装 IK

复制代码
sh-5.0$ cd /usr/share/elasticsearch/
sh-5.0$ ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v8.3.3/elasticsearch-analysis-ik-8.3.3.zip^C
sh-5.0$ pwd
/usr/share/elasticsearch
sh-5.0$ ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v8.3.3/elasticsearch-analysis-ik-8.3.3.zip
-> Installing https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v8.3.3/elasticsearch-analysis-ik-8.3.3.zip
-> Downloading https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v8.3.3/elasticsearch-analysis-ik-8.3.3.zip
[=================================================] 100%??
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.net.SocketPermission * connect,resolve
See https://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
-> Installed analysis-ik
-> Please restart Elasticsearch to activate any plugins installed

sh-5.0$ ./bin/elasticsearch-plugin list
analysis-ik

上面的命令显示我们的 IK 已经安装成功了。
这个时候需要我们重新启动一下我们的 Elasticsearch,以便这个 plugin 能装被加载。

验证访问

安装后没有重启

正确应该是

安装 KIB

验证访问

访问地址:http://localhost:5601

访问账号:elastic

访问密码:8-u-CiRMc1FgM8k*fNRY

首次验证:569 587 (KIB后台打印)

首次token:eyJ2ZXIiOiI4LjMuMyIsImFkciI6WyIxNzIuMjMuMC4yOjkyMDAiXSwiZmdyIjoiMGU3MDAzMmVlMjMxMzAyODA5ZWQ1MTg2YjI2ZjA1ZmEyODE5NzkwMTdiZjg4NGY3Nzc2NzIzZTBlNWM0MmEyNSIsImtleSI6IkF1QnZSWW9CTWRwSnl4VVZQYmowOjRPUG9lMlI0UjNlWXFLZGtmRHUyNlEifQ==




辅助参考

Elastic:开发者上手指南
Elasticsearch:使用 Docker compose 来一键部署 Elastic Stack 8.x
ElasticSearch
IK Analysis for Elasticsearch
elasticsearch-analysis-ik

相关推荐
ofoxcoding12 小时前
借助 CLAUDE.md 约束 Sonnet 5.5 多文件重构行为的提示词实践
大数据·elasticsearch·ai·重构
Elasticsearch12 小时前
隆重推出 AlertZero:让你的告警队列实现 “收件箱清零” 式管理
elasticsearch
ly768913 小时前
从 TF-IDF 到 BM25:Elasticsearch 相关性评分的字段长度归一化与 boost 调参边界
java·elasticsearch·query dsl·bm25·相关性评分
SL-staff13 小时前
技术实践:将Excel自动升级为可搜索的知识节点(JVS平台实现)
mongodb·elasticsearch·知识图谱·jvs平台·语义解析·企业文档管理·excel结构化
Elasticsearch13 小时前
2026 年唯一获得端点预防与响应(EPR)满分的厂商是 Elastic
elasticsearch
vx_Biye_Design13 小时前
springboot旅游管理系统18006-计算机课程设计、毕业设计
java·spring boot·后端·python·elasticsearch·django·课程设计
ly76891 天前
倒排索引与 FST 在 Lucene 中的内存布局:segment、docValues 与词典压缩的工程取舍
elasticsearch·lucene·倒排索引·doc values·fst
Elasticsearch1 天前
利用预计算上下文,更快速、更低成本地开展支持问题调查
elasticsearch
小小小米粒1 天前
重置本地git
大数据·git·elasticsearch
ly76891 天前
Spring Boot 集成 Elasticsearch 的生产实践:客户端选型、索引生命周期与批量写入容错
spring boot·elasticsearch·索引生命周期·java api client·批量写入