Java Unknown exception



0

I cannot find Java version 1.7.0_21, do I need that specific version of Java for this coures or will Java 1.7.0_79 work?

I am having issues with Java version 1.7.0_79 I cannot find the version stated in the course does that make a difference? When configuring hadoop and doing hadoop namenode - format I get unknown exception java.net.


14 Answer(s)


0

Hi William,

You can use the Java version 1.7.9_91. It doesn't make any difference.
If you are getting exception. Please share the complete error code with me. I will be glad to help.

Thanks.


0

It looks like I have it working but in order to run start-all.sh  - I had to use sudo - so I have a security issue - what should I check?


0

Hi William,

You can assign the current user as sudo.

Method-1 :

You need to add the user hduser(username) to the sudo group (which is the "administrators" group in Ubuntu).

If you have already created the user, you can add the user to the sudo group by running the following command in a Terminal:

sudo usermod -a -G sudo hduser

 

Method-2 :

1) Become root. You can do this using sudo -i or becoming root the old fashioned way su -

2) Run visudo

3) I changed this portion of the sudoers file to have my chosen users become sudo users, and you can add users similarly (blank lines introduce to format cleanly):

## User Aliases
## These aren't often necessary, as you can use regular groups
## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname
## rather than USERALIAS
# User_Alias ADMINS = jsmith, mikem dbadmin 
ALL=(ALL) ALL
ics ALL=(ALL) ALL 
csm ALL=(ALL) ALL 
coa ALL=(ALL) ALL

4) Press : and x to write the changes to sudoers and exit vi.

 

Hope this helps.

Thanks.


0

I have added the wheel group

When I format the namenode I get java.net exception error

Shutting down NameNode at java.net.UnknownHostException:

Attached is the log file



0

When I do a start-all.sh it keeps asking me to put a password in.  I have added hduser to hadoop and done all the chmods listed in the course is there a permission i am missing

 


0

sudo usermod -a -G wheel hduser

I did this command to hduser admin privledges but still running into exception s error and asking for passwords

 

Below is part what I pulled out of a log file and the error messages that I am recieving

org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:hduser cause:java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
2016-05-17 17:46:57,187 INFO org.apache.hadoop.ipc.Server: IPC Server handler 6 on 9000, call addBlock(/tmp/hadoop-hduser/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_321108174_1, null) from 127.0.0.1:59878: error: java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1920)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:783)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)
2016-05-17 17:46:58,218 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:hduser cause:java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
2016-05-17 17:46:58,218 INFO org.apache.hadoop.ipc.Server: IPC Server handler 2 on 9000, call addBlock(/tmp/hadoop-hduser/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_321108174_1, null) from 127.0.0.1:59878: error: java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1920)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:783)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)
2016-05-17 17:46:59,234 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:hduser cause:java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
2016-05-17 17:46:59,234 INFO org.apache.hadoop.ipc.Server: IPC Server handler 8 on 9000, call addBlock(/tmp/hadoop-hduser/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_321108174_1, null) from 127.0.0.1:59878: error: java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1920)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:783)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)
2016-05-17 17:47:00,259 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:hduser cause:java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
2016-05-17 17:47:00,259 INFO org.apache.hadoop.ipc.Server: IPC Server handler 4 on 9000, call addBlock(/tmp/hadoop-hduser/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_321108174_1, null) from 127.0.0.1:59878: error: java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1920)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:783)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)
2016-05-17 17:47:01,286 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:hduser cause:java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
2016-05-17 17:47:01,286 INFO org.apache.hadoop.ipc.Server: IPC Server handler 0 on 9000, call addBlock(/tmp/hadoop-hduser/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_321108174_1, null) from 127.0.0.1:59878: error: java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1920)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:783)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)
2016-05-17 17:47:02,311 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:hduser cause:java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
2016-05-17 17:47:02,311 INFO org.apache.hadoop.ipc.Server: IPC Server handler 6 on 9000, call addBlock(/tmp/hadoop-hduser/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_321108174_1, null) from 127.0.0.1:59878: error: java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
java.io.IOException: File /tmp/hadoop-hduser/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1920)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:783)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)
2016-05-17 17:47:12,135 INFO org.apache.hadoop.hdfs.server.namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at java.net.UnknownHostException: Huntress: Huntress: Name or service not known
************************************************************/


0

java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)


0

When I try to execute command: jps

jps command not found


0

Hi William,

I tried to reach you call regarding your issue.

Please try this command:

sudo vi .bashrc

Please let me know what is the output.

Thanks.


0

Hello: Abhijit

Thank you for contacting me - I appreciate the help

here is my out put from bashrc from root

Root user bashrc

# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
export JAVA_HOME=/usr/lib/java/jdk1.7.0_21
export JRE_HOME=/usr/lib/java/jdk1.7.0_21/jre
export PATH=$PATH:$JAVA_HOME:$JRE_HOME


Here is my bashrc from hduser

hduser bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions
export JAVA_HOME='/usr/lib/java/jdk1.7.0_21'
export JRE_HOME='/usr/lib/java/jdk1.7.0_21/jre'
export HADOOP_PREFIX='/usr/lib/hadoop/hadoop-1.2.1'
export HADOOP_HOME=$HADOOP_PREFIX/bin
export PATH=$PATH:$JAVA_HOME:$JRE_HOME:$HADOOP_PREFIX:$HADOOP_HOME

 


0

I am available by phone  right now

714 655 2113

Thanks


0

0

0

Hi William,

Thanks for your time on call.

Please let me know if you have any more queries.

Thanks.