pc83@pc83-ThinkCentre-M92p:~$ start-all.sh
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
15/10/12 13:24:26 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Incorrect configuration: namenode address dfs.namenode.servicerpc-address or dfs.namenode.rpc-address is not configured.
Starting namenodes on []
localhost: starting namenode, logging to /usr/local/hadoop/logs/hadoop-pc83-namenode-pc83-ThinkCentre-M92p.out
localhost: starting datanode, logging to /usr/local/hadoop/logs/hadoop-pc83-datanode-pc83-ThinkCentre-M92p.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-pc83-secondarynamenode-pc83-ThinkCentre-M92p.out
0.0.0.0: Exception in thread "main" java.lang.IllegalArgumentException: Illegal character in authority at index 7: hdfs://localhost:9000
0.0.0.0: at java.net.URI.create(URI.java:859)
0.0.0.0: at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:177)
0.0.0.0: at org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:412)
0.0.0.0: at org.apache.hadoop.hdfs.server.namenode.NameNode.getServiceAddress(NameNode.java:406)
0.0.0.0: at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.initialize(SecondaryNameNode.java:229)
0.0.0.0: at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.<init>(SecondaryNameNode.java:192)
0.0.0.0: at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.main(SecondaryNameNode.java:671)
0.0.0.0: Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: hdfs://localhost:9000
0.0.0.0: at java.net.URI$Parser.fail(URI.java:2829)
15/10/12 13:24:42 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
starting yarn daemons
starting resourcemanager, logging to /usr/local/hadoop/logs/yarn-pc83-resourcemanager-pc83-ThinkCentre-M92p.out
localhost: starting nodemanager, logging to /usr/local/hadoop/logs/yarn-pc83-nodemanager-pc83-ThinkCentre-M92p.out
pc83@pc83-ThinkCentre-M92p:~$
在上面的代码中,我想启动像
namenode,datanode,secondarynamenode,node manager
命令抛出错误提示
java.lang.IllegalArgumentException: Illegal character in authority at index 7:
所以要克服这个问题,我必须要做的。
最佳答案
我有同样的错误。由于名为core-site.xml
的Hadoop配置文件,导致出现此错误。您的core-site.xml
可能包含以下给出的代码:
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000 </value>
</property>
</configuration>
发生错误是因为9000和
</value>
之间存在空格。要克服此问题,请使用以下代码段替换
core-site.xml
:<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
您必须删除
9000 </valve>
之间的空格,该空格应类似于9000</value>
。关于hadoop - 启动namenode和datanode时出错,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33076012/