duongkame commented on code in PR #4597:
URL: https://github.com/apache/ozone/pull/4597#discussion_r1190675513


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecretKeysApi.java:
##########
@@ -155,11 +156,12 @@ private void setSecureConfig() throws IOException {
 
     String realm = miniKdc.getRealm();
     String hostAndRealm = host + "@" + realm;
-    conf.set(HDDS_SCM_KERBEROS_PRINCIPAL_KEY, "scm/" + hostAndRealm);
+    ozonePrincipal = "scm/" + hostAndRealm;
+    conf.set(HDDS_SCM_KERBEROS_PRINCIPAL_KEY, ozonePrincipal);
     conf.set(HDDS_SCM_HTTP_KERBEROS_PRINCIPAL_KEY, "HTTP_SCM/" + hostAndRealm);
-    conf.set(OZONE_OM_KERBEROS_PRINCIPAL_KEY, "scm/" + hostAndRealm);
+    conf.set(OZONE_OM_KERBEROS_PRINCIPAL_KEY, ozonePrincipal);

Review Comment:
   Before, when I tried using separate principals for OM, SCM & Datanodes, 
always get errors at connection authentication, e.g. when OM connects to SCM:
   ```
           
org.apache.hadoop.ipc.RemoteException(javax.security.sasl.SaslException): GSS 
initiate failed
        at 
org.apache.hadoop.security.SaslRpcClient.saslConnect(SaslRpcClient.java:376)
        at 
org.apache.hadoop.ipc.Client$Connection.setupSaslConnection(Client.java:577)
        at org.apache.hadoop.ipc.Client$Connection.access$2100(Client.java:363)
        at org.apache.hadoop.ipc.Client$Connection$2.run(Client.java:800)
        at org.apache.hadoop.ipc.Client$Connection$2.run(Client.java:796)
        at java.security.AccessController.doPrivileged(Native Method)
   ```
   I spent some hours today redebugging this issue but didn't get far. It looks 
like a limitation of `MiniKDC`. All the integration tests in HDFS use the same 
principal for namenode & datanode.
   
   
https://github.com/apache/hadoop/blob/fe61d8f073b07be250bcbbb07fb44baed2acf6c2/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/auth/delegation/MiniKerberizedHadoopCluster.java#L252C1-L259



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to