Support Questions
Find answers, ask questions, and share your expertise

Re: ambari cluster not working, error in history server

Explorer

before install i enterg

the error:

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py", line 211, in <module>
    HiveMetastore().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 329, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py", line 61, in start
    create_metastore_schema()
  File "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py", line 382, in create_metastore_schema
    user = params.hive_user
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 166, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 262, in action_run
    tries=self.resource.tries, try_sleep=self.resource.try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 72, in inner
    result = function(command, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 102, in checked_call
    tries=tries, try_sleep=try_sleep, timeout_kill_strategy=timeout_kill_strategy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 150, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 303, in _call
    raise ExecutionFailed(err_msg, code, out, err)
resource_management.core.exceptions.ExecutionFailed: Execution of 'export HIVE_CONF_DIR=/usr/hdp/current/hive-metastore/conf/conf.server ; /usr/hdp/current/hive-server2-hive2/bin/schematool -initSchema -dbType mysql -userName hive -passWord [PROTECTED] -verbose' returned 1. SLF4J: Class path contains multiple SLF4J bindings.

can you provide detail information of hive requirements installation, including mysql\pgsql simple configuration

Re: ambari cluster not working, error in history server

Mentor

@ilia kheifets

I assume you have installed Postgres or Mysql and run the corresponding on host ubuntu17

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar 
ambari-server setup --jdbc-db=postgres --jdbc-driver=/usr/share/java/postgresql-jdbc.jar 

I have used the same user, password and database name for simplicity.

For Postgres

As the root switch to Postgres user
# su - postgres 
postgres@ubuntu17:~$ psql 
psql (9.5.9) Type "help" for help. 

Hive user/database setup

postgres=# DROP DATABASE if exists hive; 
postgres=# CREATE USER hive PASSWORD 'hive'; 
postgres=# CREATE DATABASE hive OWNER hive; 
postgres=# grant all privileges on database hive to hive; 
postgres=# \q

Oozie user/database setup

postgres=# DROP DATABASE if exists oozie; 
postgres=# CREATE USER oozie PASSWORD 'oozie'; 
postgres=# CREATE DATABASE oozie OWNER oozie; 
postgres=# grant all privileges on database oozie to oozie; 
postgres=# \q

Ranger user/database setup

postgres=# DROP DATABASE if exists rangerdb; 
postgres=# CREATE USER rangerdb PASSWORD 'rangerdb'; 
postgres=# CREATE DATABASE rangerdb OWNER rangerdb; 
postgres=# grant all privileges on database rangerdb to rangerdb; 
postgres=# \q 

Edit the pg_hba.conf

vi /etc/postgresql/9.5/main/pg_hba.conf at the end of the file in example below my ambari,hive and ranger are using postgres database

local all ambari,hive,oozie,ranger,mapred md5 
host all ambari,hive,oozie,ranger,mapred 0.0.0.0/0 md5 
host all ambari,hive,oozie,ranger,mapred ::/0 md5 

Then restart postgres

/etc/init.d/postgresql restart 

For Mysql

In this exampel I assume the root password is hadoop

hive user

# mysql -u root -phadoop 
CREATE USER 'hive'@'localhost' IDENTIFIED BY 'hive'; 
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost'; 
CREATE USER 'hive'@'%' IDENTIFIED BY 'hive'; 
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%'; 
CREATE USER 'hive'@'<HIVEMETASTORE_FQDN>' IDENTIFIED BY 'hive'; 
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'<HIVEMETASTOREFQDN>'; FLUSH PRIVILEGES; 

Create the Hive database

The Hive database must be created before loading the Hive database schema.

mysql -u root -phadoop 
CREATE DATABASE hive; quit; 

Oozie user setup

mysql -u root -phadoop 
CREATE USER 'hive'@'%' IDENTIFIED BY 'hive'; 
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%'; FLUSH PRIVILEGES; 

Create the Oozie database

The oozie database must be created before loading the oozie database schema.

mysql -u root -phadoop 
CREATE DATABASE oozie; 

After either the MySQL or Postrges setup, now in the Ambari UI hive setup see attached screenshots, you will need to use the credentials setup earlier. Choose use existing PostgreSQL/MySQL database

In the initial setup, it will ask you to test the connectivity between hive and Postgres this MUST succeed.In both setups just make sure for both cases the below correct entries are chosen.

Hive Database 
Database Name 
Database Username 
Database Password 
JDBC Driver class 
Database URL 
Hive Database Type

Hope that helps

Re: ambari cluster not working, error in history server

Explorer

few minuets before i saw this post i just successfully solved the problem, i had two issues one i did not create hive db

CREATE DATABASE hive;

i base it on your post from

https://community.hortonworks.com/answers/107905/view.html

another issue i had i in the db url connection, i change it, to localhost.

i am trying to accept your answer but i cant, don't have a button for it?

next stage is to try it with non root install