Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to configure getConf and new Configuration

Shulou Source: shulou.com Published: 2022-05-31 17:55:52 09月17日 Update

This article mainly explains "how to configure getConf and new Configuration". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to configure getConf and new Configuration.

# getConf

All configurations are in the form of commands, in which case-files is supported

Sudo-uwirelessdev hadoop jar\ / home/q/script/mods/mrjob/mods-1.0-SNAPSHOT-jar-with-dependencies.jar\-files / home/q/script/mods/mrjob/mods.acid\-D mapreduce.job.queuename=wirelessdev\-D mapreduce.job.priority=VERY_HIGH\-D mapreduce.map.memory.mb=8192\-D mapreduce.map.java.opts='-Xmx8192M'\-D mapreduce.reduce.memory.mb=8192\-D mapreduce.reduce.java.opts= '- Xmx8192M'\-D mapreduce.job.reduces=100\-D mapred.reduce.tasks=100\-D mapreduce.job.name=mods_firstjob_leofei.li\ / user/wirelessdev/marmot_warehouse/ods/ods_modss_frame/dt=2016-07-13 Universe * / user/wirelessdev/leofei.li/firstjob

# new Configuration configuration items are configured through code. In this case, configuration items through the command line will become invalid.

Configuration conf = new Configuration (); conf.set ("fs.defaultFS", "hdfs://qunarcluster"); conf.set ("mapreduce.job.queuename", "wirelessdev"); conf.set ("mapreduce.job.reduces", "100th"); conf.set ("mapreduce.job.priority", "VERY_HIGH"); conf.set ("mapreduce.map.memory.mb", "8192"); conf.set ("mapreduce.map.java.opts", "- Xmx8192M") Conf.set ("mapreduce.reduce.memory.mb", "8192"); conf.set ("mapreduce.reduce.java.opts", "- Xmx8192M")

-files is not supported in this case, and DistributedCache is required. The default hdfs path is

DistributedCache.addCacheFile (new Path ("/ user/wirelessdev/leofei.li/conf/mods.acid") .toUri (), conf)

# recommended

Configuration conf = getConf (); conf.set ("mapreduce.job.queuename", "wirelessdev"); Job job = Job.getInstance (conf, "mods_firstjob_leofei.li"). Now that you have a better understanding of "how to configure getConf and new Configuration", you might as well do it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Configuration content command situation learning support practicality deeper code interest practicality form simple operation method more friends website path channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Apple Huawei Microsoft macOS