You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Kari Pahula <ka...@avoltus.com> on 2016/07/05 10:06:56 UTC

Trouble trying to get started with hive

Hi. I'm trying to familiarize myself with Hadoop and various projects
related to it.

I've been following
https://cwiki.apache.org/confluence/display/Hive/GettingStarted

I'd like to start by giving a bit of feedback from the bits I have got to
work.

Should the document tell about using schematool?  The first hive command I
tried was hive, since that was what the guide had as the first command.
That didn't work without running schematool first, but I got more errors
when I tried schematool since hive had already created the metastore_db
directory and schematool got confused by that. I had to look up what went
wrong and found my answers from stackexhange. In the end, I removed
metastore_db and ran "bin/schematool -initSchema -dbType derby".

After that, the next problem I ran into was, when I tried to connect to the
database with beeline:
Error: Failed to open new session: java.lang.RuntimeException:
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException):
User: kaol is not allowed to impersonate anonymous (state=,code=0)

Again, I had to go and figure that I needed to have a conf/core-site.xml
like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
  <property>
    <name>hadoop.proxyuser.hive.groups</name>
    <value>*</value>
  </property>
  <property>
    <name>hadoop.proxyuser.hive.hosts</name>
    <value>*</value>
  </property>
</configuration>

Should this have worked out of box?

This is as far as I've gotten and now I'm stumped with trying to create a
table. My command is "create table users (user_id int, item_id int, rating
int, stamp int);" but all I get as a response is
Error: Error while processing statement: FAILED: Execution Error, return
code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.
MetaException(message:file:/user/hive/warehouse/users is not a directory or
unable to create one) (state=08S01,code=1)

I've searched for this error and what I've found is that it's a permission
error. However, I've still not found what I should make
/user/hive/warehouse to make it work.  Last I tried was to have the
directory world writable, to no effect. What could I try next?

Re: Trouble trying to get started with hive

Posted by Jörn Franke <jo...@gmail.com>.
Please use a Hadoop distribution to avoid these configuration issues (in the beginning).

> On 05 Jul 2016, at 12:06, Kari Pahula <ka...@avoltus.com> wrote:
> 
> Hi. I'm trying to familiarize myself with Hadoop and various projects related to it.
> 
> I've been following https://cwiki.apache.org/confluence/display/Hive/GettingStarted
> 
> I'd like to start by giving a bit of feedback from the bits I have got to work.
> 
> Should the document tell about using schematool?  The first hive command I tried was hive, since that was what the guide had as the first command. That didn't work without running schematool first, but I got more errors when I tried schematool since hive had already created the metastore_db directory and schematool got confused by that. I had to look up what went wrong and found my answers from stackexhange. In the end, I removed metastore_db and ran "bin/schematool -initSchema -dbType derby".
> 
> After that, the next problem I ran into was, when I tried to connect to the database with beeline:
> Error: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: kaol is not allowed to impersonate anonymous (state=,code=0)
> 
> Again, I had to go and figure that I needed to have a conf/core-site.xml like this:
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
> <configuration>
>   <property>
>     <name>hadoop.proxyuser.hive.groups</name>
>     <value>*</value>
>   </property>
>   <property>
>     <name>hadoop.proxyuser.hive.hosts</name>
>     <value>*</value>
>   </property>
> </configuration>
> 
> Should this have worked out of box?
> 
> This is as far as I've gotten and now I'm stumped with trying to create a table. My command is "create table users (user_id int, item_id int, rating int, stamp int);" but all I get as a response is
> Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:file:/user/hive/warehouse/users is not a directory or unable to create one) (state=08S01,code=1)
> 
> I've searched for this error and what I've found is that it's a permission error. However, I've still not found what I should make /user/hive/warehouse to make it work.  Last I tried was to have the directory world writable, to no effect. What could I try next?

Re: Trouble trying to get started with hive

Posted by Shannon Ladymon <sl...@gmail.com>.
Kari,

Perhaps the Getting Started doc should be updated.  What information did
you find missing/incorrect?  Have you been able to get it working?

-Shannon

On Tue, Jul 5, 2016 at 3:06 AM, Kari Pahula <ka...@avoltus.com> wrote:

> Hi. I'm trying to familiarize myself with Hadoop and various projects
> related to it.
>
> I've been following
> https://cwiki.apache.org/confluence/display/Hive/GettingStarted
>
> I'd like to start by giving a bit of feedback from the bits I have got to
> work.
>
> Should the document tell about using schematool?  The first hive command I
> tried was hive, since that was what the guide had as the first command.
> That didn't work without running schematool first, but I got more errors
> when I tried schematool since hive had already created the metastore_db
> directory and schematool got confused by that. I had to look up what went
> wrong and found my answers from stackexhange. In the end, I removed
> metastore_db and ran "bin/schematool -initSchema -dbType derby".
>
> After that, the next problem I ran into was, when I tried to connect to
> the database with beeline:
> Error: Failed to open new session: java.lang.RuntimeException:
> org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException):
> User: kaol is not allowed to impersonate anonymous (state=,code=0)
>
> Again, I had to go and figure that I needed to have a conf/core-site.xml
> like this:
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
> <configuration>
>   <property>
>     <name>hadoop.proxyuser.hive.groups</name>
>     <value>*</value>
>   </property>
>   <property>
>     <name>hadoop.proxyuser.hive.hosts</name>
>     <value>*</value>
>   </property>
> </configuration>
>
> Should this have worked out of box?
>
> This is as far as I've gotten and now I'm stumped with trying to create a
> table. My command is "create table users (user_id int, item_id int, rating
> int, stamp int);" but all I get as a response is
> Error: Error while processing statement: FAILED: Execution Error, return
> code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.
> MetaException(message:file:/user/hive/warehouse/users is not a directory or
> unable to create one) (state=08S01,code=1)
>
> I've searched for this error and what I've found is that it's a permission
> error. However, I've still not found what I should make
> /user/hive/warehouse to make it work.  Last I tried was to have the
> directory world writable, to no effect. What could I try next?
>