首页 文章 精选 留言 我的

精选列表

搜索[高并发],共10000篇文章
优秀的个人博客,低调大师

可用Hadoop平台-Ganglia安装部署

1.概述 最近,有朋友私密我,Hadoop有什么好的监控工具,其实,Hadoop的监控工具还是蛮多的。今天给大家分享一个老牌监控工具Ganglia,这个在企业用的也算是比较多的,Hadoop对它的兼容也很好,不过就是监控界面就不是很美观。下次给大家介绍另一款工具——Hue,这个界面官方称为Hadoop UI,界面美观,功能也比较丰富。今天,在这里主要给大家介绍Ganglia这款监控工具,介绍的内容主要包含如下: Ganglia背景 Ganglia安装部署、配置 Hadoop集群配置Ganglia 启动、预览Ganglia 下面开始今天的内容分享。 2.Ganglia背景 Ganglia是UC Berkeley发起的一个开源集群监视项目,设计用于测量数以千计的节点。Ganglia的核心包含gmond、gmetad以及一个Web前端。主要是用来监控系统性能,如:cpu 、mem、硬盘利用率, I/O负载、网络流量情况等,通过曲线很容易见到每个节点的工作状态,对合理调整、分配系统资源,提高系统整体性能起到重要作用。 Ganglia其核心由3部分组成: gmond:运行在每个节点上监视并收集节点信息,可以同时收发统计信息,它可以运行在广播模式和单播模式中。 gmetad:从gmond以poll的方式收集和存储原数据。 ganglia-web:部署在gmetad机器上,访问gmetad存储的元数据并由Apache Web提高用户访问接口。 下面,我们来看看Ganglia的架构图,如下图所示: 从架构图中,我们可以知道Ganglia支持故障转移,统计可以配置多个收集节点。所以我们在配置的时候,可以按需选择去配置Ganglia,既可以配置广播,也可以配置单播。根据实际需求和手上资源来决定。 3.Ganglia安装部署、配置 3.1安装 本次安装的Ganglia工具是基于Apache的Hadoop-2.6.0。另外系统环境是CentOS 6.6。首先,我们下载Ganglia软件包,步骤如下所示: 第一步:安装yum epel源 [hadoop@nna ~]$ rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm 第二步:安装依赖包 [hadoop@nna ~]$ yum -y install httpd-devel automake autoconf libtool ncurses-devel libxslt groff pcre-devel pkgconfig 第三步:查看Ganglia安装包 [hadoop@nna ~]$ yum search ganglia 然后,我为了简便,把Ganglia安装全部安装,安装命令如下所示: 第四步:安装Ganglia [hadoop@nna ~]$ yum -y install ganglia* 最后等待安装完成,由于这里资源有限,我将Ganglia Web也安装在NNA节点上,另外,其他节点也需要安装Ganglia的Gmond服务,该服务用来发送数据到Gmetad,安装方式参考上面的步骤。 3.2部署 在安装Ganglia时,我这里将Ganglia Web部署在NNA节点,其他节点部署Gmond服务,下表为各个节点的部署角色: 节点 Host 角色 NNA 10.211.55.26 Gmetad、Gmond、Ganglia-Web NNS 10.211.55.27 Gmond DN1 10.211.55.16 Gmond DN2 10.211.55.17 Gmond DN3 10.211.55.18 Gmond Ganglia部署在Hadoop集群的分布图,如下所示: 3.3配置 在安装好Ganglia后,我们需要对Ganglia工具进行配置,在由Ganglia-Web服务的节点上,我们需要配置Web服务。 ganglia.conf [hadoop@nna ~]$ vi /etc/httpd/conf.d/ganglia.conf 修改内容如下所示: # # Ganglia monitoring system php web frontend # Alias /ganglia /usr/share/ganglia <Location /ganglia> Order deny,allow # Deny from all Allow from all # Allow from 127.0.0.1 # Allow from ::1 # Allow from .example.com </Location> 注:红色为添加的内容,绿色为注销的内容。 gmetad.conf [hadoop@nna ~]$ vi /etc/ganglia/gmetad.conf 修改内容如下所示: data_source "hadoop" nna nns dn1 dn2 dn3 这里“hadoop”表示集群名,nna nns dn1 dn2 dn3表示节点域名或IP。 gmond.conf [hadoop@nna ~]$ vi /etc/ganglia/gmond.conf 修改内容如下所示: /* * The cluster attributes specified will be used as part of the <CLUSTER> * tag that will wrap all hosts collected by this instance. */ cluster { name = "hadoop" owner = "unspecified" latlong = "unspecified" url = "unspecified" } /* Feel free to specify as many udp_send_channels as you like. Gmond used to only support having a single channel */ udp_send_channel { #bind_hostname = yes # Highly recommended, soon to be default. # This option tells gmond to use a source address # that resolves to the machine's hostname. Without # this, the metrics may appear to come from any # interface and the DNS names associated with # those IPs will be used to create the RRDs. # mcast_join = 239.2.11.71 host = 10.211.55.26 port = 8649 ttl = 1 } /* You can specify as many udp_recv_channels as you like as well. */ udp_recv_channel { # mcast_join = 239.2.11.71 port = 8649 bind = 10.211.55.26 retry_bind = true # Size of the UDP buffer. If you are handling lots of metrics you really # should bump it up to e.g. 10MB or even higher. # buffer = 10485760 } 这里我采用的是单播,cluster下的name要与gmetad中的data_source配置的名称一致,发送节点地址配置为NNA的IP,接受节点配置在NNA上,所以绑定的IP是NNA节点的IP。以上配置是在有Gmetad服务和Ganglia-Web服务的节点上需要配置,在其他节点只需要配置gmond.conf文件即可,内容配置如下所示: /* Feel free to specify as many udp_send_channels as you like. Gmond used to only support having a single channel */ udp_send_channel { #bind_hostname = yes # Highly recommended, soon to be default. # This option tells gmond to use a source address # that resolves to the machine's hostname. Without # this, the metrics may appear to come from any # interface and the DNS names associated with # those IPs will be used to create the RRDs. # mcast_join = 239.2.11.71 host = 10.211.55.26 port = 8649 ttl = 1 } /* You can specify as many udp_recv_channels as you like as well. */ udp_recv_channel { # mcast_join = 239.2.11.71 port = 8649 # bind = 10.211.55.26 retry_bind = true # Size of the UDP buffer. If you are handling lots of metrics you really # should bump it up to e.g. 10MB or even higher. # buffer = 10485760 } 4.Hadoop集群配置Ganglia 在Hadoop中,对Ganglia的兼容是很好的,在Hadoop的目录下/hadoop-2.6.0/etc/hadoop,我们可以找到hadoop-metrics2.properties文件,这里我们修改文件内容如下所示,命令如下所示: [hadoop@nna hadoop]$ vi hadoop-metrics2.properties 修改内容如下所示: namenode.sink.ganglia.servers=nna:8649 #datanode.sink.ganglia.servers=yourgangliahost_1:8649,yourgangliahost_2:8649 resourcemanager.sink.ganglia.servers=nna:8649 #nodemanager.sink.ganglia.servers=yourgangliahost_1:8649,yourgangliahost_2:8649 mrappmaster.sink.ganglia.servers=nna:8649 jobhistoryserver.sink.ganglia.servers=nna:8649 这里修改的是NameNode节点的内容,若是修改DataNode节点信息,内容如下所示: #namenode.sink.ganglia.servers=nna:8649 datanode.sink.ganglia.servers=dn1:8649 #resourcemanager.sink.ganglia.servers=nna:8649 nodemanager.sink.ganglia.servers=dn1:8649 #mrappmaster.sink.ganglia.servers=nna:8649 #jobhistoryserver.sink.ganglia.servers=nna:8649 其他DN节点可以以此作为参考来进行修改。 另外,在配置完成后,若之前Hadoop集群是运行的,这里需要重启集群服务。 5.启动、预览Ganglia Ganglia的启动命令有start、restart以及stop,这里我们分别在各个节点启动相应的服务,各个节点需要启动的服务如下: NNA节点: [hadoop@nna ~]$ service gmetad start [hadoop@nna ~]$ service gmond start [hadoop@nna ~]$ service httpd start NNS节点: [hadoop@nns ~]$ service gmond start DN1节点: [hadoop@dn1 ~]$ service gmond start DN2节点: [hadoop@dn2 ~]$ service gmond start DN3节点: [hadoop@dn3 ~]$ service gmond start 然后,到这里Ganglia的相关服务就启动完毕了,下面给大家附上Ganglia监控的运行截图,如下所示: 6.总结 在安装Hadoop监控工具Ganglia时,需要在安装的时候注意一些问题,比如:系统环境的依赖,由于Ganglia需要依赖一些安装包,在安装之前把依赖环境准备好,另外在配置Ganglia的时候需要格外注意,理解Ganglia的架构很重要,这有助于我们在Hadoop集群上去部署相关的Ganglia服务,同时,在配置Hadoop安装包的配置文件下(/etc/hadoop)目录下,配置Ganglia配置文件。将hadoop-metrics2.properties配置文件集成到Hadoop集群中去。 7.结束语 这篇博客就和大家分享到这里,如果大家在研究学习的过程当中有什么问题,可以加群进行讨论或发送邮件给我,我会尽我所能为您解答,与君共勉!

