Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMBARI-22998] Wrong user used to execute the Spark/Livy Server service check #371

Merged
merged 2 commits into from
Feb 15, 2018
Merged

[AMBARI-22998] Wrong user used to execute the Spark/Livy Server service check #371

merged 2 commits into from
Feb 15, 2018

Conversation

rlevas
Copy link
Contributor

@rlevas rlevas commented Feb 15, 2018

What changes were proposed in this pull request?

common-services/SPARK/1.2.1/package/scripts/service_check.py:36

 livy_kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal}; ")
 Execute(livy_kinit_cmd, user=params.livy_user)

Notice the Kerberos identity is for the smoke user, but the exec is for the livy user. This will replace the livy user's interactive Kerberos ticket cache.

This should be 

smoke_user_kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal}; ")
Execute(smoke_user_kinit_cmd, user=params.smoke_user)

Where smoke_user is

smoke_user =  config['configurations']['cluster-env']['smokeuser']

This is similar for SPARK2 as well.

How was this patch tested?

Tested manually with original code to see the issue and then fix the fixed code to see it working properly:

2018-02-15 03:15:04,058 - Using hadoop conf dir: /usr/hdp/2.6.5.0-96/hadoop/conf
2018-02-15 03:15:04,061 - Execute['/usr/bin/kinit -kt /etc/security/keytabs/spark.headless.keytab spark-c1@EXAMPLE.COM; '] {'user': 'spark'}
2018-02-15 03:15:04,085 - Execute['/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa-c1@EXAMPLE.COM; '] {'user': 'ambari-qa'}
2018-02-15 03:15:04,109 - Execute['curl -s -o /dev/null -w'%{http_code}' --negotiate -u: -k http://c6403.ambari.apache.org:18081 | grep 200'] {'logoutput': True, 'tries': 5, 'user': 'spark', 'try_sleep': 3}
200
2018-02-15 03:15:04,356 - Execute['curl -s -o /dev/null -w'%{http_code}' --negotiate -u: -k http://c6402.ambari.apache.org:8999/sessions | grep 200'] {'logoutput': True, 'tries': 3, 'user': 'livy', 'try_sleep': 1}
200

Command completed successfully!

Please review Ambari Contributing Guide before opening a pull request.

Copy link
Contributor

@swagle swagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests are green?

@asfgit
Copy link

asfgit commented Feb 15, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/617/
Test FAILed.
Test FAILured.

@rlevas rlevas requested a review from a user February 15, 2018 12:24
@asfgit
Copy link

asfgit commented Feb 15, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/619/
Test FAILed.
Test FAILured.

@rlevas
Copy link
Contributor Author

rlevas commented Feb 15, 2018

retest this please

@asfgit
Copy link

asfgit commented Feb 15, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/624/
Test FAILed.
Test FAILured.

@rlevas
Copy link
Contributor Author

rlevas commented Feb 15, 2018

retest this please

@asfgit
Copy link

asfgit commented Feb 15, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/634/
Test PASSed.

@rlevas rlevas merged commit 61b6106 into apache:trunk Feb 15, 2018
@rlevas rlevas deleted the AMBARI-22998_trunk branch February 15, 2018 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants