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

相关推荐
DeeplyMind44 分钟前
第23章 ROCm虚拟化栈Docker化实战
运维·docker·容器
hhhjjjj1 小时前
docker安装与使用
docker
吹牛不交税2 小时前
.netcore项目部署在ubuntu22.04虚拟机的docker中的过程记录
docker·容器·.netcore
谢斯4 小时前
[AFFine]文档系统,docker搭建
运维·docker·容器
qq_297815274 小时前
Docker Compose 部署 RocketMQ 5.4.0 完整指南(Windows Docker Desktop 专属)
windows·docker·rocketmq
小义_6 小时前
【Docker】知识八
linux·docker·云原生
生瓜硬劈..7 小时前
从写入到可查:Elasticsearch “近实时”查询原理详解
大数据·elasticsearch·搜索引擎
礼拜天没时间.9 小时前
Docker Registry私有仓库搭建与使用
java·运维·docker·云原生·容器·centos
zhu620197610 小时前
Postgres数据库docker快速安装
数据库·docker·容器
Elasticsearch10 小时前
使用 Elasticsearch 和神经模型为复杂语言提供更好的文本分析
elasticsearch