By default, the maximum number of file handles in Linux is 1024. When your server reaches the limit of large concurrency, it will report "too many open files"
So how to view file handle data?
You can view it with the command:
root@hks03test:~# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 63712
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) 63712
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
So how to set the number of Linux file handles? (This is only a temporary solution, the original value will be restored after restarting)
ulimit -n 65535
Looking at open files again, it will be 65535, and the minimum standard for elasticsearch5.* is 65535
Permanently modify: vi /etc/security/limits.conf
root soft nofile 65535 root hard nofile 65535 * soft nofile 65535 * hard nofile 65535
After setting, re-login to the system to take effect.