在jvm.options 中加入:(/usr/local/elasticsearch/config/jvm.options)
-XX:+AssumeMP
如果是docker-compose,则
elasticsearch1:
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.3
restart: always
container_name: elasticsearch1
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms256m -Xmx256m -XX:+AssumeMP"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
mem_limit: 1g
cap_add:
- IPC_LOCK
volumes:
- esdata1:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- code-network