tpaexec archive-logs#

To create a log directory and archive logs from instances, run

tpaexec archive-logs <cluster-dir>

This will create a logs/YYYYMMDDHHMMss/ directory in your cluster directory and download a tar.gz archive of all the files under /var/log on each instance in the cluster into a separate directory.

Prerequisites#

If you have an existing cluster you can run tpaexec archive-logs immediately. But if you are configuring a new cluster, you must at least

Provisioning the deployment the cluster. You will get more logs if you also A First Cluster Deployment the cluster.

Quickstart#

[tpa]$ tpaexec archive-logs ~/clusters/speedy

PLAY [Prepare local host archive] *******************************************

TASK [Collect facts] ********************************************************
ok: [localhost]

TASK [Set time stamp] *******************************************************
ok: [localhost]

TASK [Create local log archive directory] ***********************************
changed: [localhost]

PLAY [Archive log files from target instances] ******************************

...

TASK [Remove remote archives] ***********************************************
changed: [kinship]
changed: [khaki]
changed: [uncivil]
changed: [urchin]

PLAY RECAP ******************************************************************
khaki                      : ok=3    changed=3    unreachable=0    failed=0
kinship                    : ok=3    changed=3    unreachable=0    failed=0
localhost                  : ok=3    changed=1    unreachable=0    failed=0
uncivil                    : ok=3    changed=3    unreachable=0    failed=0
urchin                     : ok=3    changed=3    unreachable=0    failed=0

You can append -v , -vv , etc. to the command if you want more verbose output.

Generated files#

You can find the logs for each instance under the cluster directory:

~/clusters/speedy/logs/
`-- 220220306T185049
    |-- khaki-logs-20220306T185049.tar.gz
    |-- kinship-logs-20220306T185049.tar.gz
    |-- uncivil-logs-20220306T185049.tar.gz
    `-- urchin-logs-20220306T185049.tar.gz

Archive contents example: