ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • elasticsearch 5.1 관련 설정 변경 - max file descriptors, max_map_count
    프로그래밍/검색 2017. 5. 21. 17:16
    반응형





    elasticsearch를 시작하고 로그를 확인하니 아래 경고 메세지가 있어 

    관련 부분을 수정하고 기록으로 남겨둔다. 






    [2017-05-21T15:55:37,569][WARN ][o.e.b.BootstrapCheck     ] [BydL6N7] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

    [2017-05-21T15:55:37,569][WARN ][o.e.b.BootstrapCheck     ] [BydL6N7] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]






    max file descriptors 변경



    /etc/security/limits.conf 파일의 내용을 수정해야 한다. 

    nofile은 해당 사용자(그룹)이 오픈할 수 있는 최대 파일 개수를 의미한다.

    /etc/security/limits.conf 값은 새로운 session 부터 영향을 끼치기 때문에

    파일 설정을 변경하고 재로그인을하거나 새로운 세션으로 다시 접속하면

     해당 설정이 변경된 것을 확인할 수 있다.


    참고로 root user 는 * wildcard 에 속하지 않으니 

    root user   는 따로 설정해줘야한다.


    # 전체 user에게 같은 설정을 하려면 * 을 사용한다


    * hard nofile 70000

    * soft nofile 70000

    root hard nofile 70000

    root soft nofile 70000



    # 특정 user (예: mysql)에기만 설정을 하려면


    mysql hard nofile 70000

    mysql soft nofile 70000




    만약 설정을 변경하였는데 ulimit -a    해도 동일한 결과가 나온다면

    /etc/pam.d/su 의 아래 라인을 코멘트 아웃해야한다. 

    limits.conf   는  pam_limits.so가 사용하는 설정값이라 

    /etc/pam.d/su에서 사용되도록 설정되었는지 확인해야한다.



    # Sets up user limits, please uncomment and read /etc/security/limits.conf

    # to enable this functionality.

    # (Replaces the use of /etc/limits in old login)

    session    required   pam_limits.so





    vc.max_map_count 설정 변경



    /etc/sysctl.conf에서 vm.max_map_count=262144 라인을 추가한다. 

    현재 로그인된 시스템에서 설정을 변경하려면 아래 명령어를 사용한다. 

     

    sysctl -w vm.max_map_count=262144 







    The vm_map_max_count setting should be set permanently in /etc/sysctl.conf:


    vi /etc/sysctl.conf

    vm.max_map_count=262144



    -----



    sysctl -w vm.max_map_count=262144










    728x90
    반응형
Designed by Tistory.