You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/11/26 08:17:00 UTC

[jira] [Commented] (AMBARI-24950) Logsearch: use os timezone in Logfeeder

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

ASF GitHub Bot commented on AMBARI-24950:
-----------------------------------------

kasakrisz opened a new pull request #41: AMBARI-24950 - Logsearch: use os timezone in Logfeeder
URL: https://github.com/apache/ambari-logsearch/pull/41
 
 
   # What changes were proposed in this pull request?
   
   Logfeeder sets the default timezone to GMT at start up. Most service logs' logtime are in os timezone. If os timezone is set to other than UTC Logfeeder does not convert the logtime values to UTC when sending the log entry to Solr and Logsearch portal shows invalid log time values.
   Fix: 
   * Remove explicitly set the default time zone to GMT. This case the default time zone going to be the os time zone
   Or it can be overridden by JVM option.
   * Remove unused `dateToString` method.
   
   ## How was this patch tested?
   
   Manually:
   1. Deploy Ambari and a cluster: Zookeeper, Infra-Solr, Logsearch
   2. Set the time zone en each node to America/Chicago: 
   ```timedatectl set-timezone America/Chicago```
   3. Restart Amabari server/agents and all services
   4. Check Ambari server log and notice that the log time values are at the new time zone in the end of the logfile while the values in the beginning are in UTC
   ```
   grep 'State of service component' /var/log/ambari-server/ambari-server.log
   2018-11-23 15:04:53,058  INFO [agent-report-processor-0] HeartbeatProcessor:647 - State of service component LOGSEARCH_SERVER of service LOGSEARCH of cluster 2 has changed from INSTALLED to STARTED at host c7401.ambari.apache.org according to STATUS_COMMAND report
   2018-11-23 15:05:19,535  INFO [agent-report-processor-0] HeartbeatProcessor:647 - State of service component LOGSEARCH_LOGFEEDER of service LOGSEARCH of cluster 2 has changed from INSTALLED to STARTED at host c7401.ambari.apache.org according to STATUS_COMMAND report
   2018-11-23 09:18:35,669  INFO [agent-report-processor-0] HeartbeatProcessor:647 - State of service component LOGSEARCH_SERVER of service LOGSEARCH of cluster 2 has changed from STARTED to INSTALLED at host c7401.ambari.apache.org according to STATUS_COMMAND report
   2018-11-23 09:18:42,652  INFO [agent-report-processor-1] HeartbeatProcessor:647 - State of service component LOGSEARCH_LOGFEEDER of service LOGSEARCH of cluster 2 has changed from STARTED to INSTALLED at host c7402.ambari.apache.org according to STATUS_COMMAND report
   ```
   5. Check that all ambari server log entries logtime is converted to UTC in Solr
   ```
   {
           "log_message":"State of service component LOGSEARCH_SERVER of service LOGSEARCH of cluster 2 has changed from INSTALLED to STARTED at host c7401.ambari.apache.org according to STATUS_COMMAND report",
           "id":"606519d6-a315-4553-8f49-dda2eba7437f",
           "logtime":"2018-11-23T15:04:53.058Z"},
         {
           "log_message":"State of service component LOGSEARCH_LOGFEEDER of service LOGSEARCH of cluster 2 has changed from INSTALLED to STARTED at host c7401.ambari.apache.org according to STATUS_COMMAND report",
           "id":"97760f62-ec8b-447f-92e4-b49f616ed897",
           "logtime":"2018-11-23T15:05:19.535Z"},
         {
           "log_message":"State of service component LOGSEARCH_SERVER of service LOGSEARCH of cluster 2 has changed from STARTED to INSTALLED at host c7401.ambari.apache.org according to STATUS_COMMAND report",
           "id":"19aefe4f-ab22-43b5-a952-4bd355a0f6b3",
           "logtime":"2018-11-23T15:18:35.669Z"},
         {
           "log_message":"State of service component LOGSEARCH_LOGFEEDER of service LOGSEARCH of cluster 2 has changed from STARTED to INSTALLED at host c7402.ambari.apache.org according to STATUS_COMMAND report",
           "id":"3601f700-7272-4c38-bd7d-5d89552bdcc2",
           "logtime":"2018-11-23T15:18:42.652Z"},
   ```
   6. Check that the logtime values are converted to the specified timezone on Logsearch portal

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Logsearch: use os timezone in Logfeeder
> ---------------------------------------
>
>                 Key: AMBARI-24950
>                 URL: https://issues.apache.org/jira/browse/AMBARI-24950
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-logsearch
>    Affects Versions: 2.8.0
>            Reporter: Krisztian Kasa
>            Assignee: Krisztian Kasa
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.8.0
>
>
> Logfeeder sets the default timezone to GMT at start up. Most service logs' logtime are in os timezone. If os timezone is set to other than UTC Logfeeder does not convert the logtime values to UTC when sending the log entry to Solr and Logsearch portal shows invalid log time values.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)