You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@oozie.apache.org by Morgrim Murdargent <mo...@gmail.com> on 2016/03/30 12:12:20 UTC

hive2 action and kerberos

Hello !

I created a simple workflow using the hive2 action.

Here it is :
###
<workflow-app xmlns="uri:oozie:workflow:0.5" name="TEST_HIVE_ACTION">
        <credentials>
                <credential name="hive_credentials" type="hive2">
                        <property>
                                <name>hive2.server.principal</name>
                                <value>hive/<myhost>@<myrealm></value>
                        </property>
                        <property>
                                <name>hive2.jdbc.url</name>
                                <value>jdbc:hive2://<myhost>:10000</value>
                        </property>
                </credential>
        </credentials>
        <start to="init-hive" />
        <action name="init-hive" cred="hive_credentials">
                <hive2 xmlns="uri:oozie:hive2-action:0.1">
                        <job-tracker>${jobTracker}</job-tracker>
                        <name-node>${nameNode}</name-node>
                        <job-xml>${hiveConfPath}</job-xml>
                        <configuration>
                                <property>
                                        <name>oozie.hive.defaults</name>
                                        <value>${hiveConfPath}</value>
                                </property>
                                <property>
                                        <name>mapreduce.job.queuename</name>
                                        <value>${queueName}</value>
                                </property>
                                <property>
                                        <name>tez.queue.name</name>
                                        <value>${queueName}</value>
                                </property>
                                <property>
                                        <name>tez.lib.uris</name>
                                        <value>${tezLibPath}</value>
                                </property>
                        </configuration>
                        <jdbc-url>jdbc:hive2://<myhost>:10000</jdbc-url>
                        <script>hive.hql</script>
                        <file>hive.hql#hive.hql</file>
                </hive2>
                <ok to="end"/>
                <error to="fail"/>
        </action>

        <kill name="fail">
        <message>Script failed, error
message[${wf:errorMessage(wf:lastErrorNode())}]</message>
        </kill>

        <end name="end"/>
</workflow-app>
###

When I submit this workflow, I got the following error message :
###
# oozie job -oozie=http://<OOZIE SERVER>:11000/oozie -verbose -info
0000163-160329180739835-oozie-oozi-W@init-hive
ID : 0000163-160329180739835-oozie-oozi-W@init-hive
------------------------------------------------------------------------------------------------------------------------------------
Console URL       : -
Error Code        : JdbcUriParseException
Error Message     : JdbcUriParseException: Bad URL format. Hostname not
found  in authority part of the url: <myhost>:10000;principal=hive. Are you
missing a '/' after the hostname ?
External ID       : -
External Status   : ERROR
Name              : init-hive
Retries           : 0
Tracker URI       : -
Type              : hive2
Started           : 2016-03-30 10:01:03 GMT
Status            : ERROR
Ended             : 2016-03-30 10:01:05 GMT
External Stats    : null
External ChildIDs : null
------------------------------------------------------------------------------------------------------------------------------------
###

Am I missing something in the hive2 credentials ? I don't understand why
the whole principal is not taken.

Best regards.

Morgrim.

Re: hive2 action and kerberos

Posted by Morgrim Murdargent <mo...@gmail.com>.
Thank you for your help Ashish !

My problem was indeed coming from this part.

The problem was the missing database part "/default".
Concerning the principal part, this is already contained in the credential
tag so no need to add it in the jdbc URL.

Here is the resulting xml file :
###
<workflow-app xmlns="uri:oozie:workflow:0.5" name="TEST_HIVE_ACTION">
        <credentials>
                <credential name="hive_credentials" type="hive2">
                        <property>
                                <name>hive2.server.principal</name>
                                <value>hive/<myhost>@<myrealm></value>
                        </property>
                        <property>
                                <name>hive2.jdbc.url</name>

