hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adams Liam (INST/BSV-AM)" <Liam.Ad...@bosch-si.com>
Subject Simple authentication
Date Sun, 31 Jan 2016 00:01:29 GMT
Resending as I sent this before it was confirmed that I was subscribed

From: Adams Liam (INST/BSV-AM)
Sent: Saturday, January 30, 2016 4:55 PM
To: 'user@hadoop.apache.org' <user@hadoop.apache.org>
Subject: Simple authentication

Hi,

I am trying to connect to my remote hadoop instance through a java client.

public static void main(String[] args) {
              try {
                     UserGroupInformation ugi = UserGroupInformation.createRemoteUser("vagrant");
                     ugi.doAs(new PrivilegedExceptionAction<Void>() {

                           public Void run() throws Exception {
                                  Configuration conf = new Configuration();
//                                conf.set("fs.defaultFS", "hdfs://10.1.10.213:8042/user/test");
                                  conf.set("hadoop.job.ugi", "vagrant");
                                  FileSystem fs = FileSystem.get(conf);
                                  fs.createNewFile(new Path("user/test/test-file"));
                                  FileStatus[] status = fs.listStatus(new Path("/user/test"));
                                  for(int i=0; i<status.length; i++)
                        System.out.println(status[i].getPath());

                                  return null;
                           }
                     });
              } catch(Exception e) {
                     e.printStackTrace();
              }
       }

When I execute this I get the following exception.

Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException):
SIMPLE authentication is not enabled.  Available:[TOKEN]
       at org.apache.hadoop.ipc.Client.call(Client.java:1468)
       at org.apache.hadoop.ipc.Client.call(Client.java:1399)
       at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:232)
       at com.sun.proxy.$Proxy9.getFileInfo(Unknown Source)

I have hadoop.security.authentication set to simple and hadoop.security.authorization set
to false in core-site.xml on my remote hadoop instance.  What am I doing wrong?  Any help
is much appreciated.

Best regards,

Liam Adams

Bosch Software Innovations Corp.
161 N. Clark Street, Suite 3550
Chicago, Illinois 60601 USA
www.bosch-si.com<http://www.bosch-si.com/>
Tel. +1 312 368-2527
Cell. +1 312 898 8861
liam.adams@bosch-si.com<mailto:kavita.bansal@bosch-si.com>


This message may contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended recipient, please
inform us immediately and destroy this message including all copies thereof.


Mime
View raw message