Hadoop大數(shù)據(jù)開發(fā)基礎(chǔ)課后答案(僅供參考)
本書為中國工信出版集團的《Hadoop大數(shù)據(jù)開發(fā)基礎(chǔ)》
Hadoop集群的搭建與配置
一、選擇題
1.HDFS中的文件塊默認保存(C)份。
B.2 A.1 C.3 D.不確定
2.啟動集群的順序為(A)
① start-dfs.sh ② start-yarn.sh
③ mr-jobhistory-daemon.sh start historyserver
A.① ② ③ B.② ① ③ C.③ ② ① D.③ ① ②
3.關(guān)閉集群的順序為(B)
① stop-dfs.sh ②stop-yarn.sh ③ m-jobhistory-daemon.sh stop historyserver
A.① ② ③ B.② ① ③ C.③ ② ① D.① ③ ②
4.YARN監(jiān)控的默認端口是(B)。
A.50070端口 B.8088端口 C.19888端口 D.8080端口
5.默認端口50070的作用是(A)
A.查看HDFS監(jiān)控 B.查看YARN監(jiān)控 C.查看日志監(jiān)控 D.不確定
6.在Linux下安裝NTP服務(wù)的命令是(A)
A. yum install ntp B. yum remove ntp C. yum update ntp D. yum list
7.搭建 Hadoop集群的步驟是(A)
①克隆虛擬機
②配置 SSH免密碼登錄③ 格式化
④修改配置文件
⑤配置時間同步服務(wù)
A.④①②⑤③ B.③②①⑤④ C.⑤①③②④ D.②⑤④①③
8.在(A)配置文件里可以修改文件塊的副本數(shù)。
A. hdfs-site.xml B.slaves D. hadoop-env.sh C. core-site.xml
9 yarn-site.xml文件的作用是(C)
A. 配置 MapReduce框架 B.配置 Hadoop 的HDFS系統(tǒng)的命名
C. 配置YARN 框架 D.保存子節(jié)點信息
10. 克隆虛擬機之后需要修改(B)文件。
① /etc/udev/rules.d/70-persistent-net.rules
②/etc/sysconfig/network-scriptd/ifcfg-eth0
③ /etc/sysconfig/network
A.①② B.①②③ C.②③ D.①③
Hadoop基礎(chǔ)操作
一、選擇題
1.下列(A)命令可以顯示出HDFS 文件系統(tǒng)中在線的數(shù)據(jù)節(jié)點。
A. hdfs dfsadmin -report -live B. hdfs dfsadmin -report -active
C. hdfs dfsadmin -report-dead D. hdfs dfsadmin -report-decommissioning
2.下列(C)命令可以顯示出HDFS目錄/user/root/中的內(nèi)容。
A. hdfs dfs -dir /user/root/ B. hdfs dfs -report /user/root/
C. hdfs dfs -ls /user/root/ D. hdfs dfs -display /user/root/
3.下列( A)命令可以下載HDFS目錄/user/root/live.txt。
A. hdfs dfs -get/user/root/live.txt B. hdfs dfs -download /user/root/live.txt
C. hdfs dfs -put /user/root/live.txt D. hdfs dfs -move /user/root/live.txt
4.上傳一個大小為500MB的文件 data.txt到以 Hadoop 2.6搭建的集群上。這個文件會占用(B)個HDPS 文件塊。
A.3 B. 4 C.5 D.8
5.在 Hadoop官方的示例程序包hadoop-mapreduce-examples-2.6.4.jar中,封裝了一些常用的測試模塊??梢垣@得文件中單詞長度的中位數(shù)的模塊是(C)。
A. wordcount B. wordmean C.wordmedian D. wordstandarddeviation
6.向Hadoop集群提交MapReduce任務(wù)時,可以使用下列(C)命令。
A.hadoop submit B. hadoop put C. hadoop jar D. mapreduce jar
7.以hadoop jar提交MapReduce任務(wù)時,如果命令行中指定的輸出目錄已經(jīng)存在,執(zhí)行的結(jié)果將會是(C)。
A. 覆蓋原目錄 B.自動創(chuàng)建新目錄 C.報錯并中斷任務(wù) D.以上都不是
8.當提交某個 MapReduce 任務(wù)后,在任務(wù)列表中顯示該任務(wù)的狀態(tài)(state)值為"ACCEPTED",這表示(C)
A.正在接受中 B.正在執(zhí)行中 C.等待執(zhí)行中D.任務(wù)恢復(fù)中
MapReduce編程入門
一、選擇題。
1.有多種瀏覽HDPS文件相錄的方式,以下(D)是不對的
A.通過HDFS命今 B.通過Web瀏覽器
C.通過Eclipse中的Project Explorer D.通過SSH客戶端工具
2.在詞頻統(tǒng)計(WordCount)的執(zhí)行過程中,( A)模塊負責進行單詞的拆分與映射。
A. Mapper B. Reducer C. Driver D. Main
3.MapReduce程序最后輸出的結(jié)果通常都是按鍵值進行排序的,那么排序工作發(fā)生在MapReducer執(zhí)行過程中的(B)階段。
A. Map B. Shufle C. Reduce D. Combiner
4.在驅(qū)動類中,(C)設(shè)置輸入數(shù)據(jù)的格式。
A.使用方法 setOutputFormat B.使用方法 setOutputKeyValue
C.使用方法 setInputFormat D.使用方法 setJarByClass
5.以MapReduce統(tǒng)計學(xué)員的平均成績,如果輸出結(jié)果的格式為"學(xué)生姓名 平均成績",例如"Alice 89.5",那么通過(D)選用輸出鍵值對格式。
A.job.setOutputKeyClass(Text.class;job.setOutputValueClassText.class);
B.job.setOutputKeyClass(ntWritableclass;job.setOutputValueClassText.class);
C.job.setOutpuKeyClass(Text.class;job.setOutputValueClass(LongWritable.class);
D.job.setOutputKeyClass(Text.class);job.setOutputValueClass(DoubleWritable.class);
6.在 MapReduce程序中,Mapper模塊中的自定義類MyMapper 繼承自(A)父類。
A. Mapper B. Reducer C. Combiner D. Partitioner
7.在 MapReduce程序中,必須包含的模塊有(C)。
A. Mapper、Combiner、Reducer B. setup、Mapper、Reducer
C. Mapper、Reducer D. Mapper、Reducer、cleanup
8.在 MapReduce 程序中,Reducer類中包括的函數(shù)有(B)。
A. startup、reduce、end B. setup、reduce、cleanup
C. start、run、reduce、end D. startup、run、end
9.有一組數(shù)據(jù)(W,2,C,2,8,S,W),如果用MapReduce程序?qū)ζ渲械拿總€元素進行計數(shù),那么在輸出的鍵值對結(jié)果中,鍵的排列順序應(yīng)該是(B)。
A.8、2、C、S、W B.2、8、C、S、W
C.C、S、W、8、2 D.2、8、W、C、S
10.在Job類中對輸出鍵值對格式進行設(shè)置時,如果 Mapper的輸出格式與Reducer的輸出格式一樣,那么可以省略下列(B)設(shè)置。
A.job.setOutputKeyClass()與job.setOutputValueClss()
B.job.setMapOutputKeyClass()與job.setMapOutputValueClass()
C.job.setReduceOutputKeyClass()與 job.setReduceOutputValueClass()
D.以上都不能省略
MapReduce進階編程
一、選擇題
1.下列關(guān)于Combiner 的描述,正確的是(D)。
A.在 MapReduce 作業(yè)流程中可隨意添加 Combiner
B.添加了Combiner意味著 MapReduce程序的運行效率得到了優(yōu)化
C.Combiner 可以代替 Reducer
D.應(yīng)謹慎使用Combiner
2.下列(B)情況適合添加 Combiner。
A. MapReduce 程序求平均值 B. MapReduce 程序求和
C. MapReduce程序求中位數(shù) D.MapReduce 程序?qū)?shù)據(jù)進行排序
3.下列屬于 Hadoop 內(nèi)置數(shù)據(jù)類型的是( D)。
A. IntegerWritable B. StringWritable C. ListWritable D. MapWritable
4.關(guān)于自定義數(shù)據(jù)類型,下列說法正確的是(D)。
A.自定義數(shù)據(jù)類型必須繼承Writable 接口
B.自定義MapReduce 的key需要繼承Writable接口
C.自定義 MapReduce的value需要繼承WritableComparable接口
D.自定義數(shù)據(jù)類型必須實現(xiàn) readFields(Datalnput datainput)方法
5.設(shè)置 MapReduce參數(shù)傳遞的正確方式是(C)
A.通過變量賦值進行傳遞
B.通過 get()和 set()方法傳遞
C.通過 conf.set(“argName”,args[n])傳遞
D.通過 job.set(“argName”,args[n])傳遞
6.在 Mapper類的setup 函數(shù)里,下列(D)方式可以用來獲取參數(shù)值。
A.Context.get(“argName”)
B.Configuration.get(“argName”)
C.context.getConfiguration.getInt"argName")
D.context.getConfiguration.get(“argName”)
7.Hadoop序列化的特點有(A)。
A.緊湊、快速、互擴展、互操作 B.緊湊、快速 C. 互擴展 D. 互操作
8.下列說法正確的是(C)。
A.Combiner發(fā)生在 Reduce 端
B.MapReduce默認的輸入格式是KeyValuelnpuFormat
C.Partitioner 的作用是對 key進行分區(qū)
D.自定義值類型需要實現(xiàn) WritableComparable接口
9.MapReduce默認的輸出格式是(B)
A. SequenceFileOutputFormat B. TextOutputFormat
C. NullOutputFormat D. MapFileOutputFormat文章來源:http://www.zghlxwxcb.cn/news/detail-472058.html
10.Hadoop JavaAPI創(chuàng)建文件夾的方法是(C)。
A. listStatus(Path f)B. delete(Path f)
C. mkdirs(Path f) D. open(Path f)文章來源地址http://www.zghlxwxcb.cn/news/detail-472058.html
如果有什么內(nèi)容有錯的地方歡迎大家進行指正?。?!
到了這里,關(guān)于Hadoop大數(shù)據(jù)開發(fā)基礎(chǔ)課后答案的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!