Linux 搭建Hadoop集群执行命令start-dfs.sh报错

[root@node01 hadoop-2.7.5]# sbin/start-dfs.sh
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
Starting namenodes on [node01]
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node01: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
node01: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node01: Error: JAVA_HOME is not set and could not be found.
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node01: ssh: Could not resolve hostname \357\273\277node01: Name or service not known
node03: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
node03: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node03: Error: JAVA_HOME is not set and could not be found.
node02: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
node02: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node02: Error: JAVA_HOME is not set and could not be found.
Starting secondary namenodes [node01]
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node01: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
node01: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node01: Error: JAVA_HOME is not set and could not be found.
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
[root@node01 hadoop-2.7.5]# sbin/start-dfs.sh
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
Starting namenodes on [node01]
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node01: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
node01: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node01: Error: JAVA_HOME is not set and could not be found.
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node02: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
node02: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node02: Error: JAVA_HOME is not set and could not be found.
node03: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
node03: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node03: Error: JAVA_HOME is not set and could not be found.
node01: ssh: Could not resolve hostname \357\273\277node01: Name or service not known
Starting secondary namenodes [node01]
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node01: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
node01: /export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
node01: Error: JAVA_HOME is not set and could not be found.
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1: syntax error near unexpected token ('
/export/servers/hadoop-2.7.5/etc/hadoop/hadoop-env.sh: line 1:
# Licensed to the Apache Software Foundation (ASF) under one'
You have new mail in /var/spool/mail/root

你好,这个是因为你在修改hadoop配置文件的时候出现了错误,你是不是使用了第三方编辑工具比如Notepad++编辑,建议你先删除hadoop文件,重新解压安装,然后直接在linux界面修改一遍配置文件,就能启动了