我试图配置一个名称节点和四个数据节点的hadoop.我能够在一台机器上成功配置名称节点和作业跟踪器并将其启动.
但是在我要配置数据节点的机器上,我执行了以下操作:
hadoop-2.0.0-cdh4.1.2.tar.gz并mr1-2.0.0-mr1-cdh4.1.2.tar.gz进入文件夹并使用主服务器和从服务器设置配置.master文件中,我设置了配置为名称节点的计算机的IP地址.当我尝试使用该命令启动数据节点时
hdfs datanode
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
java.io.IOException: Incorrect configuration: namenode address dfs.namenode.servicerpc-address or dfs.namenode.rpc-address is not configured.
Run Code Online (Sandbox Code Playgroud)
我需要做什么?
我正在尝试使用EMR中的工作流将文件从s3复制到hdfs,当我运行以下命令时,作业流程成功启动但在尝试将文件复制到HDFS时出现错误.我是否需要设置任何输入文件权限?
命令:
./elastic-mapreduce --jobflow j-35D6JOYEDCELA --jar s3://us-east-1.elasticmapreduce/libs/s3distcp/1.latest/s3distcp.jar --args'-- src,s3:// odsh /输入/, - DEST,HDFS:///用户
产量
任务TASKID ="task_201301310606_0001_r_000000"TASK_TYPE ="REDUCE"TASK_STATUS ="FAILED"FINISH_TIME ="1359612576612"ERROR ="java.lang.RuntimeException:Reducer任务无法复制1个文件:s3://odsh/input/GL_01112_20121019.dat等位于org.apache.hadoop.mapred.ReduceTask的org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:538)的com.amazon.external.elasticmapreduce.s3distcp.CopyFilesReducer.close(CopyFilesReducer.java:70) .run(ReduceTask.java:429)位于javax.security.auth.Subject的java.security.AccessController.doPrivileged(Native Method)的org.apache.hadoop.mapred.Child $ 4.run(Child.java:255). doA(Subject.java:396)org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1132)atg.apache.hadoop.mapred.Child.main(Child.java:249)
我已经通过下载 tar ball 安装了 git,然后执行以下步骤
./configure --prefix=/scratch/custom/git
make
make install
Run Code Online (Sandbox Code Playgroud)
但是在运行这些命令后,我仍然看到 git 是在/usr/local下面创建的
bash-4.1$ whereis git
git: /usr/bin/git /usr/local/git /usr/share/man/man1/git.1.gz
Run Code Online (Sandbox Code Playgroud)
我想删除并重新安装,我该怎么做?
我正在创建多个线程,并且所有线程都读取相同的属性文件(没有对属性文件执行写操作).这是否会导致性能开销,因为多个线程会多次读取同一属性文件?
我使用下面的maven插件将swagger与我的应用程序集成 https://github.com/martypitt/swagger-springmvc
我在我的spring servlet xml中配置了以下内容
<mvc:annotation-driven/> <!-- Required so swagger-springmvc can access spring's RequestMappingHandlerMapping -->
<bean class="com.mangofactory.swagger.configuration.SpringSwaggerConfig" />
<mvc:default-servlet-handler/>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations" >
<list>
<value>/WEB-INF/swagger.properties</value>
</list>
</property>
</bean>
Run Code Online (Sandbox Code Playgroud)
我的招摇属性如下所示
documentation.services.basePath = http://payrollservice.com/customservice documentation.services.version = 1.0
我生成的api-docs.json如下所示,我不确定为什么它没有基本路径,为什么它有前缀"/ default"
{
apiVersion: "1.0",
swaggerVersion: "1.2",
apis: [
{
path: "/default/custom-controller",
description: "backupset API"
}
],
info: {
title: "default Title",
description: "Api Description",
termsOfServiceUrl: "Api terms of service",
contact: "Contact Email",
license: "Licence Type",
licenseUrl: "License URL"
}
}
Run Code Online (Sandbox Code Playgroud) 我试图在hadoop中读取包含一些聚合数据的Excel文件.地图缩减程序似乎工作正常但输出产生的格式不可读.我需要在Hadoop中使用任何特殊的InputFormat读取器用于Excel文件Map Reduce?.我的配置如下
Configuration conf=getConf();
Job job=new Job(conf,"LatestWordCount");
job.setJarByClass(FlightDetailsCount.class);
Path input=new Path(args[0]);
Path output=new Path(args[1]);
FileInputFormat.setInputPaths(job, input);
FileOutputFormat.setOutputPath(job, output);
job.setMapperClass(MapClass.class);
job.setReducerClass(ReduceClass.class);
//job.setCombinerClass(ReduceClass.class);
job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);
job.setMapOutputKeyClass(Text.class);
job.setMapOutputValueClass(Text.class);
//job.setOutputKeyClass(Text.class);
//job.setOutputValueClass(Text.class);
System.exit(job.waitForCompletion(true)?0:1);
return 0;
Run Code Online (Sandbox Code Playgroud)
输出产品看起来像这样 KW O A ]n Ε r3 \n" p 6W jJ 9W f= 9ml dR y /Ք 7 ^ i M*Ք ^nz l ^ ) j ( dRͱ/7 TS* M//7 TS &jZoTSR7 @)oTӺ5{%+ۆw6- = E_}米)〜ʅ ژ :# j ] u >
我试图在单词列表上使用stringtokenizer,如下所示
String sentence=""Name":"jon" "location":"3333 abc street" "country":"usa"" etc
Run Code Online (Sandbox Code Playgroud)
当我使用stringtokenizer并将空格作为分隔符,如下所示
StringTokenizer tokens=new StringTokenizer(sentence," ")
Run Code Online (Sandbox Code Playgroud)
我期待我的输出作为不同的令牌,如下所示
Name:jon
location:3333 abc street
country:usa
Run Code Online (Sandbox Code Playgroud)
但字符串标记器也试图对位置的值进行标记,看起来就像
Name:jon
location:3333
abc
street
country:usa
Run Code Online (Sandbox Code Playgroud)
请让我知道我如何解决上述问题,如果我需要做一个正则表达式,我应该指定什么样的表达式?