Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Unable to start hiveserver 2 and hive metastore.

Unable to start hiveserver 2 and hive metastore.

Getting below error.

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/HIVE/", line 245, in <module>
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/", line 219, in execute
  File "/var/lib/ambari-agent/cache/common-services/HIVE/", line 58, in start
  File "/var/lib/ambari-agent/cache/common-services/HIVE/", line 72, in configure
    hive(name = 'metastore')
  File "/usr/lib/python2.6/site-packages/ambari_commons/", line 89, in thunk
    return fn(*args, **kwargs)
  File "/var/lib/ambari-agent/cache/common-services/HIVE/", line 292, in hive
    user = params.hive_user
  File "/usr/lib/python2.6/site-packages/resource_management/core/", line 154, in __init__
  File "/usr/lib/python2.6/site-packages/resource_management/core/", line 158, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/", line 121, in run_action
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/", line 238, in action_run
    tries=self.resource.tries, try_sleep=self.resource.try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/", line 70, in inner
    result = function(command, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/", line 92, in checked_call
    tries=tries, try_sleep=try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/", line 140, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/", line 291, in _call
    raise Fail(err_msg)
resource_management.core.exceptions.Fail: Execution of 'export HIVE_CONF_DIR=/usr/hdp/current/hive-metastore/conf/conf.server ; /usr/hdp/current/hive-metastore/bin/schematool -initSchema -dbType postgres -userName hive -passWord [PROTECTED]' returned 128. /etc/profile: fork: Resource temporarily unavailable


Re: Unable to start hiveserver 2 and hive metastore.


@Sai Sandeep

Can you check that you postgres databases is up

/sbin/service postgresql status

Please revert


Re: Unable to start hiveserver 2 and hive metastore.

yes, it is up and running and done with restart also.But same issue.

I tried to execute manually but it shows below error

/usr/hdp/current/hive-metastore/bin/schematool -initSchema -dbType postgres -userName hive -passWord ************

WARNING: Use "yarn jar" to launch YARN applications. Metastore connection URL: jdbc:postgresql:// Metastore Connection Driver : org.postgresql.Driver Metastore connection User: hive org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version. *** schemaTool failed ***

Don't have an account?
Coming from Hortonworks? Activate your account here