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、测试

相关推荐
Ha_To3 小时前
2026.1.28 docker安装
运维·docker·容器
北极熊~~4 小时前
emqx持久化 Docker 容器中生成的数据并打包新镜像,迁移至新机器运行
运维·docker·容器
tomiatomia4 小时前
MinIO docker 部署使用的几个坑
运维·docker·容器
杨浦老苏6 小时前
Docker方式安装你的私人AI电脑助手Moltbot
人工智能·docker·ai·群晖
x70x806 小时前
# Docker 搭建 MySQL 8 主从复制(踩坑实录 + 完整验证)
mysql·docker·容器
qq_316837756 小时前
docker 运行 cn_clip
运维·docker·容器
洛阳纸贵6 小时前
JAVA高级工程师--Elasticsearch安装以及内置分词器、IK分词器
大数据·elasticsearch·搜索引擎
Howie Zphile7 小时前
Git 拉 NocoBase 2.0 beta(next 分支),并“每天自动更新 + 自动编译 + 自动重启”
大数据·git·elasticsearch
历程里程碑7 小时前
子串----和为K的子数组
大数据·python·算法·leetcode·elasticsearch·搜索引擎·哈希算法
木卫二号Coding8 小时前
Docker-构建自己的Web-Linux系统-Ubuntu:22.04
linux·前端·docker