In our case (HDP 2.1) the problem occurred during KNOX testing. By adding the prescribed entries in the KNOX Admin Guide section 2.1, the HiveServer2 port changes from binary/thrift on port 10000 to http on port 10001. The following changes had to be added into /var/lib/ambari-agent/cache/stacks/HDP/2.0.6/services/HIVE/package/scripts/param.py to accommodate Ambari restarting HiveServer2:
## line 59 original:
hive_server_port = default(‘/configurations/hive-site/hive.server2.thrift.port’,”10000″)
## line 59-62 new:
if default(‘/configurations/hive-site/hive.server2.transport.mode’,”binary”) == “http”:
hive_server_port = default(‘/configurations/hive-site/hive.server2.http.port’,”10001″)
else:
hive_server_port = default(‘/configurations/hive-site/hive.server2.thrift.port’,”10000″)