Make sure ulimit -n is set to a high enough number (currently, experimenting with 1000000)
To do so check/edit /etc/security/limits.conf
.
You can ignore this kind of exceptions
java.io.IOException: Unable to close file because the last block does not have enough number of replicas.
File could only be replicated to 0 nodes instead of minReplication (=1). There are 4 datanode(s) running and no node(s) are excluded in this operation.
Assuming the workload succeeds with less data, most probably you are running out of space.