docker版Elasticsearch安装,ik分词器安装,用户名密码配置,kibana安装

1、安装es和ik分词器

创建映射目录并赋予权限:

shell 复制代码
mkdir -p /docker_data/elasticsearch/conf
mkdir -p /docker_data/elasticsearch/data
mkdir -p /docker_data/elasticsearch/plugins
chmod -R 777 /docker_data/elasticsearch

编写配置文件:

shell 复制代码
vi /docker_data/elasticsearch/conf/elasticsearch.yml
yaml 复制代码
http.host: 0.0.0.0
xpack.security.enabled: true

上传ik分词器并解压至/docker_data/elasticsearch/plugins/ik

下载地址:https://gitcode.com/medcl/elasticsearch-analysis-ik/tags

运行es

shell 复制代码
docker run --name elasticsearch --restart=always \
-p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms128m -Xmx256m" \
-v /docker_data/elasticsearch/conf/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /docker_data/elasticsearch/data:/usr/share/elasticsearch/data \
-v /docker_data/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:6.5.0

进入容器内,配置用户名密码:

shell 复制代码
docker exec -it elasticsearch /bin/bash
./bin/elasticsearch-setup-passwords interactive

2、安装kibana

shell 复制代码
mkdir -p /docker_data/kibana/config

编写配置文件:

shell 复制代码
vi /docker_data/kibana/conf/kibana.yml
yaml 复制代码
---
# Default Kibana configuration from kibana-docker.

server.name: kibana
server.host: "0"
elasticsearch.url: http://192.168.0.114:9200
xpack.monitoring.ui.container.elasticsearch.enabled: true

# 用户密码
elasticsearch.username: "elastic"  
elasticsearch.password: "你设置的密码"
shell 复制代码
http.host: 0.0.0.0
xpack.security.enabled: true

运行kibana:

shell 复制代码
docker run -d --name kibana --restart=always -p 5601:5601 -v /docker_data/kibana/config:/usr/share/kibana/config docker.elastic.co/kibana/kibana:6.5.0

3、测试

相关推荐
xinyu3911 小时前
旧版Ubuntu Docker镜像 apt 失败
linux·ubuntu·docker
bin91532 小时前
使用Docker安装github项目 源码中含有 docker-compose.yml
docker·eureka·github
weixin_307779133 小时前
Linux下Docker Compose里运行Milvus向量数据库故障诊断Shell脚本
linux·运维·数据库·docker·milvus
SuperherRo3 小时前
云上攻防-云原生篇&Docker安全&Dockfile文件构建制作&不安全的镜像&不安全第三方组件
docker·dockerfile·不安全镜像·第三方组件
布局呆星3 小时前
Git基础操作:从本地提交到远程仓库
大数据·elasticsearch·搜索引擎
Elasticsearch3 小时前
那块从未唤醒的磁盘:究竟是什么决定了我们的 Qdrant 向量搜索基准测试重新对决的结果
elasticsearch
Zhu7583 小时前
在Docker环境部署ApacheGuacamole,对接MySQL数据库
运维·docker·容器
爱学习的小可爱卢16 小时前
Git全解析(2W+长文):从原理到高频操作手册
大数据·elasticsearch·搜索引擎
LitchiCheng21 小时前
DGX Spark部署Isaac Sim(一键安装脚本)
大数据·elasticsearch·spark
极客先躯1 天前
高级java每日一道面试题-2026年04月05日-实战篇[Docker]-如何排查容器 OOM 的问题?
java·运维·docker·容器·内存溢出·高级面试