Skip to main content
dewi
Gold ⭐️
January 30, 2020
Solved

HDP 3.1 hiveserver2 not starting

Hi there, I'm facing this problem for 2 days now and maybe you guys can find it.

I'm not the only one facing this issue but none of the given solutions fixed my problem.

 

Hive metastore is running and hiveserver2 is not saying connection refused I will put my exact error messages here too.

 

 

        Connection failed on host localhost:10000 (Traceback (most recent call last):
File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/HIVE/package/alerts/alert_hive_thrift_port.py", line 204, in execute
ldap_password=ldap_password)
File "/usr/lib/ambari-agent/lib/resource_management/libraries/functions/hive_check.py", line 84, in check_thrift_port_sasl
timeout_kill_strategy=TerminateStrategy.KILL_PROCESS_TREE,
File "/usr/lib/ambari-agent/lib/resource_management/core/base.py", line 166, in __init__
self.env.run()
File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 160, in run
self.run_action(resource, action)
File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 124, in run_action
provider_action()
File "/usr/lib/ambari-agent/lib/resource_management/core/providers/system.py", line 263, in action_run
returns=self.resource.returns)
File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 72, in inner
result = function(command, **kwargs)
File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 102, in checked_call
tries=tries, try_sleep=try_sleep, timeout_kill_strategy=timeout_kill_strategy, returns=returns)
File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 150, in _call_wrapper
result = _call(command, **kwargs_copy)
File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 314, in _call
raise ExecutionFailed(err_msg, code, out, err)
ExecutionFailed: Execution of 'beeline -n hive -u 'jdbc:hive2://localhost:10000/;transportMode=binary' -e ';' 2>&1 | awk '{print}' | grep -i -e 'Connected to:' -e 'Transaction isolation:'' returned 1.
)

 

and it gives this when I am trying to start hiveserver2:

 

2020-01-30 10:56:14,981 - Execution of 'cat /var/run/hive/hive-server.pid 1>/tmp/tmp8y1m5V 2>/tmp/tmpRyZFzp' returned 1. cat: /var/run/hive/hive-server.pid: No such file or directory