<value>jdbc:hive2://<myhost>:10000/default</value>
                        </property>
                </credential>
        </credentials>
        <start to="init-hive" />
        <action name="init-hive" cred="hive_credentials">
                <hive2 xmlns="uri:oozie:hive2-action:0.1">
                        <job-tracker>${jobTracker}</job-tracker>
                        <name-node>${nameNode}</name-node>
                        <job-xml>${hiveConfPath}</job-xml>
                        <configuration>
                                <property>
                                        <name>oozie.hive.defaults</name>
                                        <value>${hiveConfPath}</value>
                                </property>
                                <property>
                                        <name>mapreduce.job.queuename</name>
                                        <value>${queueName}</value>
                                </property>
                                <property>
                                        <name>tez.queue.name</name>
                                        <value>${queueName}</value>
                                </property>
                                <property>
                                        <name>tez.lib.uris</name>
                                        <value>${tezLibPath}</value>
                                </property>
                        </configuration>

<jdbc-url>jdbc:hive2://<myhost>:10000/default</jdbc-url>
                        <script>hive.hql</script>
                        <file>hive.hql#hive.hql</file>
                </hive2>
                <ok to="end"/>
                <error to="fail"/>
        </action>

        <kill name="fail">
        <message>Script failed, error
message[${wf:errorMessage(wf:lastErrorNode())}]</message>
        </kill>

        <end name="end"/>
</workflow-app>
###

THank you for your help.

Best regards.

Morgrim

On Wed, Mar 30, 2016 at 7:22 PM, Ashish Gupta <as...@citiustech.com>
wrote:

> You have specified only Hive2 server IP and port in JDBC URL under
> <jdbc-url> tag. Specify principal name as well in JDBC Url in below format.
>
> jdbc:hive2://<myhost>:10000/default;principal=hive/<myhost>@<myrealm>
>
> Hope it will work.
>
> Regards,
> Ashish
>
> -----Original Message-----
> From: Morgrim Murdargent [mailto:morgrim.oozie@gmail.com]
> Sent: 30 March 2016 15:42
> To: user@oozie.apache.org
> Subject: hive2 action and kerberos
>
> Hello !
>
> I created a simple workflow using the hive2 action.
>
> Here it is :
> ###
> <workflow-app xmlns="uri:oozie:workflow:0.5" name="TEST_HIVE_ACTION">
>         <credentials>
>                 <credential name="hive_credentials" type="hive2">
>                         <property>
>                                 <name>hive2.server.principal</name>
>                                 <value>hive/<myhost>@<myrealm></value>
>                         </property>
>                         <property>
>                                 <name>hive2.jdbc.url</name>
>                                 <value>jdbc:hive2://<myhost>:10000</value>
>                         </property>
>                 </credential>
>         </credentials>
>         <start to="init-hive" />
>         <action name="init-hive" cred="hive_credentials">
>                 <hive2 xmlns="uri:oozie:hive2-action:0.1">
>                         <job-tracker>${jobTracker}</job-tracker>
>                         <name-node>${nameNode}</name-node>
>                         <job-xml>${hiveConfPath}</job-xml>
>                         <configuration>
>                                 <property>
>                                         <name>oozie.hive.defaults</name>
>                                         <value>${hiveConfPath}</value>
>                                 </property>
>                                 <property>
>
> <name>mapreduce.job.queuename</name>
>                                         <value>${queueName}</value>
>                                 </property>
>                                 <property>
>                                         <name>tez.queue.name</name>
>                                         <value>${queueName}</value>
>                                 </property>
>                                 <property>
>                                         <name>tez.lib.uris</name>
>                                         <value>${tezLibPath}</value>
>                                 </property>
>                         </configuration>
>                         <jdbc-url>jdbc:hive2://<myhost>:10000</jdbc-url>
>                         <script>hive.hql</script>
>                         <file>hive.hql#hive.hql</file>
>                 </hive2>
>                 <ok to="end"/>
>                 <error to="fail"/>
>         </action>
>
>         <kill name="fail">
>         <message>Script failed, error
> message[${wf:errorMessage(wf:lastErrorNode())}]</message>
>         </kill>
>
>         <end name="end"/>
> </workflow-app>
> ###
>
> When I submit this workflow, I got the following error message :
> ###
> # oozie job -oozie=http://<OOZIE SERVER>:11000/oozie -verbose -info
> 0000163-160329180739835-oozie-oozi-W@init-hive
> ID : 0000163-160329180739835-oozie-oozi-W@init-hive
>
> ------------------------------------------------------------------------------------------------------------------------------------
> Console URL       : -
> Error Code        : JdbcUriParseException
> Error Message     : JdbcUriParseException: Bad URL format. Hostname not
> found  in authority part of the url: <myhost>:10000;principal=hive. Are
> you missing a '/' after the hostname ?
> External ID       : -
> External Status   : ERROR
> Name              : init-hive
> Retries           : 0
> Tracker URI       : -
> Type              : hive2
> Started           : 2016-03-30 10:01:03 GMT
> Status            : ERROR
> Ended             : 2016-03-30 10:01:05 GMT
> External Stats    : null
> External ChildIDs : null
>
> ------------------------------------------------------------------------------------------------------------------------------------
> ###
>
> Am I missing something in the hive2 credentials ? I don't understand why
> the whole principal is not taken.
>
> Best regards.
>
> Morgrim.
>

