코린이의 기록

[Elasticsearch] max file descriptors 4096 for elasticsearch process is too low increase to at least 65536 본문

ELK

[Elasticsearch] max file descriptors 4096 for elasticsearch process is too low increase to at least 65536

코린이예요 2019. 5. 2. 11:48
반응형

 


$ ulimit -Sa
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 31060
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 4096
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

 

설정 1.

$ sudo vi /etc/security/limits.conf

맨 아래에 아래 설정 추가

ec2-user hard nofile 65536 

ec2-user hard nofile 65536 

ec2-user hard nproc 65536  

ec2-user sort nproc 65536 

 

설정 2. 

$ sudo vi /etc/rc.local

맨 아래에 아래 설정 추가

echo 1048575 > /proc/sys/vm/max_map_count

 

설정 3.

$ sudo sysctl -w fs.file-max=262114

 

server 재시작

 


$ ulimit -Sa
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 31060
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 31060
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

 

 

 

혹시 위 설정에도 error가 발생한다면

elasticsearch/conf/elasticsearch.yml에서 network.host=localhost or network.host=127.0.0.1로 설정되었는지 확인한다.

 

참고 : https://ongamedev.tistory.com/entry/Elasticsearch-cluster-%EC%84%A4%EC%A0%95

반응형
Comments