Elasticsearch8.13.4版本的Docker启动关闭HTTPS

博主环境是:

开发环境:Springboot+ElasticSearch客户端对应的starter 2.6.3版本

maven配置

html 复制代码
        <!-- ElasticSearch -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
            <version>2.6.3</version>
        </dependency>

服务端ElasticSearch8.13.4运行在docker环境下,由此命令而来;

html 复制代码
docker run --name elasticsearch --net elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -t docker.elastic.co/elasticsearch/elasticsearch:8.13.4

docker run

--name elasticsearch

--net elastic

-p 9200:9200

-p 9300:9300

-e "discovery.type=single-node"

-t docker.elastic.co/elasticsearch/elasticsearch:8.13.4

关闭方式有两种

1.第一种:启动命令加个配置

复制代码
-e xpack.security.enabled=false

或者:

2.第二种:进入配置文件修改

进入容器修改配置文件。

进入容器前先获取root权限:-u 0就是docker进入容器前获取root权限的配置

html 复制代码
docker exec -it -u 0 elasticsearch /bin/bash

进入容器后先运行

html 复制代码
apt-get update

再运行下面命令安装vim。文本编辑器,不然你无法vim配置文件

html 复制代码
apt-get install vim

配置文件在**/usr/share/elasticsearch/config/elasticsearch.yml**

编辑:vim elasticsearch.yml,把true改为false

按esc,输入:wq 保存

**退出容器:**exit

输入docker ps找到容器编号:

输入docker restart [容器编号],重启ElasticSearch容器:

在此通过ES Java Api插入index,就不会报错了:

相关推荐
Elasticsearch1 天前
平衡尺度:利用权重使倒数排序融合 (RRF) 更加智能
elasticsearch
muyun28002 天前
Docker 下部署 Elasticsearch 8 并集成 Kibana 和 IK 分词器
elasticsearch·docker·容器
傻傻虎虎2 天前
【Docker】常用帮忙、镜像、容器、其他命令合集(2)
运维·docker·容器
在未来等你2 天前
Elasticsearch面试精讲 Day 17:查询性能调优实践
大数据·分布式·elasticsearch·搜索引擎·面试
ftpeak2 天前
从零开始使用 axum-server 构建 HTTP/HTTPS 服务
网络·http·https·rust·web·web app
00后程序员张2 天前
详细解析苹果iOS应用上架到App Store的完整步骤与指南
android·ios·小程序·https·uni-app·iphone·webview
2401_897930062 天前
使用Docker轻松部署Neo4j图数据库
数据库·docker·neo4j
LeeZhao@3 天前
【AI推理部署】Docker篇04—Docker自动构建镜像
人工智能·docker·容器
程思扬3 天前
利用JSONCrack与cpolar提升数据可视化及跨团队协作效率
网络·人工智能·经验分享·docker·信息可视化·容器·架构
落日漫游3 天前
dockercompose和k8s区别
docker·kubernetes