Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

DataNode give syntax error: unexpected end of file and failes to start

avatar
Explorer
1 ACCEPTED SOLUTION

avatar

@Sampath Kumar

What happens when you try to start the Datanode manually from that host:

[root@erie1 ~]$  /var/lib/ambari-server/ambari-sudo.sh su hdfs -l -s /bin/bash -c 'ulimit -c unlimited'

[root@erie1 ~]$  su - hdfs 

[hdfs@erie1 ~]$  /usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh --config /usr/hdp/current/hadoop-client/conf start datanode 

This will help in isolating the issue.

Just incase if you find the same kind of error there as well then please check the first few lines of the script on that host if it is correct.

/usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh

.

View solution in original post

5 REPLIES 5

avatar

@Sampath Kumar

What happens when you try to start the Datanode manually from that host:

[root@erie1 ~]$  /var/lib/ambari-server/ambari-sudo.sh su hdfs -l -s /bin/bash -c 'ulimit -c unlimited'

[root@erie1 ~]$  su - hdfs 

[hdfs@erie1 ~]$  /usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh --config /usr/hdp/current/hadoop-client/conf start datanode 

This will help in isolating the issue.

Just incase if you find the same kind of error there as well then please check the first few lines of the script on that host if it is correct.

/usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh

.

avatar
Explorer

Thanks @jss

It Worked...

avatar

I am suspecting that you might have an extra (`) back tick character in the beginning of that file.

I can reproduce the similar error at my end by intentionally editing the file and adding a ` (back tick at the very first line of this script)

Example:

[hdfs@erie1 ~]$  /usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh --config /usr/hdp/current/hadoop-client/conf stop datanode

/usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh: line 195: unexpected EOF while looking for matching ``'

/usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh: line 221: syntax error: unexpected end of file

Also which version of ambari & hdp is it ?

.

avatar
Explorer

@JSS

I didnt get any error with those 3 commands

below is the output I got when I ran the commands

starting datanode, logging to /var/log/hadoop/hdfs/hadoop-hdfs-datanode-ecsf00200104.out

avatar
Explorer

Ambari 2.1.2

HDP 2.3