`
thecloud
  • 浏览: 953799 次
文章分类
社区版块
存档分类
最新评论

Expected authority at index 7: hdfs://

 
阅读更多

hadoop版本:1.0.4

今天在跑TestForest的时候,居然出现了这个问题:

Exception in thread "main" java.lang.IllegalArgumentException: Expected authority at index 7: hdfs://
	at java.net.URI.create(URI.java:859)
	at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:131)
	at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:123)
	at org.apache.mahout.classifier.df.mapreduce.Classifier.run(Classifier.java:107)
	at org.apache.mahout.classifier.df.mapreduce.TestForest.mapreduce(TestForest.java:187)
	at org.apache.mahout.classifier.df.mapreduce.TestForest.testForest(TestForest.java:173)
	at org.apache.mahout.classifier.df.mapreduce.TestForest.run(TestForest.java:145)
	at mahout.fansy.partial.test.TestTestForest.main(TestTestForest.java:26)
Caused by: java.net.URISyntaxException: Expected authority at index 7: hdfs://
	at java.net.URI$Parser.fail(URI.java:2829)
	at java.net.URI$Parser.failExpecting(URI.java:2835)
	at java.net.URI$Parser.parseHierarchical(URI.java:3083)
	at java.net.URI$Parser.parse(URI.java:3034)
	at java.net.URI.<init>(URI.java:595)
	at java.net.URI.create(URI.java:857)
	... 7 more
我调用TestForest的代码如下:

package mahout.fansy.partial.test;

import org.apache.hadoop.conf.Configuration;
import org.apache.mahout.classifier.df.mapreduce.TestForest;

public class TestTestForest {

	/**
	 * 测试TestForest
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		String[] arg=new String[]{"-i","hdfs://ubuntu:9000/user/breiman/input/glass.data",
				"-ds","hdfs://ubuntu:9000/user/breiman/glass.info",
				"-m","hdfs://ubuntu:9000/user/breiman/glass.tree/forest.seq",
				"-a","-mr",
				"-o","hdfs://ubuntu:9000/user/breiman/out-testforest0"};
		Configuration conf=new Configuration();
		conf.set("mapred.job.tracker", "ubuntu:9001");
		conf.set("fs.default.name", "hdfs://");
		TestForest tf=new TestForest();
		tf.setConf(conf);
		Configuration confq=tf.getConf();
		System.out.println(confq);
		tf.run(arg);
	}

}
刚开始的时候是直接使用TestForest.main(arg)来调用的,但是发现conf的值设置不了(即全部都是按照默认,这个肯定不行,在win7 的myeclipse上面调用hadoop肯定要设置conf的)但是哪里可以设置,所以就想到了TestForest是继承Configuration的,然后Configuration有一个setConf的方法,所以就实例化了一个TestForest对象,然后调用setConf方法设置conf,但是conf设置的不对,所以出现了上面的错误。要如何设置呢?其实把conf.set("fs.default.name", "hdfs://");改为conf.set("fs.default.name", "ubuntu:9000");就可以了,其中ubuntu是主节点机器名。然后就可以跑了。

分享,成长,快乐

转载请注明blog地址:http://blog.csdn.net/fansy1990


分享到:
评论

相关推荐

    hbase 启动regionserver日志报错: Wrong FS: hdfs:// .regioninfo, expected: file:///

    NULL 博文链接:https://bnmnba.iteye.com/blog/2322332

    根据WSDL文件生成客户端代码与创建客户端工程

    根据WSDL文件生成客户端代码与创建客户端工程 注意小细节:在根据对方提供的... 否则报:WSDLException (at /html): faultCode=INVALID_WSDL: Expected element '{http://schemas.xmlsoap.org/wsdl/}definitions'.:

    linux php开启openssl拓展报错时候替换本机的openssl文件夹

    出现以下报错,替换/usr/...add_assoc_name_entry’:/data/src/php-5.6.23/ext/openssl/openssl.c:664: warning: ‘ASN1_STRING_data’ is deprecated (declared at /usr/local/include/openssl/asn1.h:553)/data/src/...

    解决:dubbo找不到dubbo.xsd报错

    Multiple annotations found at this line: - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application'. - schema_reference.4: Failed to ...

    springmodules-cache.xsd&springmodules-ehcache.xsd.rar

    解决web.xml中 &lt;page-encoding&gt;UTF-8&lt;/page-encoding&gt;报错。错误提示: cvc-complex-type.2.4.a: Invalid content was found starting ... java.sun.com/xml/ns/javaee":error-on-undeclared-namespace}' is expected.

    spring 最新框架jar

    By participating, you are expected to uphold this code. Please report unacceptable behavior to spring-code-of-conduct@pivotal.io. ## Downloading Artifacts See [downloading Spring artifacts][] for ...

    xmlpull_1_0_5解决 org/xmlpull/v1/XmlPullParserException

    7. **调试XStream配置**:检查XStream的转换器设置,确保它们能正确地处理所有要序列化或反序列化的对象。 总之,要解决`org/xmlpull/v1/XmlPullParserException`,首先需要分析具体的错误信息,然后根据上述步骤...

    python实现歌声伴奏分离实验与开发

    This is more or less a wrapper for Matplotlib imaging functions such that their behavior is equivalent, in terms of colormap, aspect and so forth, to the expected behavior of Matlab's functions. ...

    RC531详细英文资料和程序

    // expected port pin of the microcontroller. // char M500PcdReset(void); // _____________________________________________________________________________ // // FUNCTION: M500PcdConfig // IN: - // OUT...

    http-error-parse:NodeJS HTTP 错误解析。 给定一个错误堆栈对象,获取一条消息和_或相关的 HTTP 响应代码(404、400、401 等)

    http-error-parse 给定错误堆栈对象,获取一条消息和/或关联的HTTP响应代码(404、400、401等) 我创建它是为了与 express.js 一起使用,但它应该能够处理不同类型的错误,并智能地返回 HTTP 响应代码和简单的字符串...

    esp-idf 1/2

    从GitHub下载的ESP-IDF库(包括所有子模块)压缩包,git clone --recursive https://github.com/espressif/esp-idf.git,从GitHub下载日期为20200401,由于整个包大于CSDN限制,所以被分为两个分包,分别为esp-idf 1...

    delphi问题常见解决

    1. **“statement expected but procedure found”**:这个错误提示表明在编译器尝试找到一个语句的地方,它却找到了一个过程(Procedure)的定义。这通常意味着你在某个过程或函数的定义中忘记了关闭的`end`关键字...

    关于springboot我出过的那些错误.docx

    错误二:org.apache.jasper.JasperException: /WEB-INF/jsp/show.jsp (line: [2], column: [18]) quote symbol expected 错误原因:show.jsp 中第二行少了个“” 解决方式:加上缺少的“ 错误三:org.apache....

    Spark hadoop票据过期问题HDFS_DELEGATION_TOKEN

    Spark Streaming应用程序在运行7天后自动退出,日志中显示一个与用户相关的HDFS_DELEGATION_TOKEN已经过期。这个令牌的信息包括所有者(owner)、续订者(renewer)、发行日期、最大日期(即过期时间)、序列号和主...

    nsq-master源码

    to verify things worked as expected, in a web browser open http://127.0.0.1:4171/ to view the nsqadmin UI and see statistics. Also, check the contents of the log files (test.*.log) written to /tmp. ...

    外网无法访问HDFS org.apache.hadoop.hdfs.BlockMissingException: Could not obtain block

    今天使用自己的电脑,使用外网操作阿里云服务器上的HDFS。 报错 org.apache.hadoop.hdfs.BlockMissingException: Could not obtain block 2、百度结果 参考 ...

    RedPanda C++

    小熊猫C++ (曾经用过的名称: 小熊猫Dev-C++ 7) 是一款快速、轻量、开源并且跨平台的C/C++/GNU的编译工具。(Assembly IDE). 简体中文网站: http://royqh.net/redpandacpp 英文网站: ...

Global site tag (gtag.js) - Google Analytics