After the successful launch of hive emotion this time finally did not appear the bug, confidently hit the long table to create the command, the reality once again gave me a stick, reported the following error errors , return code 1 from Org.apache.hadoop.hive.ql.exec.DDLTask. Metaexception, after looking at the mistake, first stared blankly, and then I issued a feeling, since the beginning of the programming this road of no return, There is no one day is not looking for bugs on the way is to deal with the bug, put yourself a tag: Find a bug is like eating the same man. After expressing the feelings of the heart, the work is still working.
First step : Check the configuration file to make sure there are no errors
The second step : The Internet to find the same is the end of the people, see if there is a friend and I have the same problem, find to find a replacement Mysql-connector-java jar Package solution, how to look like can solve the problem, Holding the dead horse as a living horse medical mentality, or try a bit, sure enough, no problem solved,pass!
Step three : Run hive-hiveconf hive.root.logger=debug,console print log of hive boot process. Do not know, a dozen startled, see the following bloody error message, the heart cooled half, the murder ah ... Because it's too long, I cut a small part out.
[main]: ERROR DataNucleus.Datastore:Error thrown executing CREATE TABLE ' serde_params ' (' SE rde_id ' BIGINT not null, ' param_key ' varchar (a) binary NOT null, ' param_value ' varchar (4000) binary NULL, CO Nstraint ' SERDE_PARAMS_PK ' PRIMARY key (' serde_id ', ' Param_key ')) engine=innodb:specified key was too long; Max key length is 767 bytes com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:Specified key was too long; Max key length is 767 bytes at Sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) ... at or G.apache.hadoop.util.runjar.main (runjar.java:212)
Main]: ERROR Datastore.Schema:An exception was thrown and Adding/validating class (es): Specified key was too long; Max key length is 767 bytes com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:Specified key was too long; Max key length is 767 bytes at Sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) ... at ja Va.lang.reflect.Method.invoke (method.java:606) at Org.apache.hadoop.util.RunJar.main (runjar.java:212) [main]: DEBUG Metastore.
Hivemetastore:admin role already exists invalidobjectexception (message:role Admin already exists.) At Org.apache.hadoop.hive.metastore.ObjectStore.addRole (objectstore.java:3187) ... at JAVA.LANG.REFLECT.METHOD.INV Oke (method.java:606) [main]: DEBUG metastore.
hivemetastore:failed while granting global privs to admin invalidobjectexception (Message:all are already granted by admin) At Org.apache.hadoop.hive.metastore.ObjectStore.grantPrivileges (objectstore.java:3912) ... at org.apache.hAdoop.util.RunJar.main (runjar.java:212)
Fourth Step : Continue searching for the workaround, and then find the possible reason for the character set, you can do the following command by changing the character set of the database to Latin1 in MySQL: ALTER DATABASE hive character set Latin1;
Fifth Step : Restart Hive, continue to look at the log, in addition to the first exception disappeared, others still exist, some doubts, a serious look, found metastore. Hivemetastore:admin role already exists, will not be the previous hive startup error left after the problem, then the MySQL in the hive data deleted to recreate a look.
Sixth step : Execute the following command in MySQL:
Drop database hive;
Create DATABASE hive;
ALTER DATABASE hive character set latin1;
Seventh Step : Restart Hive, view log, problem solved ...