ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Onischuk (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMBARI-4315) Proposed changes to new resource mgmt logging
Date Thu, 16 Jan 2014 14:39:22 GMT

    [ https://issues.apache.org/jira/browse/AMBARI-4315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13873441#comment-13873441
] 

Andrew Onischuk commented on AMBARI-4315:
-----------------------------------------

Since all command now are logging maybe we do like this:
{code}
2014-01-16 06:35:57,581 - Execute['htpasswd -c -b  /etc/nagios/htpasswd.users nagiosadmin
aa'] {'not_if': 'grep nagiosadmin /etc/nagios/htpasswd.users'}
2014-01-16 06:35:57,593 - Skipping Execute['htpasswd -c -b  /etc/nagios/htpasswd.users nagiosadmin
aa'] due to not_if
2014-01-16 06:35:57,594 - File['/etc/nagios/htpasswd.users'] {'owner': 'nagios', 'group':
'nagios', 'mode': 416}
2014-01-16 06:35:57,596 - Execute['usermod -a -G nagios apache'] {}
2014-01-16 06:35:57,611 - File['/etc/nagios/command.cfg'] {'owner': 'nagios', 'group': 'nagios'}
2014-01-16 06:35:57,611 - Execute['service nagios start'] {'path': ['/usr/local/bin/:/bin/:/sbin/']}
2014-01-16 06:35:57,746 - MonitorWebserver['restart'] {}
2014-01-16 06:35:57,746 - Execute['/etc/init.d/httpd stop'] {}
2014-01-16 06:35:57,892 - Execute['grep -E 'KeepAlive (On|Off)' /etc/httpd/conf/httpd.conf
&& sed -i 's/KeepAlive Off/KeepAlive On/' /etc/httpd/conf/httpd.conf || echo 'KeepAlive
On' >> /etc/httpd/conf/httpd.conf'] {}
2014-01-16 06:35:57,910 - Execute['/etc/init.d/httpd start'] {}
{code}

> Proposed changes to new resource mgmt logging
> ---------------------------------------------
>
>                 Key: AMBARI-4315
>                 URL: https://issues.apache.org/jira/browse/AMBARI-4315
>             Project: Ambari
>          Issue Type: Bug
>            Reporter: Andrew Onischuk
>            Assignee: Andrew Onischuk
>             Fix For: 1.5.0
>
>         Attachments: AMBARI-4315.patch
>
>
> Here is a snippet of current logging.
> 1) Is the "resource_management" needed? Maybe for DEBUG, but for INFO as well?
> {code}
> 2014-01-10 00:51:02,168 - resource_management - DEBUG - Running resource Directory['/var/log/hadoop/hdfs']
> 2014-01-10 00:51:02,168 - resource_management - DEBUG - Performing action create on Directory['/var/log/hadoop/hdfs']
> 2014-01-10 00:51:02,168 - resource_management.resource - DEBUG - New resource Execute['true']:
{}
> 2014-01-10 00:51:02,168 - resource_management - DEBUG - Running resource Execute['true']
> 2014-01-10 00:51:02,168 - resource_management - DEBUG - Performing action run on Execute['true']
> 2014-01-10 00:51:02,168 - resource_management.provider - INFO - Executing Execute['true']
> 2014-01-10 00:51:02,179 - resource_management.resource - DEBUG - New resource Execute['export
HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec && /usr/lib/hadoop/sbin/hadoop-daemon.sh
--config /etc/hadoop/conf start datanode']: {'not_if': u'ls /var/run/hadoop/hdfs/hadoop-hdfs-datanode.pid
>/dev/null 2>&1 && ps `cat /var/run/hadoop/hdfs/hadoop-hdfs-datanode.pid`
>/dev/null 2>&1', 'user': u'hdfs'}
> 2014-01-10 00:51:02,179 - resource_management - DEBUG - Running resource Execute['export
HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec && /usr/lib/hadoop/sbin/hadoop-daemon.sh
--config /etc/hadoop/conf start datanode']
> 2014-01-10 00:51:02,191 - resource_management - DEBUG - Performing action run on Execute['export
HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec && /usr/lib/hadoop/sbin/hadoop-daemon.sh
--config /etc/hadoop/conf start datanode']
> 2014-01-10 00:51:02,191 - resource_management.provider - INFO - Executing Execute['export
HADOOP_LIBEXEC_DIR=/usr/lib/hadoop/libexec && /usr/lib/hadoop/sbin/hadoop-daemon.sh
--config /etc/hadoop/conf start datanode']
> {code}
> 2) If not, maybe a reorg like this to remove some whitespace and tighten-up the layout.
> {code}
> 2014-01-06 23:48:18,627 DEBUG [resource_management] Performing action run on Execute['/etc/init.d/httpd
stop']
> 2014-01-06 23:48:18,627 INFO Executing Execute['/etc/init.d/httpd stop']
> 2014-01-06 23:48:18,647 DEBUG [resource_management] New resource Execute['grep -E 'KeepAlive
(On|Off)' /etc/httpd/conf/httpd.conf && sed -i 's/KeepAlive Off/KeepAlive On/' /etc/httpd/conf/httpd.conf
|| echo 'KeepAlive On' >> /etc/httpd/conf/httpd.conf']: {}
> 2014-01-06 23:48:18,647 DEBUG [resource_management] Running resource Execute['grep -E
'KeepAlive (On|Off)' /etc/httpd/conf/httpd.conf && sed -i 's/KeepAlive Off/KeepAlive
On/' /etc/httpd/conf/httpd.conf || echo 'KeepAlive On' >> /etc/httpd/conf/httpd.conf']
> 2014-01-06 23:48:18,648 DEBUG [resource_management] Performing action run on Execute['grep
-E 'KeepAlive (On|Off)' /etc/httpd/conf/httpd.conf && sed -i 's/KeepAlive Off/KeepAlive
On/' /etc/httpd/conf/httpd.conf || echo 'KeepAlive On' >> /etc/httpd/conf/httpd.conf']
> 2014-01-06 23:48:18,648 INFO Executing Execute['grep -E 'KeepAlive (On|Off)' /etc/httpd/conf/httpd.conf
&& sed -i 's/KeepAlive Off/KeepAlive On/' /etc/httpd/conf/httpd.conf || echo 'KeepAlive
On' >> /etc/httpd/conf/httpd.conf']
> 2014-01-06 23:48:18,663 DEBUG [resource_management] New resource Execute['/etc/init.d/httpd
start']: {}
> 2014-01-06 23:48:18,663 DEBUG [resource_management] Running resource Execute['/etc/init.d/httpd
start']
> 2014-01-06 23:48:18,663 DEBUG [resource_management] Performing action run on Execute['/etc/init.d/httpd
start']
> 2014-01-06 23:48:18,663 INFO Executing Execute['/etc/init.d/httpd start']
> {code}
> 3) On the UI side, it would be great to turn off seeing debug. It's useful to be there
in case you need those details, but optionally show/don't show in UI. Because then you would
end up with this which is very manageable for a user to read (this is the above logging w/
DEBUG removed).
> {code}
> 2014-01-06 23:48:18,627 INFO Executing Execute['/etc/init.d/httpd stop']
> 2014-01-06 23:48:18,648 INFO Executing Execute['grep -E 'KeepAlive (On|Off)' /etc/httpd/conf/httpd.conf
&& sed -i 's/KeepAlive Off/KeepAlive On/' /etc/httpd/conf/httpd.conf || echo 'KeepAlive
On' >> /etc/httpd/conf/httpd.conf']
> 2014-01-06 23:48:18,663 INFO Executing Execute['/etc/init.d/httpd start']
> {code}
> 4) Also I propose when you install a package, you also give the detail of the command
used. That's useful to a user. Right now, we show this:
> {code}
> 2014-01-10 00:50:48,480 - resource_management.provider - INFO Installing package ambari-log4j
> {code}
> Would be good to give the actual + specific yum/zypper/etc command being called, even
in INFO:
> {code}
> 2014-01-10 00:50:48,480 INFO Installing package ambari-log4j [ā€˜/usr/bin/yum -d 0 -e
0 -y install ambari-log4jā€™]
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message