Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

curl with hive on secured cluster

avatar
Expert Contributor

How can I run curl with hive command in secured cluster?

curl -s -d execute="select+*+from+pokes;" \
       -d statusdir="pokes.output" \
       'http://localhost:50111/templeton/v1/hive?user.name=ekoifman'

in user.name - I tried to pass Hive Principal and keytab didnt work and tried with user principal didnt work. can you please provide some example?

1 ACCEPTED SOLUTION

avatar
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
5 REPLIES 5

avatar
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Rising Star

I generally add "-b ~/cookie.txt -c ~/cookie.txt" also the curl command. And "-i" will give addition information also.

curl --negotiate -u : -b ~/cookie.txt -c ~/cookie.txt ...

avatar
Contributor

"localhost" doesn't work with kerberos authentication, you need the actual hostname in URL. @Jonas Straub can you please edit ?

avatar
Expert Contributor

Thanks @Jonas Straub @bdurai for your comments.

In user.name what value should I pass? is it a kerberos principal of the user who is the executing the command

This is what I got after I ran the above command.

~> curl --negotiate -u : -X GET 'http://WebdhcatserverDNS:50111/templeton/v1/hive?user.name=ekoifman' {"error":null}:~> curl --negotiate -u : -X GET 'http://WebhcatserverDNS:50111/templeton/v1/hive?user.name=ekoifman

avatar
Contributor

User.name would be ignored during kerberos mode. The credentials via kinit is what gets used.