Need some help on how I can make apm-server keystore work. For some reason it will fail to initialize the file if is not owned by root.
root@apm-server:~# apm-server keystore list
error initializing beat: could not initialize the keystore: config file ("/var/lib/apm-server/apm-server.keystore") must be owned by the user identifier (uid=0) or root
root@apm-server:~# ll /var/lib/apm-server/
-rw------- 1 apm-server apm-server 402 Jan 6 05:42 apm-server.keystore
-rw------- 1 apm-server apm-server 0 Jan 7 05:28 apm-server.lock
-rw------- 1 apm-server apm-server 48 Jun 30 2021 meta.json
If I change the ownership as root, the apm-server service won't start at all and it shows this error on system logs.
Exiting: could not initialize the keystore: open /var/lib/apm-server/apm-server.keystore: permission denied
Please advise on how to properly set its permissions or configuration to make it work.