优秀的个人博客,低调大师

可用Hadoop平台-运行MapReduce程序

1.概述 最近有同学反应,如何在配置了HA的Hadoop平台运行MapReduce程序呢?对于刚步入Hadoop行业的同学,这个疑问却是会存在,其实仔细想想,如果你之前的语言功底不错的,应该会想到自动重连,自动重连也可以帮我我们解决运行MapReduce程序的问题。然后,今天我赘述的是利用Hadoop的Java API 来实现。 2.介绍 下面直接附上代码,代码中我都有注释。 2.1Java操作HDFS HA的API 代码如下: /** * */ package cn.hdfs.mr.example; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; /** * @author dengjie * @date 2015年3月24日 * @description TODO */ public class DFS { public static void main(String[] args) { Configuration conf = new Configuration(); conf.set("fs.defaultFS", "hdfs://cluster1");//指定hdfs的nameservice为cluster1,是NameNode的URI conf.set("dfs.nameservices", "cluster1");//指定hdfs的nameservice为cluster1 conf.set("dfs.ha.namenodes.cluster1", "nna,nns");//cluster1下面有两个NameNode,分别是nna,nns conf.set("dfs.namenode.rpc-address.cluster1.nna", "10.211.55.26:9000");//nna的RPC通信地址 conf.set("dfs.namenode.rpc-address.cluster1.nns", "10.211.55.27:9000");//nns的RPC通信地址 conf.set("dfs.client.failover.proxy.provider.cluster1", "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider");//配置失败自动切换实现方式 FileSystem fs = null; try { fs = FileSystem.get(conf);//获取文件对象 FileStatus[] list = fs.listStatus(new Path("/"));//文件状态集合 for (FileStatus file : list) { System.out.println(file.getPath().getName());//打印目录名 } } catch (IOException e) { e.printStackTrace(); } finally { try { if (fs != null) { fs.close(); } } catch (IOException e) { e.printStackTrace(); } } } } 接下来,附上 Java 运行 MapReduce 程序的 API 代码。 2.2Java 运行 MapReduce 程序的 API 以 WordCount 为例子,代码如下: package cn.jpush.hdfs.mr.example; import java.io.IOException; import java.util.Random; import java.util.StringTokenizer; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.mapreduce.Reducer; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import cn.jpush.hdfs.utils.ConfigUtils; /** * * @author dengjie * @date 2014年11月29日 * @description Wordcount的例子是一个比较经典的mapreduce例子,可以叫做Hadoop版的hello world。 * 它将文件中的单词分割取出,然后shuffle,sort(map过程),接着进入到汇总统计 * (reduce过程),最后写道hdfs中。基本流程就是这样。 */ public class WordCount { private static Logger log = LoggerFactory.getLogger(WordCount.class); public static class TokenizerMapper extends Mapper<Object, Text, Text, IntWritable> { private final static IntWritable one = new IntWritable(1); private Text word = new Text(); /* * 源文件:a b b * * map之后: * * a 1 * * b 1 * * b 1 */ public void map(Object key, Text value, Context context) throws IOException, InterruptedException { StringTokenizer itr = new StringTokenizer(value.toString());// 整行读取 while (itr.hasMoreTokens()) { word.set(itr.nextToken());// 按空格分割单词 context.write(word, one);// 每次统计出来的单词+1 } } } /* * reduce之前: * * a 1 * * b 1 * * b 1 * * reduce之后: * * a 1 * * b 2 */ public static class IntSumReducer extends Reducer<Text, IntWritable, Text, IntWritable> { private IntWritable result = new IntWritable(); public void reduce(Text key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException { int sum = 0; for (IntWritable val : values) { sum += val.get(); } result.set(sum); context.write(key, result); } } @SuppressWarnings("deprecation") public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); conf.set("fs.defaultFS", "hdfs://cluster1"); conf.set("dfs.nameservices", "cluster1"); conf.set("dfs.ha.namenodes.cluster1", "nna,nns"); conf.set("dfs.namenode.rpc-address.cluster1.nna", "10.211.55.26:9000"); conf.set("dfs.namenode.rpc-address.cluster1.nns", "10.211.55.27:9000"); conf.set("dfs.client.failover.proxy.provider.cluster1", "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider"); long random1 = new Random().nextLong();// 重定下输出目录 log.info("random1 -> " + random1); Job job1 = new Job(conf, "word count"); job1.setJarByClass(WordCount.class); job1.setMapperClass(TokenizerMapper.class);// 指定Map计算的类 job1.setCombinerClass(IntSumReducer.class);// 合并的类 job1.setReducerClass(IntSumReducer.class);// Reduce的类 job1.setOutputKeyClass(Text.class);// 输出Key类型 job1.setOutputValueClass(IntWritable.class);// 输出值类型 FileInputFormat.addInputPath(job1, new Path("/home/hdfs/test/hello.txt"));// 指定输入路径 FileOutputFormat.setOutputPath(job1, new Path(String.format(ConfigUtils.HDFS.WORDCOUNT_OUT, random1)));// 指定输出路径 System.exit(job1.waitForCompletion(true) ? 0 : 1);// 执行完MR任务后退出应用 } } 3.运行结果 下面附上部分运行 Log 日志,如下所示: [Job.main] - Running job: job_local551164419_0001 2015-03-24 11:52:09 INFO [LocalJobRunner.Thread-12] - OutputCommitter set in config null 2015-03-24 11:52:09 INFO [LocalJobRunner.Thread-12] - OutputCommitter is org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter 2015-03-24 11:52:10 INFO [LocalJobRunner.Thread-12] - Waiting for map tasks 2015-03-24 11:52:10 INFO [LocalJobRunner.LocalJobRunner Map Task Executor #0] - Starting task: attempt_local551164419_0001_m_000000_0 2015-03-24 11:52:10 INFO [ProcfsBasedProcessTree.LocalJobRunner Map Task Executor #0] - ProcfsBasedProcessTree currently is supported only on Linux. 2015-03-24 11:52:10 INFO [Task.LocalJobRunner Map Task Executor #0] - Using ResourceCalculatorProcessTree : null 2015-03-24 11:52:10 INFO [MapTask.LocalJobRunner Map Task Executor #0] - Processing split: hdfs://cluster1/home/hdfs/test/hello.txt:0+24 2015-03-24 11:52:10 INFO [MapTask.LocalJobRunner Map Task Executor #0] - Map output collector class = org.apache.hadoop.mapred.MapTask$MapOutputBuffer 2015-03-24 11:52:10 INFO [MapTask.LocalJobRunner Map Task Executor #0] - (EQUATOR) 0 kvi 26214396(104857584) 2015-03-24 11:52:10 INFO [MapTask.LocalJobRunner Map Task Executor #0] - mapreduce.task.io.sort.mb: 100 2015-03-24 11:52:10 INFO [MapTask.LocalJobRunner Map Task Executor #0] - soft limit at 83886080 2015-03-24 11:52:10 INFO [MapTask.LocalJobRunner Map Task Executor #0] - bufstart = 0; bufvoid = 104857600 2015-03-24 11:52:10 INFO [MapTask.LocalJobRunner Map Task Executor #0] - kvstart = 26214396; length = 6553600 2015-03-24 11:52:10 INFO [LocalJobRunner.LocalJobRunner Map Task Executor #0] - 2015-03-24 11:52:10 INFO [MapTask.LocalJobRunner Map Task Executor #0] - Starting flush of map output 2015-03-24 11:52:10 INFO [MapTask.LocalJobRunner Map Task Executor #0] - Spilling map output 2015-03-24 11:52:10 INFO [MapTask.LocalJobRunner Map Task Executor #0] - bufstart = 0; bufend = 72; bufvoid = 104857600 2015-03-24 11:52:10 INFO [MapTask.LocalJobRunner Map Task Executor #0] - kvstart = 26214396(104857584); kvend = 26214352(104857408); length = 45/6553600 2015-03-24 11:52:10 INFO [MapTask.LocalJobRunner Map Task Executor #0] - Finished spill 0 2015-03-24 11:52:10 INFO [Task.LocalJobRunner Map Task Executor #0] - Task:attempt_local551164419_0001_m_000000_0 is done. And is in the process of committing 2015-03-24 11:52:10 INFO [LocalJobRunner.LocalJobRunner Map Task Executor #0] - map 2015-03-24 11:52:10 INFO [Task.LocalJobRunner Map Task Executor #0] - Task 'attempt_local551164419_0001_m_000000_0' done. 2015-03-24 11:52:10 INFO [LocalJobRunner.LocalJobRunner Map Task Executor #0] - Finishing task: attempt_local551164419_0001_m_000000_0 2015-03-24 11:52:10 INFO [LocalJobRunner.Thread-12] - map task executor complete. 2015-03-24 11:52:10 INFO [LocalJobRunner.Thread-12] - Waiting for reduce tasks 2015-03-24 11:52:10 INFO [LocalJobRunner.pool-6-thread-1] - Starting task: attempt_local551164419_0001_r_000000_0 2015-03-24 11:52:10 INFO [ProcfsBasedProcessTree.pool-6-thread-1] - ProcfsBasedProcessTree currently is supported only on Linux. 2015-03-24 11:52:10 INFO [Task.pool-6-thread-1] - Using ResourceCalculatorProcessTree : null 2015-03-24 11:52:10 INFO [ReduceTask.pool-6-thread-1] - Using ShuffleConsumerPlugin: org.apache.hadoop.mapreduce.task.reduce.Shuffle@1197414 2015-03-24 11:52:10 INFO [MergeManagerImpl.pool-6-thread-1] - MergerManager: memoryLimit=1503238528, maxSingleShuffleLimit=375809632, mergeThreshold=992137472, ioSortFactor=10, memToMemMergeOutputsThreshold=10 2015-03-24 11:52:10 INFO [EventFetcher.EventFetcher for fetching Map Completion Events] - attempt_local551164419_0001_r_000000_0 Thread started: EventFetcher for fetching Map Completion Events 2015-03-24 11:52:10 INFO [LocalFetcher.localfetcher#1] - localfetcher#1 about to shuffle output of map attempt_local551164419_0001_m_000000_0 decomp: 50 len: 54 to MEMORY 2015-03-24 11:52:10 INFO [InMemoryMapOutput.localfetcher#1] - Read 50 bytes from map-output for attempt_local551164419_0001_m_000000_0 2015-03-24 11:52:10 INFO [MergeManagerImpl.localfetcher#1] - closeInMemoryFile -> map-output of size: 50, inMemoryMapOutputs.size() -> 1, commitMemory -> 0, usedMemory ->50 2015-03-24 11:52:10 INFO [EventFetcher.EventFetcher for fetching Map Completion Events] - EventFetcher is interrupted.. Returning 2015-03-24 11:52:10 INFO [LocalJobRunner.pool-6-thread-1] - 1 / 1 copied. 2015-03-24 11:52:10 INFO [MergeManagerImpl.pool-6-thread-1] - finalMerge called with 1 in-memory map-outputs and 0 on-disk map-outputs 2015-03-24 11:52:10 INFO [Merger.pool-6-thread-1] - Merging 1 sorted segments 2015-03-24 11:52:10 INFO [Merger.pool-6-thread-1] - Down to the last merge-pass, with 1 segments left of total size: 46 bytes 2015-03-24 11:52:10 INFO [MergeManagerImpl.pool-6-thread-1] - Merged 1 segments, 50 bytes to disk to satisfy reduce memory limit 2015-03-24 11:52:10 INFO [MergeManagerImpl.pool-6-thread-1] - Merging 1 files, 54 bytes from disk 2015-03-24 11:52:10 INFO [MergeManagerImpl.pool-6-thread-1] - Merging 0 segments, 0 bytes from memory into reduce 2015-03-24 11:52:10 INFO [Merger.pool-6-thread-1] - Merging 1 sorted segments 2015-03-24 11:52:10 INFO [Merger.pool-6-thread-1] - Down to the last merge-pass, with 1 segments left of total size: 46 bytes 2015-03-24 11:52:10 INFO [LocalJobRunner.pool-6-thread-1] - 1 / 1 copied. 2015-03-24 11:52:10 INFO [deprecation.pool-6-thread-1] - mapred.skip.on is deprecated. Instead, use mapreduce.job.skiprecords 2015-03-24 11:52:10 INFO [Task.pool-6-thread-1] - Task:attempt_local551164419_0001_r_000000_0 is done. And is in the process of committing 2015-03-24 11:52:10 INFO [LocalJobRunner.pool-6-thread-1] - 1 / 1 copied. 2015-03-24 11:52:10 INFO [Task.pool-6-thread-1] - Task attempt_local551164419_0001_r_000000_0 is allowed to commit now 2015-03-24 11:52:10 INFO [FileOutputCommitter.pool-6-thread-1] - Saved output of task 'attempt_local551164419_0001_r_000000_0' to hdfs://cluster1/output/result/-3636988299559297154/_temporary/0/task_local551164419_0001_r_000000 2015-03-24 11:52:10 INFO [LocalJobRunner.pool-6-thread-1] - reduce > reduce 2015-03-24 11:52:10 INFO [Task.pool-6-thread-1] - Task 'attempt_local551164419_0001_r_000000_0' done. 2015-03-24 11:52:10 INFO [LocalJobRunner.pool-6-thread-1] - Finishing task: attempt_local551164419_0001_r_000000_0 2015-03-24 11:52:10 INFO [LocalJobRunner.Thread-12] - reduce task executor complete. 2015-03-24 11:52:10 INFO [Job.main] - Job job_local551164419_0001 running in uber mode : false 2015-03-24 11:52:10 INFO [Job.main] - map 100% reduce 100% 2015-03-24 11:52:10 INFO [Job.main] - Job job_local551164419_0001 completed successfully 2015-03-24 11:52:10 INFO [Job.main] - Counters: 35 File System Counters FILE: Number of bytes read=462 FILE: Number of bytes written=466172 FILE: Number of read operations=0 FILE: Number of large read operations=0 FILE: Number of write operations=0 HDFS: Number of bytes read=48 HDFS: Number of bytes written=24 HDFS: Number of read operations=13 HDFS: Number of large read operations=0 HDFS: Number of write operations=4 Map-Reduce Framework Map input records=2 Map output records=12 Map output bytes=72 Map output materialized bytes=54 Input split bytes=105 Combine input records=12 Combine output records=6 Reduce input groups=6 Reduce shuffle bytes=54 Reduce input records=6 Reduce output records=6 Spilled Records=12 Shuffled Maps =1 Failed Shuffles=0 Merged Map outputs=1 GC time elapsed (ms)=13 Total committed heap usage (bytes)=514850816 Shuffle Errors BAD_ID=0 CONNECTION=0 IO_ERROR=0 WRONG_LENGTH=0 WRONG_MAP=0 WRONG_REDUCE=0 File Input Format Counters Bytes Read=24 File Output Format Counters Bytes Written=24 原文件如下所示: a a c v d d a d d s s x Reduce 结果图,如下所示: 4.总结 我们可以按以下步骤进行验证代码的可用性: 保证 NNA( active 状态)和 NNS( standby 状态)。注意,DN 节点都是正常运行的。 然后,我们运行 WordCount 程序,看能否统计出结果。 若安上述步骤下来,可以统计;我们接着往下执行。若不行,请排查错误,然后继续。 然后,我们 kill 掉 NNA 节点的 NameNode 进程,此时,NNS 的状态会由 standby 转变为 active 接着我们在支持 WordCount 程序,看能否统计结果;若是能统计结果,表示代码可用。 以上就是整个验证的流程。 5.结束语 这篇文章就分享到这里,如果在验证的过程当中有什么问题,可以加群进行讨论或发送邮件给我,我会尽我所能为您解答,与君共勉!

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册