下载Elasticsearch和Kibana镜像
docker pull elastic/elasticsearch:8.8.2
docker pull elastic/kibana:8.8.2
2. 设置max_map_count
windows:
wsl -d docker-desktop
sysctl -w vm.max_map_count=262144
exit
linux:
cat /proc/sys/vm/max_map_count
sysctl -w vm.max_map_count=262144
为Elasticsearch和Kibana创建docker网络
docker network create elastic
4. 创建映射文件夹并设置最高权限 windows: E:\AI\ElasticSearch-Langchain-Chatglm2-main\data\es E:\AI\ElasticSearch-Langchain-Chatglm2-main\data\es\data E:\AI\ElasticSearch-Langchain-Chatglm2-main\data\es\logs E:\AI\ElasticSearch-Langchain-Chatglm2-main\data\es\pluginslinux:
mkdir /data/es
chmod 777 -R /data/es/
4. 启动ES镜像 windows: docker run --name es01 --net elastic -p 9200:9200 -v E:/AI/ElasticSearch-Langchain-Chatglm2-main/data/es/data:/usr/share/elasticsearch/data -v E:/AI/ElasticSearch-Langchain-Chatglm2-main/data/es/logs:/usr/share/elasticsearch/logs -v E:/AI/ElasticSearch-Langchain-Chatglm2-main/data/es/plugins:/usr/share/elasticsearch/plugins -it elastic/elasticsearch:8.8.2linux:docker run --name es01 \ --net elastic -p 9200:9200 \ -v /data/es/data:/usr/share/elasticsearch/data \ -v /data/es/logs:/usr/share/elasticsearch/logs \ -v /data/es/plugins:/usr/share/elasticsearch/plugins \ -it elastic/elasticsearch:8.8.2这时会生成一个elastic账户的密码和一个Kibana的enrollment token5.启动kibana镜像
docker run --name kib-01 --net elastic -p 5601:5601 elastic/kibana:8.8.2
其他命令取出证书
docker cp es01:/usr/share/elasticsearch/config/certs/http_ca.crt
重置密码
docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
重置kibana token
docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
docker run --name es01 --net elastic -p 9200:9200 -v E:/AI/ElasticSearch-Langchain-Chatglm2-main/data/es/data:/usr/share/elasticsearch/data -v E:/AI/ElasticSearch-Langchain-Chatglm2-main/data/es/logs:/usr/share/elasticsearch/logs -v E:/AI/ElasticSearch-Langchain-Chatglm2-main/data/es/plugins:/usr/share/elasticsearch/plugins -it elastic/elasticsearch:8.8.2
中文kibana
cd /usr/share/kibana/config/
echo "i18n.locale: zh-CN" >> config/kibana.yml
重启
InsecureRequestWarning: Unverified HTTPS request is being made to host '127.0.0.1'. Adding certificate verification is strongly advised.报错
加上https