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

Prabhu Joseph commented on YARN-9558:
-------------------------------------

The custom suffix for TFile Log Aggregation format 
(yarn.log-aggregation.tfile.remote-app-log-dir-suffix) is not given first 
precedence by the {{LogAggregationTFileController}} which is fixed by 
YARN-9519. Failed testcases are due to some test code, {{LogAggregationUtils}}, 
{{LogCLIHelpers}} class has hardcoded with 
{{yarn.nodemanager.remote-app-log-dir-suffix}}. 

{{AggregationLogDeletionService}} and {{LogsCLI#guessAppOwner}} also uses 
{{yarn.nodemanager.remote-app-log-dir-suffix}}. Fixed all these places to get 
suffix directly from the fileformat.

*Functional Testing:*

{code}
1. Test Yarn Logs CLI for running and completed job with job user, super user 
and user who does not have access
2. Access Job Logs for running and completed job from RM UI, MapReduce 
HistoryServer UI, ApplicationHistoryServer UI
3. Test Log Aggregation Deletion
4. Test Yarn Logs CLI for completed job with RM down and with different user to 
test if Guess AppOwner works.


Below are the various combination of fileformat, suffix and app log dir configs 
tested.

1. Default Suffix for IndexedFileController:
************************************************
yarn.log-aggregation.file-formats=IFile
yarn.log-aggregation.file-controller.IFile.class=org.apache.hadoop.yarn.logaggregation.filecontroller.ifile.LogAggregationIndexedFileController
yarn.log-aggregation.IFile.remote-app-log-dir=/tmp/IFile
yarn.nodemanager.remote-app-log-dir=/tmp/IFile

[hdfs@yarn-ats-1 logs]$ hadoop fs -ls 
/tmp/IFile/ambari-qa/bucket-logs-ifile/0001
drwxrwx---   - ambari-qa hadoop          0 2019-05-17 09:50 
/tmp/IFile/ambari-qa/bucket-logs-ifile/0001/application_1558086621870_0001
drwxrwx---   - ambari-qa hadoop          0 2019-05-17 10:04 
/tmp/IFile/ambari-qa/bucket-logs-ifile/0001/application_1558087254518_0001


2. Custom Suffix for IndexedFileController:
************************************************
yarn.log-aggregation.file-formats=IFile
yarn.log-aggregation.file-controller.IFile.class=org.apache.hadoop.yarn.logaggregation.filecontroller.ifile.LogAggregationIndexedFileController
yarn.log-aggregation.IFile.remote-app-log-dir=/tmp/IFile
yarn.nodemanager.remote-app-log-dir=/tmp/IFile
yarn.log-aggregation.IFile.remote-app-log-dir-suffix=indexed

[hdfs@yarn-ats-1 logs]$ hadoop fs -ls /tmp/IFile/ambari-qa/bucket-indexed/0002
drwxrwx---   - ambari-qa hadoop          0 2019-05-17 10:12 
/tmp/IFile/ambari-qa/bucket-indexed/0002/application_1558087668158_0002


3. Default Suffix for TFileController:
************************************************
yarn.nodemanager.remote-app-log-dir=/tmp/TFile

[hdfs@yarn-ats-1 logs]$ hadoop fs -ls 
/tmp/TFile/ambari-qa/bucket-logs-tfile/0001
Found 1 items
drwxrwx---   - ambari-qa hadoop          0 2019-05-17 10:25 
/tmp/TFile/ambari-qa/bucket-logs-tfile/0001/application_1558088456463_0001


4. Custom Suffix for TFileController:
*****************************************
yarn.log-aggregation.file-formats=tfile
yarn.log-aggregation.file-controller.tfile.class=org.apache.hadoop.yarn.logaggregation.filecontroller.tfile.LogAggregationTFileController
yarn.log-aggregation.tfile.remote-app-log-dir=/tmp/TFileCustom
yarn.log-aggregation.tfile.remote-app-log-dir-suffix=tfilecustom
yarn.nodemanager.remote-app-log-dir=/tmp/older
yarn.nodemanager.remote-app-log-dir-suffix=older

[hdfs@yarn-ats-1 logs]$ hadoop fs -ls 
/tmp/TFileCustom/ambari-qa/bucket-tfilecustom/0001
drwxrwx---   - ambari-qa hadoop          0 2019-05-17 10:33 
/tmp/TFileCustom/ambari-qa/bucket-tfilecustom/0001/application_1558088945718_0001


5. Default Older Suffix:
*************************
yarn.log-aggregation.file-formats=tfile
yarn.log-aggregation.file-controller.tfile.class=org.apache.hadoop.yarn.logaggregation.filecontroller.tfile.LogAggregationTFileController
yarn.nodemanager.remote-app-log-dir=/tmp/older
yarn.nodemanager.remote-app-log-dir-suffix=older

[hdfs@yarn-ats-1 logs]$ hadoop fs -ls 
/tmp/older/ambari-qa/bucket-older-tfile/0001
drwxrwx---   - ambari-qa hadoop          0 2019-05-17 10:39 
/tmp/older/ambari-qa/bucket-older-tfile/0001/application_1558089416269_0001


Aggregated Log Deletion:
****************************

    <property>
     <name>yarn.log-aggregation.retain-seconds</name>
     <value>60</value>
    </property>

Result:

2019-05-17 10:21:11,464 INFO 
org.apache.hadoop.yarn.logaggregation.AggregatedLogDeletionService: Deleting 
aggregated logs in 
hdfs://yarn-ats-1:8020/tmp/IFile/hbase/bucket-logs-ifile/0003/application_1558086621870_0003

2019-05-17 10:23:10,587 INFO 
org.apache.hadoop.yarn.logaggregation.AggregatedLogDeletionService: Deleting 
aggregated logs in 
hdfs://yarn-ats-1:8020/tmp/IFile/ambari-qa/bucket-indexed/0002/application_1558087668158_0002

2019-05-17 10:26:13,927 INFO 
org.apache.hadoop.yarn.logaggregation.AggregatedLogDeletionService: Deleting 
aggregated logs in 
hdfs://yarn-ats-1:8020/tmp/TFile/ambari-qa/bucket-logs-tfile/0001/application_1558088456463_0001

2019-05-17 10:37:25,071 INFO 
org.apache.hadoop.yarn.logaggregation.AggregatedLogDeletionService: Deleting 
aggregated logs in 
hdfs://yarn-ats-1:8020/tmp/TFileCustom/ambari-qa/bucket-tfilecustom/0001/application_1558088945718_0001

2019-05-17 10:42:13,519 INFO 
org.apache.hadoop.yarn.logaggregation.AggregatedLogDeletionService: Deleting 
aggregated logs in 
hdfs://yarn-ats-1:8020/tmp/older/ambari-qa/bucket-older-tfile/0001/application_1558089416269_0001

{code}



> Log Aggregation testcases failing
> ---------------------------------
>
>                 Key: YARN-9558
>                 URL: https://issues.apache.org/jira/browse/YARN-9558
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: log-aggregation, test
>    Affects Versions: 3.3.0, 3.2.1, 3.1.3
>            Reporter: Prabhu Joseph
>            Assignee: Prabhu Joseph
>            Priority: Major
>         Attachments: YARN-9558-001.patch
>
>
> Test cases related to Log Aggregation from below classes are failing
> hadoop.yarn.server.nodemanager.webapp.TestNMWebServices 
> hadoop.yarn.server.nodemanager.containermanager.logaggregation.TestLogAggregationService
>  
> hadoop.yarn.server.applicationhistoryservice.webapp.TestAHSWebServices 
> hadoop.yarn.client.cli.TestLogsCLI 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to