Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution
Highlighted

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

New Contributor
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

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

@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
Highlighted

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

@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

Highlighted

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

New Contributor

Thanks @jss

It Worked...

Highlighted

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

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 ?

.

Highlighted

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

New Contributor

@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

Highlighted

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

New Contributor

Ambari 2.1.2

HDP 2.3

Don't have an account?
Coming from Hortonworks? Activate your account here