logdna / logdna-agent

LogDNA Agent streams from log files to your LogDNA account. Works with Linux, Windows, and macOS Servers
https://logdna.com
MIT License
138 stars 55 forks source link

openshift logdna agent for ibmcloud #207

Closed ac427 closed 4 years ago

ac427 commented 4 years ago

How can i change the logdna to forward logs to logdna instance on IBM Cloud instead of https://app.logdna.com ? I am looking config for Openshift Clusters

alfeng6 commented 4 years ago

Hi, first you will need to provision a LogDNA instance on IBM Cloud by following these instructions here (https://cloud.ibm.com/docs/Log-Analysis-with-LogDNA?topic=Log-Analysis-with-LogDNA-provision).

Next, you'll need to install our Agent v1 on the Openshift cluster by following the instructions here (https://cloud.ibm.com/docs/Log-Analysis-with-LogDNA?topic=Log-Analysis-with-LogDNA-config_agent_os_cluster).

These two articles should help you with your question. Please let me know if there are specific areas I can help you with!

ac427 commented 4 years ago

@alfeng6 , thank you. I updated the DS as per the instructions on ibm cloud docs. fyi - The only difference is LDAPIHOST ( i am using us-east)

            - name: LDAPIHOST
              value: api.us-east.logging.cloud.ibm.com
            - name: LDLOGHOST
              value: logs.us-east.logging.cloud.ibm.com

I did a rolling restart after the change, but there is still error in the logs

$oc logs logdna-agent-26c65
2020-10-13 13:27:37 0000 [info] logdna-agent/1.6.5 started on kxxxx.iks.ibm (172.xx.xx.xx)
2020-10-13 13:27:37 0000 [error] error connecting to /var/run/docker.sock: Error: connect ECONNREFUSED /var/run/docker.sock
2020-10-13 13:27:37 0000 [info] streaming from journalctl: files
2020-10-13 13:27:37 0000 [error] error reading from journalctl: Failed to open /var/log/journal: No such file or directory
2020-10-13 13:27:37 0000 [info] streaming /var/log: 162 file(s)
2020-10-13 13:27:41 0000 [info] log rotated: /var/log/pods/default_logdna-agent-7fhn8_786d9888-e8fa-4280-801a-37853b841dcb/7742afeccf9ca6e0770e31e25a8bd20b84216d3dc7692895aa4035d76efb0c04.log by rename
2020-10-13 13:27:41 0000 [info] log rotated: /var/log/pods/rhm-mlm_logdna-agent-42d7q_f3d3953d-0514-47bb-ae3b-8374c6d444f7/35450b3fd12efda9c8932ed0b4734542c87e89fba87b10efccc739bd63be0409.log by rename
ac427 commented 4 years ago

similar to https://github.com/logdna/logdna-agent/issues/74

smusali commented 4 years ago

@ac427, honestly, it's hard to answer why the fail is happening. Docker-related ECONNREFUSED error seems to be local; I mean, there is something wrong on the client-side. I think, This might be helpful.

In terms of LDAPIHOST, you don't need to specify it anymore since LogDNA Agent v1.6+ doesn't use that variable.

ac427 commented 4 years ago

I see the pod logs in logdna. There is one more error related to journal during start if you want to debug

[abc@foo 09:39:39 - ~]$oc logs logdna-agent-5pmdt | grep -i error
2020-10-13 15:21:38 0000 [error] error connecting to /var/run/docker.sock: Error: connect ECONNREFUSED /var/run/docker.sock
2020-10-13 15:21:38 0000 [error] error reading from journalctl: Failed to open /var/log/journal: No such file or directory

I am closing the issue since I am unblocked.