By default, hive will use derby as a embedded database for metastore. Your 
command fail because of incorrect metastore configuration.

I highly recommend you use mysql as metastore. The detail information will be 
found at: 
http://www.mazsoft.com/blog/post/2010/02/01/Setting-up-HadoopHive-to-use-MySQL-as-metastore.aspx

It’s pretty simple, I’ll summarize as following: 

-          Install mysql server on your VM Centos

-          Create an user for hive, grant all privilege

-          Modify (or create new) hive-site.xml file in $HIVE_PATH/conf/ with 

-          Download then copy msql-connector-java-*.jar to $HIVE_PATH/lib

When everything done, “show tables;” will work

Best regards

Nguyen Thanh Binh (Mr)

Cell phone: (+84)98.226.0622

From: ylyy-1985 [mailto:ylyy-1...@163.com] 
Sent: Wednesday, April 11, 2012 10:37 AM
To: user
Subject: 回复: Re: cannot start the thrift server

thank you very much. now that it's running, I use it to test the sample code 
first. According to my operation,(with the server is running) I type "./hive" 
to enter hive console, but when I use "show tables;" the console print out some 
info: 

 

FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Failed to 
start database 'metastore_db', see the next exception for details.
NestedThrowables:
java.sql.SQLException: Failed to start database 'metastore_db', see the next 
exception for details.
FAILED: Execution Error, return code 1 from 
org.apache.hadoop.hive.ql.exec.DDLTask

 

someone says the metadata is lock, so...it doesn't matter even if I can't 
access the CLI, but things will be much better if I can check the tables with 
the CLI and the server running. Or can I check the database using other method?

2012-04-11

  _____  

Best Regards

Andes

 

Email: <mailto:ylyy-1...@163.com> ylyy-1...@163.com

  _____  

发件人:binhnt22

发送时间:2012-04-11 11:22

主题:Re: cannot start the thrift server

收件人:"user"<user@hive.apache.org>

抄送:

 

IMHO, you should use bridge, so that any other computer in LAN can connect to 
192.168.164.128 without problem

When the thrift server is running, it’s not like the hive command disable. The 
console will only produce output when you have a job running through thrift 
server.

If you want to use CLI, just run $HIVE_PATH/bin/hive

Best regards

Nguyen Thanh Binh (Mr)

Cell phone: (+84)98.226.0622

From: ylyy-1985 [mailto:ylyy-1...@163.com] 
Sent: Wednesday, April 11, 2012 9:49 AM
To: user
Subject: 回复: RE: RE: Re: cannot start the thrift server

centos 6 in VM and NAT network(by default). 

 here is what I do.

I see there are some different ways to form the connection string like:

Connection con = DriverManager.getConnection("jdbc:hive://IP:10000/default", 
"", "");
Connection con = DriverManager.getConnection("jdbc:hive://");
 
so I use the second one, I don't know what is the difference but it does 
connect me to hive.
 
btw, when the thrift server is running, is seems the hive command line is 
disabled? is it because the metadata is locked?

2012-04-11

  _____  

Andes

  _____  

发件人:binhnt22

发送时间:2012-04-11 10:39

主题:RE: RE: Re: cannot start the thrift server

收件人:"user"<user@hive.apache.org>

抄送:

Hi ylyy,

What’s OS in your VM? Which network configuration is used in your VM: NAT, 
bridge, host-only or LAN segment?

Answer this may give clue to solve: No route to host.

BTW: default username and password is “empty”

Connection con = 
DriverManager.getConnection("jdbc:hive://hiveserverip:10000/default", "", "");

Best regards

Nguyen Thanh Binh (Mr)

Cell phone: (+84)98.226.0622

From: ylyy-1985 [mailto:ylyy-1...@163.com] 
Sent: Wednesday, April 11, 2012 9:29 AM
To: user
Subject: 回复: RE: Re: cannot start the thrift server

yeah, great,thanks binhnt22. what a fool I am. Hah!! but I get this then. 

Unable to create log directory /tmp/Administrator
2012-04-11 10:23:15,359 ERROR [main] session.SessionState$LogHelper(277): 
Unable to create log directory /tmp/Administrator
Exception in thread "main" java.sql.SQLException: Could not establish connecton 
to jdbc:hive://192.168.164.128:10000/default: java.net.NoRouteToHostException: 
No route to host: connect
 at org.apache.hadoop.hive.jdbc.HiveConnection.<init>(HiveConnection.java:107)

here I use XP as a host machine, and have a virtual machine in VMware  
(IP:192.168.164.128) inside XP, and I think the port is 10000, right? I see the 
default username and password is "APP" and "mine", so I use this to form a 
connection:

 Connection con = 
DriverManager.getConnection("jdbc:hive://192.168.164.128:10000/default", "APP", 
"mine");

2012-04-11

  _____  

Andes

  _____  

发件人:binhnt22

发送时间:2012-04-11 10:13

主题:RE: Re: cannot start the thrift server

收件人:"user"<user@hive.apache.org>

抄送:

Hi ylyy

You should add hadoop-core-*.jar file in hadoop distribution directory into 
your project

Best regards

Nguyen Thanh Binh (Mr)

From: ylyy-1985 [mailto:ylyy-1...@163.com] 
Sent: Wednesday, April 11, 2012 9:04 AM
To: user
Subject: 回复: Re: cannot start the thrift server

thanks Bhavesh, :) but how can I confirm that the server is running? I try to 
access IP:10000 but without success. 

however I try to ignore this and write my client code to try to connect to 
hive,but error codes are printed as follows...

Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/hadoop/conf/Configuration
 at org.apache.hadoop.hive.jdbc.HiveConnection.<init>(HiveConnection.java:68)
 at org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:110)
 at java.sql.DriverManager.getConnection(Unknown Source)
 at java.sql.DriverManager.getConnection(Unknown Source)
 at org.apache.hadoop.hive.wyl.HiveTest.main(HiveTest.java:26)
Caused by: java.lang.ClassNotFoundException: 
org.apache.hadoop.conf.Configuration
 at java.net.URLClassLoader$1.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)
 ... 5 more

I add all the libraries in hive to eclipse project. it seems to miss some 
configuration files, but I don't know what it is. Can you help me?

thanks..

2012-04-11

  _____  

Andes

  _____  

发件人:Bhavesh Shah

发送时间:2012-04-10 20:39

主题:Re: cannot start the thrift server

收件人:"user"<user@hive.apache.org>

抄送:

Hello,

[root@localhost hive]# hive --service hiveserver
Starting Hive Thrift Server

After starting Hive Thrift Server nothing get printed on console. This means 
your server get started. 

Now you just run your JDBC program and let us know whether it runs or not.

-- 
Regards, 

Bhavesh Shah








On Tue, Apr 10, 2012 at 6:03 PM, ylyy-1985 < <mailto:ylyy-1...@163.com> 
ylyy-1...@163.com> wrote:

hi all,

I do feel frustrated when starting the thrift server. I tried different version 
of hadoop(1.0.1 and 0.20.2), but when I tried 'hive --service hiveserver', the 
server hung there and printed the following info:

[root@localhost hive]# hive --service hiveserver
Starting Hive Thrift Server
12/04/10 20:22:50 INFO service.HiveServer: Starting hive server on port 10000

and I wait long but nothing happened. pls help, I just want to start the server 
and use jdbc to connect to hive.

thanks in advanced.

2012-04-10

  _____  

Andes





<<attachment: image001.gif>>

<<attachment: image002.gif>>

Reply via email to