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

相关推荐
70asunflower2 小时前
用Docker创建不同的容器类型
运维·docker·容器
小Pawn爷3 小时前
3.Dockerfile
docker
CodeGolang3 小时前
Docker容器化部署Zabbix监控系统完整指南
docker·容器·zabbix
星辰_mya3 小时前
Elasticsearch线上问题之OOM
大数据·elasticsearch·搜索引擎
忆~遂愿3 小时前
Runtime 上下文管理:计算实例的生命周期、延迟最小化与上下文切换优化
java·大数据·开发语言·人工智能·docker
Elastic 中国社区官方博客3 小时前
使用 Groq 与 Elasticsearch 进行智能查询
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
张彦峰ZYF4 小时前
一套「策略化 Elasticsearch 召回平台」架构设计思路
大数据·elasticsearch·搜索引擎
lpruoyu14 小时前
【Docker进阶-03】存储原理
docker·容器
文静小土豆14 小时前
Docker 与 containerd 代理配置详解:镜像拉取速度慢的终极解决方案
运维·docker·容器
JY.yuyu16 小时前
Docker常用命令——数据卷管理 / 端口映射 / 容器互联
运维·docker·容器