1
2
3
4
|
Caused
by
:
org.apache.hadoop.ipc.RemoteException
(
org.apache.hadoop.security.AccessControlException
)
:
Permission denied
:
user
=
iteblog
,
access
=
EXECUTE
,
inode
=
"/user/hadoop"
:
iteblog
:
iteblog
:
drwx
------
|
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
Principal user
=
null;
/
/
if
we are
using
kerberos
,
try
it
out
if
(
isAuthenticationMethodEnabled
(
AuthenticationMethod.KERBEROS
)
)
{
user
=
getCanonicalUser
(
KerberosPrincipal.
class
)
;
if
(
LOG.isDebugEnabled
(
)
)
{
LOG.debug
(
"using kerberos user:"
+
user
)
;
}
}
/
/
If we don't have a kerberos user
and
security
is
disabled
,
check
/
/
if
user
is
specified
in
the
environment
or
properties
if
(
!isSecurityEnabled
(
)
&
&
(
user
=
=
null
)
)
{
String envUser
=
System.getenv
(
HADOOP_USER_NAME
)
;
if
(
envUser
=
=
null
)
{
envUser
=
System.getProperty
(
HADOOP_USER_NAME
)
;
}
user
=
envUser
=
=
null ? null
:
new
User
(
envUser
)
;
}
/
/
use
the
OS user
if
(
user
=
=
null
)
{
user
=
getCanonicalUser
(
OS_PRINCIPAL_CLASS
)
;
if
(
LOG.isDebugEnabled
(
)
)
{
LOG.debug
(
"using local user:"
+
user
)
;
}
}
/
/
if
we found
the
user
,
add
our principal
if
(
user !
=
null
)
{
subject.getPrincipals
(
)
.
add
(
new
User
(
user.getName
(
)
)
)
;
return
true
;
}
LOG.
error
(
"Can't find user in "
+
subject
)
;
throw
new
LoginException
(
"Can't find user name"
)
;
|
1
2
3
4
|
<
property
>
<
name
>
hadoop.security.authentication
<
/
name
>
<
value
>
simple
<
/
value
>
<
/
property
>
|
1
|
|
1
2
3
4
5
6
7
|
val ugi
=
UserGroupInformation.createRemoteUser
(
"iteblog"
)
ugi.doAs
(
new
PrivilegedExceptionAction[Void]
(
)
{
def
run
(
)
:
Void
=
{
/
/
something todo
return
null
}
}
)
|