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

相关推荐
tryCbest2 小时前
CentOS部署Docker容器
linux·docker·centos
菠萝炒饭pineapple-boss2 小时前
单机让多docker拥有多ip出口
docker
007php0074 小时前
百度面试题解析:微服务架构、Dubbo、Redis及其一致性问题(一)
redis·百度·docker·微服务·容器·职场和发展·架构
言之。5 小时前
大模型嵌入 vs ES:语义搜索与关键字搜索
大数据·elasticsearch·搜索引擎
阑梦清川6 小时前
es的docker部署和docker相关的可可视化面板工具介绍
大数据·elasticsearch·docker
Mr_LiYYD8 小时前
elasticsearch数据迁移
大数据·elasticsearch·搜索引擎
我狸才不是赔钱货8 小时前
容器:软件世界的标准集装箱
linux·运维·c++·docker·容器
dalianwawatou8 小时前
GitLab 代码基础操作清单
大数据·elasticsearch·gitlab
阑梦清川9 小时前
docker入门教程--部署nginx和tomcat
nginx·docker·tomcat
安卓开发者10 小时前
Docker命令大全:从入门到精通
docker·容器·eureka