RE: hive2 action and kerberos

Posted by Ashish Gupta <as...@citiustech.com>.
You have specified only Hive2 server IP and port in JDBC URL under <jdbc-url> tag. Specify principal name as well in JDBC Url in below format.

jdbc:hive2://<myhost>:10000/default;principal=hive/<myhost>@<myrealm>

Hope it will work.

Regards,
Ashish

-----Original Message-----
From: Morgrim Murdargent [mailto:morgrim.oozie@gmail.com] 
Sent: 30 March 2016 15:42
To: user@oozie.apache.org
Subject: hive2 action and kerberos

Hello !

I created a simple workflow using the hive2 action.

Here it is :
###
<workflow-app xmlns="uri:oozie:workflow:0.5" name="TEST_HIVE_ACTION">
        <credentials>
                <credential name="hive_credentials" type="hive2">
                        <property>
                                <name>hive2.server.principal</name>
                                <value>hive/<myhost>@<myrealm></value>
                        </property>
                        <property>
                                <name>hive2.jdbc.url</name>
                                <value>jdbc:hive2://<myhost>:10000</value>
                        </property>
                </credential>
        </credentials>
        <start to="init-hive" />
        <action name="init-hive" cred="hive_credentials">
                <hive2 xmlns="uri:oozie:hive2-action:0.1">
                        <job-tracker>${jobTracker}</job-tracker>
                        <name-node>${nameNode}</name-node>
                        <job-xml>${hiveConfPath}</job-xml>
                        <configuration>
                                <property>
                                        <name>oozie.hive.defaults</name>
                                        <value>${hiveConfPath}</value>
                                </property>
                                <property>
                                        <name>mapreduce.job.queuename</name>
                                        <value>${queueName}</value>
                                </property>
                                <property>
                                        <name>tez.queue.name</name>
                                        <value>${queueName}</value>
                                </property>
                                <property>
                                        <name>tez.lib.uris</name>
                                        <value>${tezLibPath}</value>
                                </property>
                        </configuration>
                        <jdbc-url>jdbc:hive2://<myhost>:10000</jdbc-url>
                        <script>hive.hql</script>
                        <file>hive.hql#hive.hql</file>
                </hive2>
                <ok to="end"/>
                <error to="fail"/>
        </action>

        <kill name="fail">
        <message>Script failed, error
message[${wf:errorMessage(wf:lastErrorNode())}]</message>
        </kill>

        <end name="end"/>
</workflow-app>
###

When I submit this workflow, I got the following error message :
###
# oozie job -oozie=http://<OOZIE SERVER>:11000/oozie -verbose -info 0000163-160329180739835-oozie-oozi-W@init-hive
ID : 0000163-160329180739835-oozie-oozi-W@init-hive
------------------------------------------------------------------------------------------------------------------------------------
Console URL       : -
Error Code        : JdbcUriParseException
Error Message     : JdbcUriParseException: Bad URL format. Hostname not
found  in authority part of the url: <myhost>:10000;principal=hive. Are you missing a '/' after the hostname ?
External ID       : -
External Status   : ERROR
Name              : init-hive
Retries           : 0
Tracker URI       : -
Type              : hive2
Started           : 2016-03-30 10:01:03 GMT
Status            : ERROR
Ended             : 2016-03-30 10:01:05 GMT
External Stats    : null
External ChildIDs : null
------------------------------------------------------------------------------------------------------------------------------------
###

Am I missing something in the hive2 credentials ? I don't understand why the whole principal is not taken.

Best regards.

Morgrim.