2020-01-30 10:56:14,982 - get_user_call_output returned (1, u'', u'cat: /var/run/hive/hive-server.pid: No such file or directory')
2020-01-30 10:56:14,982 - call['ambari-sudo.sh su hive -l -s /bin/bash -c 'hive --config /usr/hdp/current/hive-server2/conf/ --service metatool -listFSRoot' 2>/dev/null | grep hdfs:// | cut -f1,2,3 -d '/' | grep -v 'hdfs://localhost:8020' | head -1'] {}
2020-01-30 10:56:26,621 - call returned (0, '')
2020-01-30 10:56:26,621 - Execute['/var/lib/ambari-agent/tmp/start_hiveserver2_script /var/log/hive/hive-server2.out /var/log/hive/hive-server2.err /var/run/hive/hive-server.pid /usr/hdp/current/hive-server2/conf/ /etc/tez/conf'] {'environment': {'HIVE_BIN': 'hive', 'JAVA_HOME': u'/usr/jdk64/jdk1.8.0_112', 'HADOOP_HOME': u'/usr/hdp/current/hadoop-client'}, 'not_if': 'ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p >/dev/null 2>&1', 'user': 'hive', 'path': [u'/usr/sbin:/sbin:/usr/lib/ambari-server/*:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/var/lib/ambari-agent:/usr/hdp/current/hive-server2/bin:/usr/hdp/3.1.4.0-315/hadoop/bin']}
2020-01-30 10:56:26,652 - Execute['/usr/jdk64/jdk1.8.0_112/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/hdp/current/hive-server2/lib/mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification 'jdbc:mysql://novalinq-stoeptegel/hive?createDatabaseIfNotExist=true' hive [PROTECTED] com.mysql.jdbc.Driver'] {'path': ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], 'tries': 5, 'try_sleep': 10}
2020-01-30 10:56:27,434 - call['/usr/hdp/current/zookeeper-client/bin/zkCli.sh -server localhost:2181 ls /hiveserver2test | grep 'serverUri=''] {}
2020-01-30 10:56:28,121 - call returned (1, 'Node does not exist: /hiveserver2test')
2020-01-30 10:56:28,121 - Will retry 29 time(s), caught exception: ZooKeeper node /hiveserver2test is not ready yet. Sleeping for 10 sec(s)

 

I've also tried it with Zookeeper node /hiveserver2 (without 'test') and that did not work either.

In the hiveserver2.log file I can not find anything particular, can you? (how do I attach a file?)

 

I have tried the following (without succes):

  1. Re-installed Hive service
  2. Checked hive-site.xml (everything seems right)
  3. Checked if the ports that Hive is using are free (they are so far I know)
  4. Checked in the ZkCli.sh if I could find hiveserver2 (can not find it, it is not there)
  5. Tried DEBUG mode for Hive, did not get any other messages (bit weird).

I am running HDP 3.1.4.0 single node cluster (not yet for production, first getting everything started)

 

Thank you in advance!

 

Dewi

 

@Shelton 

 

 

jsensharma
Platinum ⭐️⭐️
January 30, 2020

@dewi 

As we repeatedly see this WARNING:  

 

2020-01-30T09:25:38,383 WARN  [main]: metastore.RetryingMetaStoreClient (:()) - MetaStoreClient lost connection. Attempting to reconnect (10 of 24) after 5s. getCurrentNotificationEventId
org.apache.thrift.TApplicationException: Internal error processing get_current_notificationEventId

 


Hence can you please try this to see if this works for you?

Login to Ambari UI --> Hive --> Configs (Tab) --> Custom hive-site.xml   Click on "Add" property button and then add the following property:

 

hive.metastore.event.db.notification.api.auth=false

 

Then restart HiveServer2

 

.

.

Also in your log we see the following ERROR:

 

2020-01-30T09:25:38,225 ERROR [json-metric-reporter]: metrics2.JsonFileMetricsReporter (:()) - Unable to rename temp file /tmp/hmetrics242742500630655243json to /tmp/report.json

 

 

So can you lease check what ios the permission and ownership on the mentioned file? It should be owned and writable by "hive:hadoop" user.

Example:

 

# ls -lart /tmp/report.json
-rw-r--r--. 1 hive hadoop 3300 Jan 30 13:16 /tmp/report.json

 

.

 

 

 

 

 

 

 

 

9 replies

jsensharma
Platinum ⭐️⭐️
Platinum ⭐️⭐️
January 30, 2020

@dewi 

The problem does not look seem to be related to the Znode. Once the Hive Server2 is started successfully then you should see the znode.

 

The issue seems to be the use of "localhost". As we see the following output in your output.

Connection failed on host localhost:10000 
.
.
beeline -n hive -u 'jdbc:hive2://localhost:10000/;transportMode=binary'


Ideally those connection strings should be showing the FQDN (Fully Qualified Hostname) instead of showing "localhost".

So please check if the Hive Server config is hardcoded with "localhost" address anywhere or if there is anything wrong with the hostname "/etc/hosts" ...etc

# grep 'localhost' /etc/hive/conf/*.xml

.

 

Manual Startup Testing

Also please verify if you are able to start the HiveServer2 using command line. As mentioned in 

# su - hive
# nohup /usr/hdp/current/hive-server2/bin/hiveserver2 -hiveconf hive.metastore.uris=/tmp/hiveserver2HD.out 2 /tmp/hiveserver2HD.log

 

.

Then check the port 10000 is listening to 0.0.0.0 OR localhost?

# netstat -tnlpa | grep `cat /var/run/hive/hive-server.pid`

.

.

 

Translate
dewi
dewiAuthor
Gold ⭐️
January 30, 2020

Hi sorry, I changed FQDN manually in the post to 'localhost'

 

I've tried setup hiveserver manually but I get nothing in respond?

Also when I check port 10000 the terminal returns empty

Translate
jsensharma
Platinum ⭐️⭐️
Platinum ⭐️⭐️
January 30, 2020

@dewi 
What do you mean by "I've tried setup hiveserver manually " ?

Can you please share the details how you did this?  Or have you used to setup Hive?

 

Also can you please share the logs of HiveServer2 for it's Manual command line startup?  Did you notice any error in the hiveserver2 log when you attempted to start it via command line ?   If yes then can you please share the hive conf and full log ?  (you can mask the passwords/hostname)

.

Also have you made any special config changes like hive.server2.support.dynamic.service.discovery? Have you disabled the "hive.server2.support.dynamic.service.discovery" setting in your "Advanced hive-site" ?

It will be good to see the HS2 log and Hive Configs.

Translate