I am deploying filebeat as Daemonset in Kubernetes through helm. But the pod is not coming up and the container is crashing with
k logs filebeat-filebeat-hd525 -n filebeat
{"log.level":"info","@timestamp":"2024-07-03T14:27:00.099Z","log.origin":{"file.name":"instance/beat.go","file.line":708},"message":"Home path: [/usr/share/filebeat] Config path: [/usr/share/filebeat] Data path: [/usr/share/filebeat/data] Logs path: [/usr/share/filebeat/logs]","service.name":"filebeat","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2024-07-03T14:27:00.100Z","log.origin":{"file.name":"instance/beat.go","file.line":716},"message":"Beat ID: 6dded609-01d1-4348-9b4b-fcffe799377c","service.name":"filebeat","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2024-07-03T14:27:00.100Z","log.origin":{"file.name":"instance/beat.go","file.line":392},"message":"filebeat stopped.","service.name":"filebeat","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2024-07-03T14:27:00.100Z","log.origin":{"file.name":"instance/beat.go","file.line":1057},"message":"Exiting: cannot obtain lockfile: connot start, data directory belongs to process with pid 8","service.name":"filebeat","ecs.version":"1.6.0"}
Exiting: cannot obtain lockfile: connot start, data directory belongs to process with pid 8
I could not log into the Pod to see the filebeat process is running or delete the lock file. Not sure how to troubleshoot the issue.
Any advise on how to fix the issue please?
Thanks.