Elasticsearch(엘라스틱서치) bootstrap check failed 해결

2021. 11. 1. 17:45Information Technology/Elastic

 

Elasticsearch(엘라스틱서치)를 테스트 환경이 아닌 운영에서 실행 할때 Bootstrap check를 실시하게 된다. 

 

elasticsearch.yml > network.host: "site" 지정 하면 외부로 서비스가 되면서 bootstrap이 발동하고 > 에러가 발생하게 된다.

 

 

자주 만나게 되는 체크 항목은 아래와 같다.

 

1) max file descriptors

2) max virtual memory areas

3) [1] of [1]: memory locking requested for elasticsearch process but memory is not locked

ERROR: [2] bootstrap checks failed. You must address the points described in the following [2] lines before starting Elasticsearch.
bootstrap check failure [1] of [2]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
bootstrap check failure [2] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /home/server1/elasticsearch-7.15.0/logs/es-cluster.log

 

3가지 Boostrap check의 해결 방법을 살펴보자.

 

1) max file descriptors

  • sudo vi /etc/security/limits.conf > server1 - nofile 65535 설정
  • server1은 자새

 

  • id 커맨드로 사용자(user) 확인

 

File Descriptors | Elasticsearch Guide [7.15] | Elastic

This is only relevant for Linux and macOS and can be safely ignored if running Elasticsearch on Windows. On Windows that JVM uses an API limited only by available resources.

www.elastic.co

 

만약 sudo vi /etc/security/limits.conf > server1 - nofile 65535 설정을 해도 open files의 값이 변경이 안될 때는 Ubuntu OS의 버그일 수도 있다. 그럴 땐 아래와 같이 설정을 해주고 다시 시도해 본다.
Edit /etc/systemd/user.conf for the soft limit, and add DefaultLimitNOFILE=1048576.
Edit /etc/systemd/system.conf for the soft limit, and add DefaultLimitNOFILE=2097152.

- 참고문서: https://unix.stackexchange.com/questions/366352/etc-security-limits-conf-not-applied

 

/etc/security/limits.conf not applied

I have /etc/security/limits.conf, that seems not been applied: a soft nofile 1048576 # default: 1024 a hard nofile 2097152 a soft noproc 262144 # default 128039 a hard noproc 524288 Where a is...

unix.stackexchange.com

 

2) max virtual memory areas

3) [1] of [1]: memory locking requested for elasticsearch process but memory is not locked

  • sudo vi /etc/security/limits.conf 
  • server1 soft memlock unlimited / server1  hard memlock unlimited 설정

 

 

 

1 2 3