-3

I am new to ansible and trying to deploy cassandra using ansible.

So far I was able to set up a 3 node cassandra cluster and start up cassandra services, but I want the errors/warnings in cassandra logs to be printed on console.

Is there any module that I can use? Or should I register the logs in a variable and display it?

Details: ansible version - ansible 2.5.3 and cassandra version is - apache-cassandra-2.1.16

Horia
  • 2,942
  • 7
  • 14
  • consider you have 3 nodes and each node printed out 30 line of a log! you have 90 line of log and them actually not useful! and screen dirty fully for lines. the better solution for the seen log for the node that uses graylog or any log processor – Amirio Jun 07 '18 at 08:25
  • I think my use case was a bit different than what you suggested. I do agree that printing logs on screen is messy but I only want the ERROR in the logs of the nodes to be on my console when I am trying to start up the nodes.So I know which node has problem. Also here I am starting my nodes in a serial fashion. – Ankitha Sathya Jun 07 '18 at 08:38
  • good, by this consideration you can use ad-hoc command of ansible for seen error logs. i take this command in below answer – Amirio Jun 07 '18 at 09:24

1 Answers1

0

by this command you can seen ERROE log in log file of cassandra:

for debug.log

ansible cassandrahosts -u userCanSeeLogs -m shell -a 'cat /path/to/debug.log | grep ERROR'

for system.log

ansible cassandrahosts -u userCanSeeLogs -m shell -a 'cat /path/to/system.log | grep ERROR'
Amirio
  • 628
  • 1
  • 6
  • 12