6,086
社区成员




hadoop的版本是3.3.6,keycloak是docker上直接拉的18.0的镜像,找ds问ds给的方案是在core-site.xml里面加上像下面的配置,但是加上后就启动不了hadoop了,还显示Starting datanodes localhost: ERROR: Cannot set priority of datanode process 4556 Exception in thread "main" java.lang.IllegalArgumentException: Invalid attribute value for hadoop.security.authentication of oauth2 at org.apache.hadoop.security.SecurityUtil.getAuthenticationMethod(SecurityUtil.java:735) at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:312) at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:300) at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:575) at org.apache.hadoop.hdfs.tools.GetConf.run(GetConf.java:344) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:82) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:97) at org.apache.hadoop.hdfs.tools.GetConf.main(GetConf.java:361)
<configuration>
<!-- 启用OAuth2认证类型 -->
<property>
<name>hadoop.security.authentication</name>
<value>oauth2</value>
</property>
<!-- OAuth2客户端凭证 -->
<property>
<name>hadoop.security.oauth2.client.id</name>
<value>hadoop-webhdfs-client</value> <!-- Keycloak中注册的客户端ID -->
</property>
<property>
<name>hadoop.security.oauth2.client.secret</name>
<value>your_client_secret_here</value> <!-- Keycloak中生成的客户端密钥 -->
</property>
<!-- OAuth2服务端点 -->
<property>
<name>hadoop.security.oauth2.token.endpoint</name>
<value>http://keycloak-host:port/realms/hadoop-realm/protocol/openid-connect/token</value>
</property>
<property>
<name>hadoop.security.oauth2.authorization.endpoint</name>
<value>http://keycloak-host:port/realms/hadoop-realm/protocol/openid-connect/auth</value>
</property>
<!-- WebHDFS访问模式 -->
<property>
<name>hadoop.http.authentication.type</name>
<value>oauth2</value>
</property>
</configuration>