Difference between ulimit, lsof, cat /proc/sys/fs/file-max

I’ve been getting java.io.IOException: Too many open files while running a Kafka instance and using one topic with 1000 partitions so I started investigating the file descriptors limits in my ec2 vm. I cannot understand which is exactly the limit for open files on a Centos 7 machine since all the following commands produce different results. The commands are:

user ID less than 1000 on CentOS 7

I am now installing a new Linux server with CentOS-7. Before, I used CentOS-6 on all machines and used uid = 555 for my account. However, on CentOS-7, it seems that uid <= 999 are reserved for system (accoding to some articles on the net). For testing purpose, I have tried to make an account with uid = 555, such that