docker安装Elasticsearch8.2.3

生成镜像:
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.2.3

启动镜像:

 docker run --name es -p 9200:9200 -p 9300:9300 -it docker.elastic.co/elasticsearch/elasticsearch:8.2.3

启动时报:

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

vm.max_map_count内存太小了    所以 需要修改vm.max_map_count的内存大小

解决方法:

vim /etc/sysctl.conf

docker安装Elasticsearch8.2.3_第1张图片

 修改大小后输入命令:sysctl -p 启用

 注意:启动镜像成功时把下面的拷贝下来存好

docker安装Elasticsearch8.2.3_第2张图片

浏览器输入:http://XX.XX.XX.XX:9200/ 

{"@timestamp":"2022-12-29T08:30:08.964Z", "log.level": "WARN", "message":"received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/XXX, remoteAddress=/XXXXX:53388}", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"elasticsearch[83cf48448ebc][transport_worker][T#1]","log.logger":"org.elasticsearch.xpack.security.transport.netty4.SecurityNetty4HttpServerTransport","elasticsearch.cluster.uuid":"XX","elasticsearch.node.id":"XXX","elasticsearch.node.name":"83cf48448ebc","elasticsearch.cluster.name":"docker-cluster"}

报这样的错误是因为es8默认开启ssl认证,按照下面的改成false 重启即可:

进入es的docker:docker exec -it es bash

vim /usr/share/elasticsearch/config/elasticsearch.yml

docker安装Elasticsearch8.2.3_第3张图片

E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)

这是没有权限
最后解决办法是进入docker容器的时候多加入 -u 0 就可以解决,如下:

[root@iZ1hgjcoofovz6Z jenkins]# docker exec -it -u 0 d8b93fc26911 /bin/bash

重设密码:elasticsearch/bin/elasticsearch-reset-password -u elastic -i

docker安装Elasticsearch8.2.3_第4张图片

 浏览器输入:http://XX.XX.XX.XX:9200/  填写账号密码就可以了

你可能感兴趣的:(es,elasticsearch,大数据)