Support Questions

Find answers, ask questions, and share your expertise

hiveserver2 not starting using ambari

avatar
Explorer

Hi,

I've installed ambari and have everything else running but for some reason, hiveserver2 won't start up.I attempted to run hiveserver2 through the command line and it runs fine. After starting hiveserver2 through Ambari (and failing), I looked into the hiveserver2.log file, the following error appears:

2016-07-13 20:18:23,476 INFO  [main]: server.HiveServer2 (HiveServer2.java:startHiveServer2(421)) - Starting HiveServer2
2016-07-13 20:18:24,376 INFO  [main]: metastore.HiveMetaStore (HiveMetaStore.java:newRawStore(599)) - 0: Opening raw store with implemenation class:org.apache.hadoop.hive.metastore.ObjectStore
2016-07-13 20:18:24,411 INFO  [main]: metastore.ObjectStore (ObjectStore.java:initialize(294)) - ObjectStore, initialize called
2016-07-13 20:18:26,081 INFO  [main]: metastore.ObjectStore (ObjectStore.java:getPMF(379)) - Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,Database,Type,FieldSchema,Order"
2016-07-13 20:18:27,790 INFO  [main]: metastore.MetaStoreDirectSql (MetaStoreDirectSql.java:<init>(140)) - Using direct SQL, underlying DB is MYSQL
2016-07-13 20:18:27,792 INFO  [main]: metastore.ObjectStore (ObjectStore.java:setConf(277)) - Initialized ObjectStore
2016-07-13 20:18:28,072 INFO  [main]: metastore.HiveMetaStore (HiveMetaStore.java:createDefaultRoles_core(673)) - Added admin role in metastore
2016-07-13 20:18:28,074 INFO  [main]: metastore.HiveMetaStore (HiveMetaStore.java:createDefaultRoles_core(682)) - Added public role in metastore
2016-07-13 20:18:28,148 INFO  [main]: metastore.HiveMetaStore (HiveMetaStore.java:addAdminUsers_core(722)) - No user is added in admin role, since config is empty
2016-07-13 20:18:28,587 INFO  [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(756)) - 0: get_all_databases
2016-07-13 20:18:28,594 INFO  [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(367)) - ugi=hive	ip=unknown-ip-addr	cmd=get_all_databases	
2016-07-13 20:18:28,676 INFO  [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(756)) - 0: get_functions: db=default pat=*
2016-07-13 20:18:28,676 INFO  [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(367)) - ugi=hive	ip=unknown-ip-addr	cmd=get_functions: db=default pat=*	
2016-07-13 20:18:30,024 INFO  [main]: session.SessionState (SessionState.java:createPath(633)) - Created local directory: /tmp/8f3ed0f1-2045-4a32-b484-cbe16f3fdd44_resources
2016-07-13 20:18:30,032 INFO  [main]: session.SessionState (SessionState.java:createPath(633)) - Created HDFS directory: /tmp/hive/hive/8f3ed0f1-2045-4a32-b484-cbe16f3fdd44
2016-07-13 20:18:30,035 INFO  [main]: session.SessionState (SessionState.java:createPath(633)) - Created local directory: /tmp/hive/8f3ed0f1-2045-4a32-b484-cbe16f3fdd44
2016-07-13 20:18:30,038 INFO  [main]: session.SessionState (SessionState.java:createPath(633)) - Created HDFS directory: /tmp/hive/hive/8f3ed0f1-2045-4a32-b484-cbe16f3fdd44/_tmp_space.db
2016-07-13 20:18:30,039 INFO  [main]: server.HiveServer2 (HiveServer2.java:stop(387)) - Shutting down HiveServer2
2016-07-13 20:18:30,040 INFO  [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(756)) - 0: Shutting down the object store...
2016-07-13 20:18:30,040 INFO  [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(367)) - ugi=hive	ip=unknown-ip-addr	cmd=Shutting down the object store...	
2016-07-13 20:18:30,040 INFO  [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(756)) - 0: Metastore shutdown complete.
2016-07-13 20:18:30,040 INFO  [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(367)) - ugi=hive	ip=unknown-ip-addr	cmd=Metastore shutdown complete.	
2016-07-13 20:18:30,041 WARN  [main]: server.HiveServer2 (HiveServer2.java:startHiveServer2(453)) - Error starting HiveServer2 on attempt 1, will retry in 60 seconds

java.lang.RuntimeException: Error applying authorization policy on hive configuration: java.lang.RuntimeException: java.io.IOException: Permission denied
at org.apache.hive.service.cli.CLIService.init(CLIService.java:114)
at org.apache.hive.service.CompositeService.init(CompositeService.java:59)
at org.apache.hive.service.server.HiveServer2.init(HiveServer2.java:105)
at org.apache.hive.service.server.HiveServer2.startHiveServer2(HiveServer2.java:427)
at org.apache.hive.service.server.HiveServer2.access$700(HiveServer2.java:79)
at org.apache.hive.service.server.HiveServer2$StartOptionExecutor.execute(HiveServer2.java:665)
at org.apache.hive.service.server.HiveServer2.main(HiveServer2.java:538)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: Permission denied
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:503)
at org.apache.hive.service.cli.CLIService.applyAuthorizationConfigPolicy(CLIService.java:127)
at org.apache.hive.service.cli.CLIService.init(CLIService.java:112)
... 12 more
Caused by: java.lang.RuntimeException: java.io.IOException: Permission denied
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:496)
... 14 more
Caused by: java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:1006)
at java.io.File.createTempFile(File.java:1989)
at org.apache.hadoop.hive.ql.session.SessionState.createTempFile(SessionState.java:820)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:494)
... 14 more

So based on the log, the startup script being used by ambari is definitely using something it doesn't have access to. But from the log, I can't tell what file/folder/library i need to grant access to the hive user.

Anyone have any ideas?

1 ACCEPTED SOLUTION

avatar
Explorer

Figured it out. The hive user didn't have write access to /tmp/hive, which i believe was created from a previous installation. Everything works now. yay!

View solution in original post

5 REPLIES 5

avatar

@Rey L

May I know is Ranger installed in your cluster?

avatar
Explorer

No, ranger isn't. But authentication is set to none.

avatar
Explorer

Figured it out. The hive user didn't have write access to /tmp/hive, which i believe was created from a previous installation. Everything works now. yay!

avatar
Explorer

Nice,works for me. chown -R hive.hive /tmp/hive

same errors and my hive-tmp dir like this

drwxr-xr-x 3 yarn yarn 19 Feb 15 17:22 hive

avatar

Hi, Permission denied belongs to you have run the hive server in normal command Prompt. If you run hiveserver and metastore in Administrator Mode CMD Prompt,then this issue will be resolved. Thanks,