RANGER-5728: Update stress_kms script to run against Keberos enabled . - #1143
RANGER-5728: Update stress_kms script to run against Keberos enabled .#1143vikaskr22 wants to merge 1 commit into
Conversation
| ## | ||
| kms_url = 'http://localhost:9292' | ||
| kms_auth = HadoopSimpleAuth('keyadmin') | ||
| kms_auth_type = 'kerberos' # 'simple' | 'kerberos' |
There was a problem hiding this comment.
Is use of kms_auth_type necessary? To keep this script simple, I suggest directly setting kms_auth in line 81 below:
# use Hadoop simple authentication
kms_auth = HadoopSimpleAuth(kms_user)
# uncomment following 2 lines to use Kerberos authentication
# from requests_kerberos import HTTPKerberosAuth, DISABLED
# kms_auth = HTTPKerberosAuth(mutual_authentication=DISABLED)
There was a problem hiding this comment.
thanks for the review @mneethiraj .
Actually I simply tried to keep all the parameters that can be modified at one place, this way it remains consistent with other params like kms_user, kms_url etc.
With explicit kms_auth_type along with description , it would be clear for the new user that this part is configurable. Making inline changes is also fine, but to me it seems making changes in the execution logic.
It's only about convention, please let me know your thoughts, I will change it.
There was a problem hiding this comment.
@vikaskr22 - the comments have become too noisy, hence my suggestion to keeps the code simple for humans to read. I would suggest only the following 2 changes:
- add following at the top of the file (not much value in "optimizing" to import only when using Kerbeors
from requests_kerberos import HTTPKerberosAuth, DISABLED
- Change
kms_authinitialization to following:
kms_auth = HadoopSimpleAuth(kms_user)
# for kerberos:
# kms_auth = HTTPKerberosAuth(mutual_authentication=DISABLED)
What changes were proposed in this pull request?
Existing stress_kms.py utility file is being updated to run against Kerberos enabled server. Now Ranger services run with Kerberos by default in Docker, so updated this script to run with Kerberos.
This script can still run with SIMPLE AUTH .
This script has been very helpful to quickly verify any sanity/tests, updating this to run with Kerberos will be helpful.
How was this patch tested?