Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Creating Hive Metastore Database Tables - Failed

avatar
Explorer

Hi friend, i have this error and i have no idea from where it comes and how to fix it , am new to Cloudera please can anyone help me ?

this is a screen shot :

lol.png

 

and this is the log file :

	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:144)
	... 11 more

Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: The connection attempt failed.
	at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:201)
	at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.printTableCount(HiveMetastoreDbUtil.java:281)
	at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:331)
Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:275)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:194)
	at org.postgresql.Driver.makeConnection(Driver.java:450)
	at org.postgresql.Driver.connect(Driver.java:252)
	at java.sql.DriverManager.getConnection(DriverManager.java:571)
	at java.sql.DriverManager.getConnection(DriverManager.java:215)
	at com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:109)
	at com.cloudera.enterprise.dbutil.SqlRunner.runSingleQuery(SqlRunner.java:80)
	at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
	... 2 more
Caused by: java.net.UnknownHostException: cloudera.isetso.com
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:579)
	at org.postgresql.core.PGStream.<init>(PGStream.java:68)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:144)
	... 11 more
+ NUM_TABLES='2019-05-04 03:53:18,166 [main] ERROR com.cloudera.enterprise.dbutil.SqlRunner  - Error connecting to db with user '\''hive'\'' and jdbcUrl '\''jdbc:postgresql://cloudera.isetso.com:7432/hive'\'''
+ [[ 1 -ne 0 ]]
+ echo 'Failed to count existing tables.'
+ exit 1

 PS : am workin on Single node. and i know its a JDBC Problem but i dont know how to fix it, please can anyone provide me with detailled steps ? Thanks.

5 REPLIES 5

avatar
Contributor

Hi,

 

in case you´d want to install and configure JDBC connector to Hive, here you have the official link:

 https://www.cloudera.com/downloads/connectors/hive/jdbc/2-6-2.html

 

in that web there are documentation about installation.

 

But I think in your case the first problem is the name of the server.

Cloudera Manager is trying to look for the hostname "cloudera.isetso.com" and he can´t resolve it.

 

Check your /etc/hosts and be sure the name is correct and pointing to the right IP.

That could be a possibility.

 

Regards.

 

avatar
Explorer

thank u  so soooooooooooooooo much ❤️

that works ! but please can u tell me why all my services are in bad health ?

does that because i'm working with 7GB of RAM ? Screenshot from 2019-05-07 05-42-34.png

avatar
Contributor

Great! 😄

 

It´s possible that you have some errors, and many of that related to the others...

You can check all errors and warning in menu option "All health issues".

 

Check if the problem it´s about RAM. But I think it´s very probably that errors are concerned by "Free disk space".

 

Cloudera shows a lot of "Warning Alerts" when directories have less of 15 % of free space, and "Critical Alerts" when free space is lower than 10 %.

In your case, with only one server, it sounds a possible cause...

 

That´s alerts do not prevent services from working, but if disk it´s full services will going down.

 

avatar
New Contributor

thanks

avatar
Explorer

Hi, Team I'm facing an issue on the hive, please suggest a solution.prasanna06_0-1675257537100.png

log file:

jar:/opt/cloudera/parcels/CDH-7.1.7-1.cdh7.1.7.p0.15945976/lib/hadoop-mapreduce/ranger-raz-intg-2.1.0.7.1.7.0-551.jar:/usr/share/java/mysql-connector-java.jar:/opt/cloudera/cm/lib/postgresql-42.2.14.jre7.jar:/usr/share/java/oracle-connector-java.jar
+ [[ -n '' ]]
+ [[ create_metastore_tables == webhcat ]]
+ [[ create_metastore_tables == hiveserver2 ]]
+ [[ create_metastore_tables == updatelocation ]]
+ [[ create_metastore_tables == create_metastore_tables ]]
+ [[ -z /opt/cloudera/cm ]]
+ JDBC_JARS_CLASSPATH='/opt/cloudera/cm/lib/*:/usr/share/java/mysql-connector-java.jar:/opt/cloudera/cm/lib/postgresql-42.2.14.jre7.jar:/usr/share/java/oracle-connector-java.jar'
+ [[ create_metastore_tables == create_metastore_tables ]]
+ '[' 7 -ge 5 ']'
+ skip_if_tables_exist metastore_db_py.properties
+ '[' -z metastore_db_py.properties ']'
+ DB_INFO_FILENAME=metastore_db_py.properties
+ JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/opt/cloudera/cm/lib/postgresql-42.2.14.jre7.jar:/usr/share/java/oracle-connector-java.jar
+ [[ -z /opt/cloudera/cm ]]
+ JDBC_JARS_CLASSPATH='/opt/cloudera/cm/lib/*:/usr/share/java/mysql-connector-java.jar:/opt/cloudera/cm/lib/postgresql-42.2.14.jre7.jar:/usr/share/java/oracle-connector-java.jar'
++ /usr/java/jdk1.8.0_232-cloudera/bin/java -Djava.net.preferIPv4Stack=true -cp '/opt/cloudera/cm/lib/*:/usr/share/java/mysql-connector-java.jar:/opt/cloudera/cm/lib/postgresql-42.2.14.jre7.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /var/run/cloudera-scm-agent/process/1546335447-hive-metastore-create-tables/metastore_db_py.properties unused --printTableCount
Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: The connection attempt failed.
	at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:203)
	at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.printTableCount(HiveMetastoreDbUtil.java:284)
	at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:354)
Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:297)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:217)
	at org.postgresql.Driver.makeConnection(Driver.java:458)
	at org.postgresql.Driver.connect(Driver.java:260)
	at java.sql.DriverManager.getConnection(DriverManager.java:664)
	at java.sql.DriverManager.getConnection(DriverManager.java:247)
	at com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:193)
	at com.cloudera.enterprise.dbutil.SqlRunner.getDatabaseName(SqlRunner.java:264)
	at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:197)
	... 2 more
Caused by: java.net.SocketTimeoutException: connect timed out
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:607)
	at org.postgresql.core.PGStream.<init>(PGStream.java:81)
	at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:93)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197)
	... 11 more
+ NUM_TABLES='[                          main] SqlRunner                      ERROR Error connecting to db with user '\''hive'\'' and jdbcUrl '\''jdbc:postgresql://gateway:7432/hive'\'''
+ [[ 1 -ne 0 ]]
+ echo 'Failed to count existing tables.'
+ exit 1