Hello,
I’ve been fighting this issue for months now, and my first few pages of Google all contain purple links.
I have an old HDFS/Spark cluster, and a new HDFS/Spark cluster, set up nearly identically, both with kerberos authentication enabled.
The old cluster is running on CentOS 07, and the new cluster is installed on RHEL 8.4. Jupyterhub is installed on an edge node on each cluster, and the config files for Jupyterhub are nearly identical, the only difference being that they point to slightly different folders because the path has different versions of software.
On the old cluster, using Python in Jupyter, we use os.system(kinit -kt user.keytab) to authenticate to HDFS, and from there, we can use os.system to run HDFS commands to view, move, or write files within HDFS.
On the new cluster, we can successfully invoke a keytab using os.system. I can run klist to verify my keytab is being seen, but when I try to interact with HDFS (and spark for that matter), I get an error that indicates my keytab is not good, with the error:
WARN ipc.Client: Exception encountered while connecting to the server : org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[TOKEN, KERBEROS]
ls: DestHost:destPort namenode.mylocation.local:8020 , LocalHost:localPort edgenode.mylocation.local/10.200.216.101:0. Failed on local exception: java.io.IOException: org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[TOKEN, KERBEROS]
This would be with HDFS commands that work fine from the terminal for my keytab.
I can get the same results if I use ! in Juptyerhub.
HOWEVER: I can run the same code as straight python successfully from the terminal on the new cluster. Running the code in the terminal using jupyterhub to run the notebook has gotten mixed results. For some things it works, for other things, I have to put the juptyerhub command string in a bash script, and the bash script will work, but not invoking the notebook directly.
I have tried so many different approaches. I have made sure the full path to the keytab is readable by everything. I have made sure all the environmental variables are similar (again, different versions, slightly different locations for some things because of OS). I have made sure the krb5 packages are installed on the new system. All the relevant python packages are installed on the new system.
I could write about 3 more pages about what I’ve tried that also didn’t work. Any suggestions for a solution would be greatly appricated.
Thanks,
Eric