启动的时候报以下错误

docker-compos.yml配置

 es1:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.5.2
#    sysctls:
#      - vm.max_map_count=262144
    container_name: es01
    environment:
      - node.name=es01
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es02,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - "9201:9200"
      - "9301:9300"
  es2:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.5.2
#    sysctls:
#      - vm.max_map_count=262144
    container_name: es02
    environment:
      - node.name=es02
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - "9202:9200"
      - "9302:9300"
  es3:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.5.2
#    sysctls:
#      - vm.max_map_count=262144
    container_name: es03
    environment:
      - node.name=es03
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es02
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - "9203:9200"
      - "9303:9300"

es03       | ERROR: [1] bootstrap checks failed
es03       | [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
es03       | {"type": "server", "timestamp": "2021-12-11T11:13:50,536Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "es-docker-cluster", "node.name": "es03", "message": "stopping ..." }
es03       | {"type": "server", "timestamp": "2021-12-11T11:13:50,604Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "es-docker-cluster", "node.name": "es03", "message": "stopped" }
es03       | {"type": "server", "timestamp": "2021-12-11T11:13:50,604Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "es-docker-cluster", "node.name": "es03", "message": "closing ..." }
es03       | {"type": "server", "timestamp": "2021-12-11T11:13:50,651Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "es-docker-cluster", "node.name": "es03", "message": "closed" }
es03       | {"type": "server", "timestamp": "2021-12-11T11:13:50,659Z", "level": "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name": "es-docker-cluster", "node.name": "es03", "message": "Native controller process has stopped - no new native processes can be started" }
es01 exited with code 78
es03 exited with code 78

解决办法:

输入以下命令

wsl -d docker-desktop
sysctl -w vm.max_map_count=262144

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