I have this error bash: ./metricbeat: cannot execute binary file: Exec format error

I suspect you may also have permissions issues on the logs paths

path.logs: /var/log/elasticsearch

Its seems that you may have a number of permission issues...

When you installed with apt did you do it as directed in the documents? As it shows here