Increasing Log Retention
To increase log retention for specific component, you can modify the configuration file and reset the value of the properties.
Increasing Log Retention for file system
In the /opt/mapr/conf/mfs.conf file, increase the value for the
mfs.max.logfile.size.in.mb property. The value for this property is computed
using the following formula:
maxSizePerLogFile = maxLogSize / MAX_NUM_OF_LOG_FILES
maxLogSizespecifies the total amount of space that file system log files can consume.MAX_NUM_OF_LOG_FILESspecifies the total number of file system log files (5 hard coded).
For example, for a value of 10 GB, there will be 5 log files (mfs.log-3 to
mfs.log-3.4) of 2GB each.
Increasing Log Retention for CLDB
In the /opt/mapr/conf/log4j2.cldb.xml file, modify the
SizeBasedTriggeringPolicy and DefaultRolloverStrategy
properties.
- Modify the
sizeattribute forSizeBasedTriggeringPolicythat specifies the size of eachcldb.logbefore rolling over to write to a new log file. For example,<SizeBasedTriggeringPolicy size="1024MB"/> - Modify the
maxattribute forDefaultRolloverStrategythat specifies the number ofcldb.log*files to be retained before the oldest one is deleted. For example,<DefaultRolloverStrategy max="20" fileIndex="min"/>
With the aforementioned values for SizeBasedTriggeringPolicy and
DefaultRolloverStrategy, the CLDB log files can grow to 20GB (1024*20),
before they are purged.
maprcli node services -cldb restart -nodes $(hostname)Increasing Log Retention for Hadoop Services
You can increase log retention for ResourceManager, NodeManager, HistoryServer, and
TimelineServer by modifying the following properties in the
/opt/mapr/hadoop/hadoop-<Version>/etc/hadoop/log4j.properties
file:
hadoop.log.maxfilesize— specifies the size of each<service-name>-hostname>.logbefore rolling over.hadoop.log.maxbackupindex— specifies the number of<service-name>-<hostname>.log*before the oldest one is deleted.
For example, suppose the following configuration:
hadoop.log.maxfilesize= 1024Mbhadoop.log.maxbackupindex= 10
There will be 10 GB of total service-specific logs (1GB per file) before the oldest file is purged.