The script collects RabbitMQ and selected OS logs, system-level metrics and other environment information that can provide insight into the overall state of the node.
For using this script on VMware Tanzu RabbitMQ for Kubernetes pods, follow the instructions in the related article.
Step1:
Ensure you have access to the RabbitMQ Cluster pods.
Step2:
Download the script from Github to the local environment.
Either of the following commands can be used to download the script:
$ curl -LO https://raw.githubusercontent.com/rabbitmq/support-tools/master/scripts/rabbitmq-collect-env
$ wget https://raw.githubusercontent.com/rabbitmq/support-tools/master/scripts/rabbitmq-collect-env
Step3:
Copy the downloaded script from the local environment to the RabbitMQ server pod's tmp directory.
For example:
kubectl cp ./rabbitmq-collect-env default/hello-world-server-0:/tmp
Step4:
Run the rabbitmq-collect-env from RabbitMQ server's pod.
For exmaple:
rabbitmq% kubectl exec hello-world-server-0 -n default -- bash -c "chmod +x /tmp/rabbitmq-collect-env && /tmp/rabbitmq-collect-env" Defaulted container "rabbitmq" out of: rabbitmq, setup-container (init) [INFO] running as 'rabbitmq' user, some commands may fail. Consider running as 'root' user. [WARN] expected to find rabbitmq-env at '/usr/lib/rabbitmq/bin/rabbitmq-env', but file does not exist. E...EE_.....__.._.._._______.___.....__.EEEEEEE.._.........cp: cannot stat '/etc/rabbitmq/*.conf*': No such file or directory ........../tmp/rabbitmq-collect-env: 523: ifconfig: not found . [INFO] output archive: '/var/log/rabbitmq/rabbitmq-env-hello-world-server-0-20220515-023210.tgz'
Step5:
Copy collected artifacts from RabbitMQ server pod to local environment.
For example:
kubectl cp default/hello-world-server-0:var/log/rabbitmq/rabbitmq-env-hello-world-server-0-20220515-023210.tgz rabbitmq-env-hello-world-server-0-20220515-023210.tgz
Step6:
Perform the above steps for each of the RabbitMQ nodes in the cluster, and collect the tar file generated on each server.
*1: Please note that rabbitmq-server logs of VMware Tanzu RabbitMQ for Kubernetes won't be collected by default since VMware Tanzu RabbitMQ for Kubernetes exposes the rabbitmq-server logs to <stdout> along with Kubernetes's logging architecture. You can extract rabbitmq-server logs from external logging monitoring system if you enabled any, or you can also use "kubectl logs" command to collect current rabbitmq-server logs.
*2: Related KB Article URL Link to another related article.
https://knowledge.broadcom.com/external/article/297337