FAQ
I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.
The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
following error:

[2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)
  - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm
not sure if that was a bad idea.

Here are the logs:
*stderr:*

+ date
+ date
++ dirname /usr/lib/cmf/service/hive/hive.sh
+ cloudera_config=/usr/lib/cmf/service/hive
++ cd /usr/lib/cmf/service/hive/../common
++ pwd
+ cloudera_config=/usr/lib/cmf/service/common
+ . /usr/lib/cmf/service/common/cloudera-config.sh
++ set -x
+ locate_java_home
+ '[' -z '' ']'
+ for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
+ '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
+ for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
+ '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
+ for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
+ '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
+ for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
+ '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
+ for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
+ '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
+ export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
+ JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
+ break
+ '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
+ source_parcel_environment
+ '[' '!' -z '' ']'
+ set_hive_classpath
+ set_classpath_in_var AUX_CLASSPATH
+ '[' -z AUX_CLASSPATH ']'
+ '[' /usr/share/cmf ']'
++ tr '\n' :
++ find /usr/share/cmf/lib/plugins -name '*.jar'
+ ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
+ ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
+ eval 'OLD_VALUE=$AUX_CLASSPATH'
++ OLD_VALUE=
+ '[' -z ']'
+ export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
+ AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
+ '[' 4 = 4 ']'
+ export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
+ HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
+ echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
+ echo 'using 4 as CDH_VERSION'
+ export HADOOP_HOME=/usr/lib/hadoop
+ HADOOP_HOME=/usr/lib/hadoop
+ export HIVE_HOME=/usr/lib/hive
+ HIVE_HOME=/usr/lib/hive
+ export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
+ HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
+ '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
+ '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
+ export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
+ HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
+ '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
+ cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
+ echo 'using /usr/lib/hive as HIVE_HOME'
+ echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
+ echo 'using /usr/lib/hadoop as HADOOP_HOME'
+ echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
+ perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
+ JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
+ [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
+ export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
+ AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
+ copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
+ [[ -z 4 ]]
+ '[' 1 -ne 1 ']'
+ [[ 4 == 3 ]]
+ [[ create_metastore_tables == webhcat ]]
+ [[ create_metastore_tables == updatelocation ]]
+ [[ create_metastore_tables == create_metastore_tables ]]
+ [[ -z '' ]]
+ CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
++ dirname /usr/lib/cmf/service/hive/hive.sh
+ exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
log4j:ERROR Could not find value for key log4j.appender.A
log4j:ERROR Could not instantiate appender named "A".
Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
  at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
  at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
  at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
  at org.postgresql.jdbc2.AbstractJdbc2Connection.(AbstractJdbc3Connection.java:30)
  at org.postgresql.jdbc3g.AbstractJdbc3gConnection.(AbstractJdbc4Connection.java:30)
  at org.postgresql.jdbc4.Jdbc4Connection.(Driver.java:393)
  at org.postgresql.Driver.connect(Driver.java:267)
  at java.sql.DriverManager.getConnection(DriverManager.java:582)
  at java.sql.DriverManager.getConnection(DriverManager.java:185)
  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:191)
  ... 2 more
Caused by: java.net.ConnectException: Connection timed out
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
  at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
  at java.net.Socket.connect(Socket.java:529)
  at java.net.Socket.connect(Socket.java:478)
  at java.net.Socket.(Socket.java:189)
  at org.postgresql.core.PGStream.(ConnectionFactoryImpl.java:76)
  ... 15 more
*STD OUT:
*
using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
using 4 as CDH_VERSION
using /usr/lib/hive as HIVE_HOME
using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
using /usr/lib/hadoop as HADOOP_HOME
using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
Any help is greatly appreciated!!

Search Discussions

  • Darren Lo at Jul 12, 2013 at 8:24 pm
    Opening the port was a good idea. Did you retry your setup after opening
    the port?

    If you still hit trouble, ssh into your CM host and run:
    service cloudera-scm-server-db status

    If the database is running, then try running the Hive command to create the
    hive database before creating the tables.

    If you get that working, you can probably retry the setup.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 12:21 PM, Ryan Collins wrote:

    I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.
    The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
    following error:

    [2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)
    - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

    I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm
    not sure if that was a bad idea.

    Here are the logs:
    *stderr:*

    + date
    + date
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + cloudera_config=/usr/lib/cmf/service/hive
    ++ cd /usr/lib/cmf/service/hive/../common
    ++ pwd
    + cloudera_config=/usr/lib/cmf/service/common
    + . /usr/lib/cmf/service/common/cloudera-config.sh
    ++ set -x
    + locate_java_home
    + '[' -z '' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
    + export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + break
    + '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
    + source_parcel_environment
    + '[' '!' -z '' ']'
    + set_hive_classpath
    + set_classpath_in_var AUX_CLASSPATH
    + '[' -z AUX_CLASSPATH ']'
    + '[' /usr/share/cmf ']'
    ++ tr '\n' :
    ++ find /usr/share/cmf/lib/plugins -name '*.jar'
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + eval 'OLD_VALUE=$AUX_CLASSPATH'
    ++ OLD_VALUE=
    + '[' -z ']'
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + '[' 4 = 4 ']'
    + export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
    + echo 'using 4 as CDH_VERSION'
    + export HADOOP_HOME=/usr/lib/hadoop
    + HADOOP_HOME=/usr/lib/hadoop
    + export HIVE_HOME=/usr/lib/hive
    + HIVE_HOME=/usr/lib/hive
    + export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
    + export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
    + cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + echo 'using /usr/lib/hive as HIVE_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
    + echo 'using /usr/lib/hadoop as HADOOP_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
    + perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
    + JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + [[ -z 4 ]]
    + '[' 1 -ne 1 ']'
    + [[ 4 == 3 ]]
    + [[ create_metastore_tables == webhcat ]]
    + [[ create_metastore_tables == updatelocation ]]
    + [[ create_metastore_tables == create_metastore_tables ]]
    + [[ -z '' ]]
    + CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
    Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    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:191)
    ... 2 more
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
    ... 15 more
    *STD OUT:
    *
    using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
    using 4 as CDH_VERSION
    using /usr/lib/hive as HIVE_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
    using /usr/lib/hadoop as HADOOP_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
    INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
    INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
    INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
    ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
    Any help is greatly appreciated!!

    --
    Thanks,
    Darren
  • Ryan Collins at Jul 12, 2013 at 8:45 pm
    Thank you for your advice. I executed that command and indeed the manager
    database is running. I could not find the hive command to create a new
    database though, and it seems like it would not work anyway because "hive"
    currently does nothing when I enter it into the ssh session.

    Is there anyway to make sure that that user "hive" will be able to access
    the database? For instance, when I tried to check if the postgres database
    existed it promted me for a password and I had no idea what it was so I
    sudo-ed my way around it.

    Thanks again.

    On Fri, Jul 12, 2013 at 4:24 PM, Darren Lo wrote:

    Opening the port was a good idea. Did you retry your setup after opening
    the port?

    If you still hit trouble, ssh into your CM host and run:
    service cloudera-scm-server-db status

    If the database is running, then try running the Hive command to create
    the hive database before creating the tables.

    If you get that working, you can probably retry the setup.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 12:21 PM, Ryan Collins wrote:

    I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.


    The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
    following error:

    [2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)


    - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

    I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm


    not sure if that was a bad idea.

    Here are the logs:
    *stderr:*

    + date
    + date
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + cloudera_config=/usr/lib/cmf/service/hive
    ++ cd /usr/lib/cmf/service/hive/../common
    ++ pwd
    + cloudera_config=/usr/lib/cmf/service/common
    + . /usr/lib/cmf/service/common/cloudera-config.sh
    ++ set -x
    + locate_java_home
    + '[' -z '' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
    + export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + break
    + '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
    + source_parcel_environment
    + '[' '!' -z '' ']'
    + set_hive_classpath
    + set_classpath_in_var AUX_CLASSPATH
    + '[' -z AUX_CLASSPATH ']'
    + '[' /usr/share/cmf ']'
    ++ tr '\n' :
    ++ find /usr/share/cmf/lib/plugins -name '*.jar'
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + eval 'OLD_VALUE=$AUX_CLASSPATH'
    ++ OLD_VALUE=
    + '[' -z ']'
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + '[' 4 = 4 ']'
    + export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
    + echo 'using 4 as CDH_VERSION'
    + export HADOOP_HOME=/usr/lib/hadoop
    + HADOOP_HOME=/usr/lib/hadoop
    + export HIVE_HOME=/usr/lib/hive
    + HIVE_HOME=/usr/lib/hive
    + export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
    + export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
    + cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + echo 'using /usr/lib/hive as HIVE_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
    + echo 'using /usr/lib/hadoop as HADOOP_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
    + perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
    + JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + [[ -z 4 ]]
    + '[' 1 -ne 1 ']'
    + [[ 4 == 3 ]]
    + [[ create_metastore_tables == webhcat ]]
    + [[ create_metastore_tables == updatelocation ]]
    + [[ create_metastore_tables == create_metastore_tables ]]
    + [[ -z '' ]]
    + CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
    Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    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:191)
    ... 2 more
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
    ... 15 more
    *STD OUT:
    *
    using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
    using 4 as CDH_VERSION
    using /usr/lib/hive as HIVE_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
    using /usr/lib/hadoop as HADOOP_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
    INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
    INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
    INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
    ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
    Any help is greatly appreciated!!

    --
    Thanks,
    Darren
  • Darren Lo at Jul 12, 2013 at 9:06 pm
    I meant the Hive service command available in the CM UI, not the hive CLI
    command, sorry for the confusion. The "hive" CLI command won't do anything
    until you deploy client configs to /etc/hive/conf, which is done near the
    end of installation, so that's normal. You should just retry your setup
    though rather than trying to run in manually.

    On Fri, Jul 12, 2013 at 1:43 PM, Ryan Collins wrote:

    Thank you for your advice. I executed that command and indeed the manager
    database is running. I could not find the hive command to create a new
    database though, and it seems like it would not work anyway because "hive"
    currently does nothing when I enter it into the ssh session.

    Is there anyway to make sure that that user "hive" will be able to access
    the database? For instance, when I tried to check if the postgres database
    existed it promted me for a password and I had no idea what it was so I
    sudo-ed my way around it.

    Thanks again.

    On Fri, Jul 12, 2013 at 4:24 PM, Darren Lo wrote:

    Opening the port was a good idea. Did you retry your setup after opening
    the port?

    If you still hit trouble, ssh into your CM host and run:
    service cloudera-scm-server-db status

    If the database is running, then try running the Hive command to create
    the hive database before creating the tables.

    If you get that working, you can probably retry the setup.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 12:21 PM, Ryan Collins wrote:

    I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.



    The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
    following error:

    [2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)



    - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

    I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm



    not sure if that was a bad idea.

    Here are the logs:
    *stderr:*

    + date
    + date
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + cloudera_config=/usr/lib/cmf/service/hive
    ++ cd /usr/lib/cmf/service/hive/../common
    ++ pwd
    + cloudera_config=/usr/lib/cmf/service/common
    + . /usr/lib/cmf/service/common/cloudera-config.sh
    ++ set -x
    + locate_java_home
    + '[' -z '' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
    + export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + break
    + '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
    + source_parcel_environment
    + '[' '!' -z '' ']'
    + set_hive_classpath
    + set_classpath_in_var AUX_CLASSPATH
    + '[' -z AUX_CLASSPATH ']'
    + '[' /usr/share/cmf ']'
    ++ tr '\n' :
    ++ find /usr/share/cmf/lib/plugins -name '*.jar'
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + eval 'OLD_VALUE=$AUX_CLASSPATH'
    ++ OLD_VALUE=
    + '[' -z ']'
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + '[' 4 = 4 ']'
    + export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
    + echo 'using 4 as CDH_VERSION'
    + export HADOOP_HOME=/usr/lib/hadoop
    + HADOOP_HOME=/usr/lib/hadoop
    + export HIVE_HOME=/usr/lib/hive
    + HIVE_HOME=/usr/lib/hive
    + export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
    + export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
    + cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + echo 'using /usr/lib/hive as HIVE_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
    + echo 'using /usr/lib/hadoop as HADOOP_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
    + perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
    + JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + [[ -z 4 ]]
    + '[' 1 -ne 1 ']'
    + [[ 4 == 3 ]]
    + [[ create_metastore_tables == webhcat ]]
    + [[ create_metastore_tables == updatelocation ]]
    + [[ create_metastore_tables == create_metastore_tables ]]
    + [[ -z '' ]]
    + CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
    Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    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:191)
    ... 2 more
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
    ... 15 more
    *STD OUT:
    *
    using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
    using 4 as CDH_VERSION
    using /usr/lib/hive as HIVE_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
    using /usr/lib/hadoop as HADOOP_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
    INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
    INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
    INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
    ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
    Any help is greatly appreciated!!

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren
  • Ryan Collins at Jul 12, 2013 at 9:22 pm
    I did retry the set up and each time it fails at the same step. When I try
    to create the hive database with the manager it says that the database
    already exists. Is there any chance it has to do with the psql permissions?
    I went into /var/lib/cloudera-scm-server-db/data and looked at the
    pg_hba.conf file and found this:

    # TYPE DATABASE USER CIDR-ADDRESS METHOD

    # "local" is for Unix domain socket connections only
    local all all md5
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
    # IPv6 local connections:
    host all all ::1/128 md5
    # Accept connections from all hosts
    host smon smon 0.0.0.0/0 md5
    host amon amon 0.0.0.0/0 md5
    host hmon hmon 0.0.0.0/0 md5
    host rman rman 0.0.0.0/0 md5
    host nav nav 0.0.0.0/0 md5
    # block remote access for admin user and scm
    host all cloudera-scm,scm 0.0.0.0/0 reject
    # enable remote access for other users
    host sameuser all 0.0.0.0/0 md5

    It seems fishy to me that it is only allowing local hosts, but I am very
    newbie when it comes to this.

    Any thoughts?

    Thank you again for all of your help.

    -Ryan



    On Fri, Jul 12, 2013 at 5:06 PM, Darren Lo wrote:

    I meant the Hive service command available in the CM UI, not the hive CLI
    command, sorry for the confusion. The "hive" CLI command won't do anything
    until you deploy client configs to /etc/hive/conf, which is done near the
    end of installation, so that's normal. You should just retry your setup
    though rather than trying to run in manually.

    On Fri, Jul 12, 2013 at 1:43 PM, Ryan Collins wrote:

    Thank you for your advice. I executed that command and indeed the manager
    database is running. I could not find the hive command to create a new
    database though, and it seems like it would not work anyway because "hive"
    currently does nothing when I enter it into the ssh session.

    Is there anyway to make sure that that user "hive" will be able to access
    the database? For instance, when I tried to check if the postgres database
    existed it promted me for a password and I had no idea what it was so I
    sudo-ed my way around it.

    Thanks again.

    On Fri, Jul 12, 2013 at 4:24 PM, Darren Lo wrote:

    Opening the port was a good idea. Did you retry your setup after opening
    the port?

    If you still hit trouble, ssh into your CM host and run:
    service cloudera-scm-server-db status

    If the database is running, then try running the Hive command to create
    the hive database before creating the tables.

    If you get that working, you can probably retry the setup.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 12:21 PM, Ryan Collins wrote:

    I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.





    The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
    following error:

    [2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)





    - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

    I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm





    not sure if that was a bad idea.

    Here are the logs:
    *stderr:*

    + date
    + date
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + cloudera_config=/usr/lib/cmf/service/hive
    ++ cd /usr/lib/cmf/service/hive/../common
    ++ pwd
    + cloudera_config=/usr/lib/cmf/service/common
    + . /usr/lib/cmf/service/common/cloudera-config.sh
    ++ set -x
    + locate_java_home
    + '[' -z '' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
    + export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + break
    + '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
    + source_parcel_environment
    + '[' '!' -z '' ']'
    + set_hive_classpath
    + set_classpath_in_var AUX_CLASSPATH
    + '[' -z AUX_CLASSPATH ']'
    + '[' /usr/share/cmf ']'
    ++ tr '\n' :
    ++ find /usr/share/cmf/lib/plugins -name '*.jar'
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + eval 'OLD_VALUE=$AUX_CLASSPATH'
    ++ OLD_VALUE=
    + '[' -z ']'
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + '[' 4 = 4 ']'
    + export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
    + echo 'using 4 as CDH_VERSION'
    + export HADOOP_HOME=/usr/lib/hadoop
    + HADOOP_HOME=/usr/lib/hadoop
    + export HIVE_HOME=/usr/lib/hive
    + HIVE_HOME=/usr/lib/hive
    + export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
    + export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
    + cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + echo 'using /usr/lib/hive as HIVE_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
    + echo 'using /usr/lib/hadoop as HADOOP_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
    + perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
    + JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + [[ -z 4 ]]
    + '[' 1 -ne 1 ']'
    + [[ 4 == 3 ]]
    + [[ create_metastore_tables == webhcat ]]
    + [[ create_metastore_tables == updatelocation ]]
    + [[ create_metastore_tables == create_metastore_tables ]]
    + [[ -z '' ]]
    + CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
    Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    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:191)
    ... 2 more
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
    ... 15 more
    *STD OUT:
    *
    using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
    using 4 as CDH_VERSION
    using /usr/lib/hive as HIVE_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
    using /usr/lib/hadoop as HADOOP_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
    INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
    INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
    INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
    ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
    Any help is greatly appreciated!!

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren
  • Darren Lo at Jul 12, 2013 at 10:11 pm
    Hi Ryan,

    The last line allows remote connections for users to a database named the
    same thing as the user, so db user "hive" can connect to database "hive"
    even if not on localhost.

    Can you try using psql and specifying all of the options that Hive is
    currently using, including host name, port, username, and database name?
    You can find hive's db info by clicking on the Hive service, clicking on
    the Hive Metastore, clicking on Processes, finding the process that tried
    to create the tables, clicking Show, then finding the file that has the db
    info and clicking it (I forget the name, but should be pretty clear).

    You might also want to try using postegres to manually reset hive's
    password or just delete the hive account. Maybe something messed up and CM
    re-generated the hive password, which no longer matches the db. You can
    find admin info in generated_password.txt in your /data directory where
    pg_hba.conf is located.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 2:20 PM, Ryan Collins wrote:

    I did retry the set up and each time it fails at the same step. When I try
    to create the hive database with the manager it says that the database
    already exists. Is there any chance it has to do with the psql permissions?
    I went into /var/lib/cloudera-scm-server-db/data and looked at the
    pg_hba.conf file and found this:

    # TYPE DATABASE USER CIDR-ADDRESS METHOD

    # "local" is for Unix domain socket connections only
    local all all md5
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
    # IPv6 local connections:
    host all all ::1/128 md5
    # Accept connections from all hosts
    host smon smon 0.0.0.0/0 md5
    host amon amon 0.0.0.0/0 md5
    host hmon hmon 0.0.0.0/0 md5
    host rman rman 0.0.0.0/0 md5
    host nav nav 0.0.0.0/0 md5
    # block remote access for admin user and scm
    host all cloudera-scm,scm 0.0.0.0/0 reject
    # enable remote access for other users
    host sameuser all 0.0.0.0/0 md5

    It seems fishy to me that it is only allowing local hosts, but I am very
    newbie when it comes to this.

    Any thoughts?

    Thank you again for all of your help.

    -Ryan



    On Fri, Jul 12, 2013 at 5:06 PM, Darren Lo wrote:

    I meant the Hive service command available in the CM UI, not the hive CLI
    command, sorry for the confusion. The "hive" CLI command won't do anything
    until you deploy client configs to /etc/hive/conf, which is done near the
    end of installation, so that's normal. You should just retry your setup
    though rather than trying to run in manually.

    On Fri, Jul 12, 2013 at 1:43 PM, Ryan Collins wrote:

    Thank you for your advice. I executed that command and indeed the
    manager database is running. I could not find the hive command to create a
    new database though, and it seems like it would not work anyway because
    "hive" currently does nothing when I enter it into the ssh session.

    Is there anyway to make sure that that user "hive" will be able to
    access the database? For instance, when I tried to check if the postgres
    database existed it promted me for a password and I had no idea what it was
    so I sudo-ed my way around it.

    Thanks again.

    On Fri, Jul 12, 2013 at 4:24 PM, Darren Lo wrote:

    Opening the port was a good idea. Did you retry your setup after
    opening the port?

    If you still hit trouble, ssh into your CM host and run:
    service cloudera-scm-server-db status

    If the database is running, then try running the Hive command to create
    the hive database before creating the tables.

    If you get that working, you can probably retry the setup.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 12:21 PM, Ryan Collins wrote:

    I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.






    The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
    following error:

    [2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)






    - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

    I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm






    not sure if that was a bad idea.

    Here are the logs:
    *stderr:*

    + date
    + date
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + cloudera_config=/usr/lib/cmf/service/hive
    ++ cd /usr/lib/cmf/service/hive/../common
    ++ pwd
    + cloudera_config=/usr/lib/cmf/service/common
    + . /usr/lib/cmf/service/common/cloudera-config.sh
    ++ set -x
    + locate_java_home
    + '[' -z '' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
    + export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + break
    + '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
    + source_parcel_environment
    + '[' '!' -z '' ']'
    + set_hive_classpath
    + set_classpath_in_var AUX_CLASSPATH
    + '[' -z AUX_CLASSPATH ']'
    + '[' /usr/share/cmf ']'
    ++ tr '\n' :
    ++ find /usr/share/cmf/lib/plugins -name '*.jar'
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + eval 'OLD_VALUE=$AUX_CLASSPATH'
    ++ OLD_VALUE=
    + '[' -z ']'
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + '[' 4 = 4 ']'
    + export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
    + echo 'using 4 as CDH_VERSION'
    + export HADOOP_HOME=/usr/lib/hadoop
    + HADOOP_HOME=/usr/lib/hadoop
    + export HIVE_HOME=/usr/lib/hive
    + HIVE_HOME=/usr/lib/hive
    + export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
    + export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
    + cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + echo 'using /usr/lib/hive as HIVE_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
    + echo 'using /usr/lib/hadoop as HADOOP_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
    + perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
    + JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + [[ -z 4 ]]
    + '[' 1 -ne 1 ']'
    + [[ 4 == 3 ]]
    + [[ create_metastore_tables == webhcat ]]
    + [[ create_metastore_tables == updatelocation ]]
    + [[ create_metastore_tables == create_metastore_tables ]]
    + [[ -z '' ]]
    + CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
    Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    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:191)
    ... 2 more
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
    ... 15 more
    *STD OUT:
    *
    using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
    using 4 as CDH_VERSION
    using /usr/lib/hive as HIVE_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
    using /usr/lib/hadoop as HADOOP_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
    INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
    INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
    INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
    ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
    Any help is greatly appreciated!!

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren
  • Ryan Collins at Jul 15, 2013 at 7:54 pm
    Hi Darren,

    Here is the database information:

    <?xml version="1.0" encoding="UTF-8"?>

    <!--Autogenerated by Cloudera CM on 2013-07-15T16:03:04.088Z-->
    <configuration>
       <property>
         <name>javax.jdo.option.ConnectionURL</name>
         <value>jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive</value>
       </property>
       <property>
         <name>javax.jdo.option.ConnectionDriverName</name>
         <value>org.postgresql.Driver</value>
       </property>
       <property>
         <name>javax.jdo.option.ConnectionUserName</name>
         <value>hive</value>
       </property>
       <property>
         <name>javax.jdo.option.ConnectionPassword</name>
         <value>AtIxEz750f</value>
       </property>
       <property>
         <name>hive.metastore.local</name>
         <value>true</value>
       </property>
       <property>
         <name>datanucleus.autoCreateSchema</name>
         <value>false</value>
       </property>
       <property>
         <name>datanucleus.metadata.validate</name>
         <value>false</value>
       </property>
       <property>
         <name>hive.metastore.warehouse.dir</name>
         <value>/user/hive/warehouse</value>
       </property>
       <property>
         <name>hive.warehouse.subdir.inherit.perms</name>
         <value>true</value>
       </property>
       <property>
         <name>mapred.reduce.tasks</name>
         <value>-1</value>
       </property>
       <property>
         <name>hive.exec.reducers.bytes.per.reducer</name>
         <value>1073741824</value>
       </property>
       <property>
         <name>hive.exec.reducers.max</name>
         <value>999</value>
       </property>
       <property>
         <name>hive.metastore.execute.setugi</name>
         <value>true</value>
       </property>
       <property>
         <name>hive.support.concurrency</name>
         <value>true</value>
       </property>
       <property>
         <name>hive.zookeeper.quorum</name>
         <value>ip-xx-xxx-xxx-xxx.ec2.internal</value>
       </property>
       <property>
         <name>hive.zookeeper.client.port</name>
         <value>2181</value>
       </property>
       <property>
         <name>hive.metastore.server.min.threads</name>
         <value>200</value>
       </property>
       <property>
         <name>hive.metastore.server.max.threads</name>
         <value>100000</value>
       </property>
    </configuration>


    When I look at the postgres database on the cloudera manager ec2 instance,
    it does not recognize the user hive. There is also no database hive. Also,
    when I look in the directory where I found the authentication information
    there is no data directory. Am I looking in the right place for the psql
    info?

    Thank you again for all of your help and sorry for the newbie questions :P


    -Ryan

    On Fri, Jul 12, 2013 at 6:11 PM, Darren Lo wrote:

    Hi Ryan,

    The last line allows remote connections for users to a database named the
    same thing as the user, so db user "hive" can connect to database "hive"
    even if not on localhost.

    Can you try using psql and specifying all of the options that Hive is
    currently using, including host name, port, username, and database name?
    You can find hive's db info by clicking on the Hive service, clicking on
    the Hive Metastore, clicking on Processes, finding the process that tried
    to create the tables, clicking Show, then finding the file that has the db
    info and clicking it (I forget the name, but should be pretty clear).

    You might also want to try using postegres to manually reset hive's
    password or just delete the hive account. Maybe something messed up and CM
    re-generated the hive password, which no longer matches the db. You can
    find admin info in generated_password.txt in your /data directory where
    pg_hba.conf is located.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 2:20 PM, Ryan Collins wrote:

    I did retry the set up and each time it fails at the same step. When I
    try to create the hive database with the manager it says that the database
    already exists. Is there any chance it has to do with the psql permissions?
    I went into /var/lib/cloudera-scm-server-db/data and looked at the
    pg_hba.conf file and found this:

    # TYPE DATABASE USER CIDR-ADDRESS METHOD

    # "local" is for Unix domain socket connections only
    local all all md5
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
    # IPv6 local connections:
    host all all ::1/128 md5
    # Accept connections from all hosts
    host smon smon 0.0.0.0/0 md5
    host amon amon 0.0.0.0/0 md5
    host hmon hmon 0.0.0.0/0 md5
    host rman rman 0.0.0.0/0 md5
    host nav nav 0.0.0.0/0 md5
    # block remote access for admin user and scm
    host all cloudera-scm,scm 0.0.0.0/0 reject
    # enable remote access for other users
    host sameuser all 0.0.0.0/0 md5

    It seems fishy to me that it is only allowing local hosts, but I am very
    newbie when it comes to this.

    Any thoughts?

    Thank you again for all of your help.

    -Ryan



    On Fri, Jul 12, 2013 at 5:06 PM, Darren Lo wrote:

    I meant the Hive service command available in the CM UI, not the hive
    CLI command, sorry for the confusion. The "hive" CLI command won't do
    anything until you deploy client configs to /etc/hive/conf, which is done
    near the end of installation, so that's normal. You should just retry your
    setup though rather than trying to run in manually.

    On Fri, Jul 12, 2013 at 1:43 PM, Ryan Collins wrote:

    Thank you for your advice. I executed that command and indeed the
    manager database is running. I could not find the hive command to create a
    new database though, and it seems like it would not work anyway because
    "hive" currently does nothing when I enter it into the ssh session.

    Is there anyway to make sure that that user "hive" will be able to
    access the database? For instance, when I tried to check if the postgres
    database existed it promted me for a password and I had no idea what it was
    so I sudo-ed my way around it.

    Thanks again.

    On Fri, Jul 12, 2013 at 4:24 PM, Darren Lo wrote:

    Opening the port was a good idea. Did you retry your setup after
    opening the port?

    If you still hit trouble, ssh into your CM host and run:
    service cloudera-scm-server-db status

    If the database is running, then try running the Hive command to
    create the hive database before creating the tables.

    If you get that working, you can probably retry the setup.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 12:21 PM, Ryan Collins wrote:

    I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.








    The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
    following error:

    [2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)








    - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

    I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm








    not sure if that was a bad idea.

    Here are the logs:
    *stderr:*

    + date
    + date
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + cloudera_config=/usr/lib/cmf/service/hive
    ++ cd /usr/lib/cmf/service/hive/../common
    ++ pwd
    + cloudera_config=/usr/lib/cmf/service/common
    + . /usr/lib/cmf/service/common/cloudera-config.sh
    ++ set -x
    + locate_java_home
    + '[' -z '' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
    + export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + break
    + '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
    + source_parcel_environment
    + '[' '!' -z '' ']'
    + set_hive_classpath
    + set_classpath_in_var AUX_CLASSPATH
    + '[' -z AUX_CLASSPATH ']'
    + '[' /usr/share/cmf ']'
    ++ tr '\n' :
    ++ find /usr/share/cmf/lib/plugins -name '*.jar'
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + eval 'OLD_VALUE=$AUX_CLASSPATH'
    ++ OLD_VALUE=
    + '[' -z ']'
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + '[' 4 = 4 ']'
    + export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
    + echo 'using 4 as CDH_VERSION'
    + export HADOOP_HOME=/usr/lib/hadoop
    + HADOOP_HOME=/usr/lib/hadoop
    + export HIVE_HOME=/usr/lib/hive
    + HIVE_HOME=/usr/lib/hive
    + export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
    + export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
    + cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + echo 'using /usr/lib/hive as HIVE_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
    + echo 'using /usr/lib/hadoop as HADOOP_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
    + perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
    + JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + [[ -z 4 ]]
    + '[' 1 -ne 1 ']'
    + [[ 4 == 3 ]]
    + [[ create_metastore_tables == webhcat ]]
    + [[ create_metastore_tables == updatelocation ]]
    + [[ create_metastore_tables == create_metastore_tables ]]
    + [[ -z '' ]]
    + CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
    Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    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:191)
    ... 2 more
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
    ... 15 more
    *STD OUT:
    *
    using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
    using 4 as CDH_VERSION
    using /usr/lib/hive as HIVE_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
    using /usr/lib/hadoop as HADOOP_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
    INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
    INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
    INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
    ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
    Any help is greatly appreciated!!

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren
  • Darren Lo at Jul 15, 2013 at 8:23 pm
    Hi Ryan,

    Your command to create the database failed because it already exists,
    right? That means that there must be a database with the name "hive".

    When I referred to the data directory, I meant the one you mentioned
    earlier, "/var/lib/cloudera-scm-server-db/data". Look in the file "
    /var/lib/cloudera-scm-server-db/data/generated_password.txt" to get the
    admin login info for your postgres, then use the "psql" command line to
    connect with that user to the database (must be ssh'd into the host where
    the cm server and db is hosted). The admin must log in using localhost.
    psql --host=localhost --port=7432 --username=cloudera-scm --dbname=postgres

    It will prompt you for the password, which is located in
    /var/lib/cloudera-scm-server-db/data/generated_password.txt.

    Once logged in, you should find that there is a hive user (select usename
    from pg_user;) and database (\list), since that's what the CM create
    database command said.

    Then try to log in using your hive info in hive-site.xml that you just sent
    over, remembering to replace host below with normal host name (must not be
    localhost):
    psql --host=ip-xx-xxx-xx-x.ec2.internal --port=7432 --username=hive
    --dbname=hive

    If that's not working, it is probably some kind of firewall setting. Once
    you get this command working, then the HMS should be able to create tables
    and then start up normally.

    Thanks,
    Darren

    On Mon, Jul 15, 2013 at 12:53 PM, Ryan Collins wrote:

    Hi Darren,

    Here is the database information:

    <?xml version="1.0" encoding="UTF-8"?>

    <!--Autogenerated by Cloudera CM on 2013-07-15T16:03:04.088Z-->
    <configuration>
    <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>org.postgresql.Driver</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>hive</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>AtIxEz750f</value>
    </property>
    <property>
    <name>hive.metastore.local</name>
    <value>true</value>
    </property>
    <property>
    <name>datanucleus.autoCreateSchema</name>
    <value>false</value>
    </property>
    <property>
    <name>datanucleus.metadata.validate</name>
    <value>false</value>
    </property>
    <property>
    <name>hive.metastore.warehouse.dir</name>
    <value>/user/hive/warehouse</value>
    </property>
    <property>
    <name>hive.warehouse.subdir.inherit.perms</name>
    <value>true</value>
    </property>
    <property>
    <name>mapred.reduce.tasks</name>
    <value>-1</value>
    </property>
    <property>
    <name>hive.exec.reducers.bytes.per.reducer</name>
    <value>1073741824</value>
    </property>
    <property>
    <name>hive.exec.reducers.max</name>
    <value>999</value>
    </property>
    <property>
    <name>hive.metastore.execute.setugi</name>
    <value>true</value>
    </property>
    <property>
    <name>hive.support.concurrency</name>
    <value>true</value>
    </property>
    <property>
    <name>hive.zookeeper.quorum</name>
    <value>ip-xx-xxx-xxx-xxx.ec2.internal</value>
    </property>
    <property>
    <name>hive.zookeeper.client.port</name>
    <value>2181</value>
    </property>
    <property>
    <name>hive.metastore.server.min.threads</name>
    <value>200</value>
    </property>
    <property>
    <name>hive.metastore.server.max.threads</name>
    <value>100000</value>
    </property>
    </configuration>


    When I look at the postgres database on the cloudera manager ec2 instance,
    it does not recognize the user hive. There is also no database hive. Also,
    when I look in the directory where I found the authentication information
    there is no data directory. Am I looking in the right place for the psql
    info?

    Thank you again for all of your help and sorry for the newbie questions :P


    -Ryan

    On Fri, Jul 12, 2013 at 6:11 PM, Darren Lo wrote:

    Hi Ryan,

    The last line allows remote connections for users to a database named the
    same thing as the user, so db user "hive" can connect to database "hive"
    even if not on localhost.

    Can you try using psql and specifying all of the options that Hive is
    currently using, including host name, port, username, and database name?
    You can find hive's db info by clicking on the Hive service, clicking on
    the Hive Metastore, clicking on Processes, finding the process that tried
    to create the tables, clicking Show, then finding the file that has the db
    info and clicking it (I forget the name, but should be pretty clear).

    You might also want to try using postegres to manually reset hive's
    password or just delete the hive account. Maybe something messed up and CM
    re-generated the hive password, which no longer matches the db. You can
    find admin info in generated_password.txt in your /data directory where
    pg_hba.conf is located.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 2:20 PM, Ryan Collins wrote:

    I did retry the set up and each time it fails at the same step. When I
    try to create the hive database with the manager it says that the database
    already exists. Is there any chance it has to do with the psql permissions?
    I went into /var/lib/cloudera-scm-server-db/data and looked at the
    pg_hba.conf file and found this:

    # TYPE DATABASE USER CIDR-ADDRESS METHOD

    # "local" is for Unix domain socket connections only
    local all all md5
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
    # IPv6 local connections:
    host all all ::1/128 md5
    # Accept connections from all hosts
    host smon smon 0.0.0.0/0 md5
    host amon amon 0.0.0.0/0 md5
    host hmon hmon 0.0.0.0/0 md5
    host rman rman 0.0.0.0/0 md5
    host nav nav 0.0.0.0/0 md5
    # block remote access for admin user and scm
    host all cloudera-scm,scm 0.0.0.0/0 reject
    # enable remote access for other users
    host sameuser all 0.0.0.0/0 md5

    It seems fishy to me that it is only allowing local hosts, but I am very
    newbie when it comes to this.

    Any thoughts?

    Thank you again for all of your help.

    -Ryan



    On Fri, Jul 12, 2013 at 5:06 PM, Darren Lo wrote:

    I meant the Hive service command available in the CM UI, not the hive
    CLI command, sorry for the confusion. The "hive" CLI command won't do
    anything until you deploy client configs to /etc/hive/conf, which is done
    near the end of installation, so that's normal. You should just retry your
    setup though rather than trying to run in manually.

    On Fri, Jul 12, 2013 at 1:43 PM, Ryan Collins wrote:

    Thank you for your advice. I executed that command and indeed the
    manager database is running. I could not find the hive command to create a
    new database though, and it seems like it would not work anyway because
    "hive" currently does nothing when I enter it into the ssh session.

    Is there anyway to make sure that that user "hive" will be able to
    access the database? For instance, when I tried to check if the postgres
    database existed it promted me for a password and I had no idea what it was
    so I sudo-ed my way around it.

    Thanks again.

    On Fri, Jul 12, 2013 at 4:24 PM, Darren Lo wrote:

    Opening the port was a good idea. Did you retry your setup after
    opening the port?

    If you still hit trouble, ssh into your CM host and run:
    service cloudera-scm-server-db status

    If the database is running, then try running the Hive command to
    create the hive database before creating the tables.

    If you get that working, you can probably retry the setup.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 12:21 PM, Ryan Collins wrote:

    I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.









    The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
    following error:

    [2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)









    - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

    I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm









    not sure if that was a bad idea.

    Here are the logs:
    *stderr:*

    + date
    + date
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + cloudera_config=/usr/lib/cmf/service/hive
    ++ cd /usr/lib/cmf/service/hive/../common
    ++ pwd
    + cloudera_config=/usr/lib/cmf/service/common
    + . /usr/lib/cmf/service/common/cloudera-config.sh
    ++ set -x
    + locate_java_home
    + '[' -z '' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
    + export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + break
    + '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
    + source_parcel_environment
    + '[' '!' -z '' ']'
    + set_hive_classpath
    + set_classpath_in_var AUX_CLASSPATH
    + '[' -z AUX_CLASSPATH ']'
    + '[' /usr/share/cmf ']'
    ++ tr '\n' :
    ++ find /usr/share/cmf/lib/plugins -name '*.jar'
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + eval 'OLD_VALUE=$AUX_CLASSPATH'
    ++ OLD_VALUE=
    + '[' -z ']'
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + '[' 4 = 4 ']'
    + export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
    + echo 'using 4 as CDH_VERSION'
    + export HADOOP_HOME=/usr/lib/hadoop
    + HADOOP_HOME=/usr/lib/hadoop
    + export HIVE_HOME=/usr/lib/hive
    + HIVE_HOME=/usr/lib/hive
    + export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
    + export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
    + cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + echo 'using /usr/lib/hive as HIVE_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
    + echo 'using /usr/lib/hadoop as HADOOP_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
    + perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
    + JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + [[ -z 4 ]]
    + '[' 1 -ne 1 ']'
    + [[ 4 == 3 ]]
    + [[ create_metastore_tables == webhcat ]]
    + [[ create_metastore_tables == updatelocation ]]
    + [[ create_metastore_tables == create_metastore_tables ]]
    + [[ -z '' ]]
    + CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
    Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    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:191)
    ... 2 more
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
    ... 15 more
    *STD OUT:
    *
    using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
    using 4 as CDH_VERSION
    using /usr/lib/hive as HIVE_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
    using /usr/lib/hadoop as HADOOP_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
    INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
    INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
    INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
    ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
    Any help is greatly appreciated!!

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren
  • Ryan Collins at Jul 16, 2013 at 4:27 pm
    Hi Darren,

    One more: the ip listed in:

    <!--Autogenerated by Cloudera CM on 2013-07-16T15:44:38.278Z-->
    <configuration>
       <property>
         <name>javax.jdo.option.ConnectionURL</name>
         <value>jdbc:postgresql:/*/*ip-*xx-xxx-xx-x*.ec2.internal:7432/hive</value>
       </property>



    Should be the same as the ip for the cloudera manager ec2 instance right?
    Currently it is not

    Thanks,

    Ryan






    On Mon, Jul 15, 2013 at 4:23 PM, Darren Lo wrote:

    Hi Ryan,

    Your command to create the database failed because it already exists,
    right? That means that there must be a database with the name "hive".

    When I referred to the data directory, I meant the one you mentioned
    earlier, "/var/lib/cloudera-scm-server-db/data". Look in the file "
    /var/lib/cloudera-scm-server-db/data/generated_password.txt" to get the
    admin login info for your postgres, then use the "psql" command line to
    connect with that user to the database (must be ssh'd into the host where
    the cm server and db is hosted). The admin must log in using localhost.
    psql --host=localhost --port=7432 --username=cloudera-scm
    --dbname=postgres

    It will prompt you for the password, which is located in
    /var/lib/cloudera-scm-server-db/data/generated_password.txt.

    Once logged in, you should find that there is a hive user (select usename
    from pg_user;) and database (\list), since that's what the CM create
    database command said.

    Then try to log in using your hive info in hive-site.xml that you just
    sent over, remembering to replace host below with normal host name (must
    not be localhost):
    psql --host=ip-xx-xxx-xx-x.ec2.internal --port=7432 --username=hive
    --dbname=hive

    If that's not working, it is probably some kind of firewall setting. Once
    you get this command working, then the HMS should be able to create tables
    and then start up normally.

    Thanks,
    Darren

    On Mon, Jul 15, 2013 at 12:53 PM, Ryan Collins wrote:

    Hi Darren,

    Here is the database information:

    <?xml version="1.0" encoding="UTF-8"?>

    <!--Autogenerated by Cloudera CM on 2013-07-15T16:03:04.088Z-->
    <configuration>
    <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>org.postgresql.Driver</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>hive</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>AtIxEz750f</value>
    </property>
    <property>
    <name>hive.metastore.local</name>
    <value>true</value>
    </property>
    <property>
    <name>datanucleus.autoCreateSchema</name>
    <value>false</value>
    </property>
    <property>
    <name>datanucleus.metadata.validate</name>
    <value>false</value>
    </property>
    <property>
    <name>hive.metastore.warehouse.dir</name>
    <value>/user/hive/warehouse</value>
    </property>
    <property>
    <name>hive.warehouse.subdir.inherit.perms</name>
    <value>true</value>
    </property>
    <property>
    <name>mapred.reduce.tasks</name>
    <value>-1</value>
    </property>
    <property>
    <name>hive.exec.reducers.bytes.per.reducer</name>
    <value>1073741824</value>
    </property>
    <property>
    <name>hive.exec.reducers.max</name>
    <value>999</value>
    </property>
    <property>
    <name>hive.metastore.execute.setugi</name>
    <value>true</value>
    </property>
    <property>
    <name>hive.support.concurrency</name>
    <value>true</value>
    </property>
    <property>
    <name>hive.zookeeper.quorum</name>
    <value>ip-xx-xxx-xxx-xxx.ec2.internal</value>
    </property>
    <property>
    <name>hive.zookeeper.client.port</name>
    <value>2181</value>
    </property>
    <property>
    <name>hive.metastore.server.min.threads</name>
    <value>200</value>
    </property>
    <property>
    <name>hive.metastore.server.max.threads</name>
    <value>100000</value>
    </property>
    </configuration>


    When I look at the postgres database on the cloudera manager ec2
    instance, it does not recognize the user hive. There is also no database
    hive. Also, when I look in the directory where I found the authentication
    information there is no data directory. Am I looking in the right place for
    the psql info?

    Thank you again for all of your help and sorry for the newbie questions :P


    -Ryan

    On Fri, Jul 12, 2013 at 6:11 PM, Darren Lo wrote:

    Hi Ryan,

    The last line allows remote connections for users to a database named
    the same thing as the user, so db user "hive" can connect to database
    "hive" even if not on localhost.

    Can you try using psql and specifying all of the options that Hive is
    currently using, including host name, port, username, and database name?
    You can find hive's db info by clicking on the Hive service, clicking on
    the Hive Metastore, clicking on Processes, finding the process that tried
    to create the tables, clicking Show, then finding the file that has the db
    info and clicking it (I forget the name, but should be pretty clear).

    You might also want to try using postegres to manually reset hive's
    password or just delete the hive account. Maybe something messed up and CM
    re-generated the hive password, which no longer matches the db. You can
    find admin info in generated_password.txt in your /data directory where
    pg_hba.conf is located.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 2:20 PM, Ryan Collins wrote:

    I did retry the set up and each time it fails at the same step. When I
    try to create the hive database with the manager it says that the database
    already exists. Is there any chance it has to do with the psql permissions?
    I went into /var/lib/cloudera-scm-server-db/data and looked at the
    pg_hba.conf file and found this:

    # TYPE DATABASE USER CIDR-ADDRESS METHOD

    # "local" is for Unix domain socket connections only
    local all all md5
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
    # IPv6 local connections:
    host all all ::1/128 md5
    # Accept connections from all hosts
    host smon smon 0.0.0.0/0 md5
    host amon amon 0.0.0.0/0 md5
    host hmon hmon 0.0.0.0/0 md5
    host rman rman 0.0.0.0/0 md5
    host nav nav 0.0.0.0/0 md5
    # block remote access for admin user and scm
    host all cloudera-scm,scm 0.0.0.0/0 reject
    # enable remote access for other users
    host sameuser all 0.0.0.0/0 md5

    It seems fishy to me that it is only allowing local hosts, but I am
    very newbie when it comes to this.

    Any thoughts?

    Thank you again for all of your help.

    -Ryan



    On Fri, Jul 12, 2013 at 5:06 PM, Darren Lo wrote:

    I meant the Hive service command available in the CM UI, not the hive
    CLI command, sorry for the confusion. The "hive" CLI command won't do
    anything until you deploy client configs to /etc/hive/conf, which is done
    near the end of installation, so that's normal. You should just retry your
    setup though rather than trying to run in manually.

    On Fri, Jul 12, 2013 at 1:43 PM, Ryan Collins wrote:

    Thank you for your advice. I executed that command and indeed the
    manager database is running. I could not find the hive command to create a
    new database though, and it seems like it would not work anyway because
    "hive" currently does nothing when I enter it into the ssh session.

    Is there anyway to make sure that that user "hive" will be able to
    access the database? For instance, when I tried to check if the postgres
    database existed it promted me for a password and I had no idea what it was
    so I sudo-ed my way around it.

    Thanks again.

    On Fri, Jul 12, 2013 at 4:24 PM, Darren Lo wrote:

    Opening the port was a good idea. Did you retry your setup after
    opening the port?

    If you still hit trouble, ssh into your CM host and run:
    service cloudera-scm-server-db status

    If the database is running, then try running the Hive command to
    create the hive database before creating the tables.

    If you get that working, you can probably retry the setup.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 12:21 PM, Ryan Collins wrote:

    I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.











    The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
    following error:

    [2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)











    - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

    I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm











    not sure if that was a bad idea.

    Here are the logs:
    *stderr:*

    + date
    + date
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + cloudera_config=/usr/lib/cmf/service/hive
    ++ cd /usr/lib/cmf/service/hive/../common
    ++ pwd
    + cloudera_config=/usr/lib/cmf/service/common
    + . /usr/lib/cmf/service/common/cloudera-config.sh
    ++ set -x
    + locate_java_home
    + '[' -z '' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
    + export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + break
    + '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
    + source_parcel_environment
    + '[' '!' -z '' ']'
    + set_hive_classpath
    + set_classpath_in_var AUX_CLASSPATH
    + '[' -z AUX_CLASSPATH ']'
    + '[' /usr/share/cmf ']'
    ++ tr '\n' :
    ++ find /usr/share/cmf/lib/plugins -name '*.jar'
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + eval 'OLD_VALUE=$AUX_CLASSPATH'
    ++ OLD_VALUE=
    + '[' -z ']'
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + '[' 4 = 4 ']'
    + export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
    + echo 'using 4 as CDH_VERSION'
    + export HADOOP_HOME=/usr/lib/hadoop
    + HADOOP_HOME=/usr/lib/hadoop
    + export HIVE_HOME=/usr/lib/hive
    + HIVE_HOME=/usr/lib/hive
    + export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
    + export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
    + cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + echo 'using /usr/lib/hive as HIVE_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
    + echo 'using /usr/lib/hadoop as HADOOP_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
    + perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
    + JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + [[ -z 4 ]]
    + '[' 1 -ne 1 ']'
    + [[ 4 == 3 ]]
    + [[ create_metastore_tables == webhcat ]]
    + [[ create_metastore_tables == updatelocation ]]
    + [[ create_metastore_tables == create_metastore_tables ]]
    + [[ -z '' ]]
    + CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
    Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    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:191)
    ... 2 more
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
    ... 15 more
    *STD OUT:
    *
    using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
    using 4 as CDH_VERSION
    using /usr/lib/hive as HIVE_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
    using /usr/lib/hadoop as HADOOP_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
    INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
    INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
    INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
    ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
    Any help is greatly appreciated!!

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren
  • Darren Lo at Jul 16, 2013 at 5:28 pm
    Hi Ryan,

    Yes, that's correct. It needs to be the IP where the postgres is located,
    which is the same host as the cloudera manager server. If it's not, then I
    expect the psql command line will fail as well.

    Thanks,
    Darren

    On Tue, Jul 16, 2013 at 9:26 AM, Ryan Collins wrote:

    Hi Darren,

    One more: the ip listed in:

    <!--Autogenerated by Cloudera CM on 2013-07-16T15:44:38.278Z-->
    <configuration>
    <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:postgresql:/*/*ip-*xx-xxx-xx-x*.ec2.internal:7432/hive</value>
    </property>



    Should be the same as the ip for the cloudera manager ec2 instance right?
    Currently it is not

    Thanks,

    Ryan







    On Mon, Jul 15, 2013 at 4:23 PM, Darren Lo wrote:

    Hi Ryan,

    Your command to create the database failed because it already exists,
    right? That means that there must be a database with the name "hive".

    When I referred to the data directory, I meant the one you mentioned
    earlier, "/var/lib/cloudera-scm-server-db/data". Look in the file "
    /var/lib/cloudera-scm-server-db/data/generated_password.txt" to get the
    admin login info for your postgres, then use the "psql" command line to
    connect with that user to the database (must be ssh'd into the host where
    the cm server and db is hosted). The admin must log in using localhost.
    psql --host=localhost --port=7432 --username=cloudera-scm
    --dbname=postgres

    It will prompt you for the password, which is located in
    /var/lib/cloudera-scm-server-db/data/generated_password.txt.

    Once logged in, you should find that there is a hive user (select
    usename from pg_user;) and database (\list), since that's what the CM
    create database command said.

    Then try to log in using your hive info in hive-site.xml that you just
    sent over, remembering to replace host below with normal host name (must
    not be localhost):
    psql --host=ip-xx-xxx-xx-x.ec2.internal --port=7432 --username=hive
    --dbname=hive

    If that's not working, it is probably some kind of firewall setting. Once
    you get this command working, then the HMS should be able to create tables
    and then start up normally.

    Thanks,
    Darren

    On Mon, Jul 15, 2013 at 12:53 PM, Ryan Collins wrote:

    Hi Darren,

    Here is the database information:

    <?xml version="1.0" encoding="UTF-8"?>

    <!--Autogenerated by Cloudera CM on 2013-07-15T16:03:04.088Z-->
    <configuration>
    <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>org.postgresql.Driver</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>hive</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>AtIxEz750f</value>
    </property>
    <property>
    <name>hive.metastore.local</name>
    <value>true</value>
    </property>
    <property>
    <name>datanucleus.autoCreateSchema</name>
    <value>false</value>
    </property>
    <property>
    <name>datanucleus.metadata.validate</name>
    <value>false</value>
    </property>
    <property>
    <name>hive.metastore.warehouse.dir</name>
    <value>/user/hive/warehouse</value>
    </property>
    <property>
    <name>hive.warehouse.subdir.inherit.perms</name>
    <value>true</value>
    </property>
    <property>
    <name>mapred.reduce.tasks</name>
    <value>-1</value>
    </property>
    <property>
    <name>hive.exec.reducers.bytes.per.reducer</name>
    <value>1073741824</value>
    </property>
    <property>
    <name>hive.exec.reducers.max</name>
    <value>999</value>
    </property>
    <property>
    <name>hive.metastore.execute.setugi</name>
    <value>true</value>
    </property>
    <property>
    <name>hive.support.concurrency</name>
    <value>true</value>
    </property>
    <property>
    <name>hive.zookeeper.quorum</name>
    <value>ip-xx-xxx-xxx-xxx.ec2.internal</value>
    </property>
    <property>
    <name>hive.zookeeper.client.port</name>
    <value>2181</value>
    </property>
    <property>
    <name>hive.metastore.server.min.threads</name>
    <value>200</value>
    </property>
    <property>
    <name>hive.metastore.server.max.threads</name>
    <value>100000</value>
    </property>
    </configuration>


    When I look at the postgres database on the cloudera manager ec2
    instance, it does not recognize the user hive. There is also no database
    hive. Also, when I look in the directory where I found the authentication
    information there is no data directory. Am I looking in the right place for
    the psql info?

    Thank you again for all of your help and sorry for the newbie questions
    :P


    -Ryan

    On Fri, Jul 12, 2013 at 6:11 PM, Darren Lo wrote:

    Hi Ryan,

    The last line allows remote connections for users to a database named
    the same thing as the user, so db user "hive" can connect to database
    "hive" even if not on localhost.

    Can you try using psql and specifying all of the options that Hive is
    currently using, including host name, port, username, and database name?
    You can find hive's db info by clicking on the Hive service, clicking on
    the Hive Metastore, clicking on Processes, finding the process that tried
    to create the tables, clicking Show, then finding the file that has the db
    info and clicking it (I forget the name, but should be pretty clear).

    You might also want to try using postegres to manually reset hive's
    password or just delete the hive account. Maybe something messed up and CM
    re-generated the hive password, which no longer matches the db. You can
    find admin info in generated_password.txt in your /data directory where
    pg_hba.conf is located.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 2:20 PM, Ryan Collins wrote:

    I did retry the set up and each time it fails at the same step. When I
    try to create the hive database with the manager it says that the database
    already exists. Is there any chance it has to do with the psql permissions?
    I went into /var/lib/cloudera-scm-server-db/data and looked at the
    pg_hba.conf file and found this:

    # TYPE DATABASE USER CIDR-ADDRESS METHOD

    # "local" is for Unix domain socket connections only
    local all all md5
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
    # IPv6 local connections:
    host all all ::1/128 md5
    # Accept connections from all hosts
    host smon smon 0.0.0.0/0 md5
    host amon amon 0.0.0.0/0 md5
    host hmon hmon 0.0.0.0/0 md5
    host rman rman 0.0.0.0/0 md5
    host nav nav 0.0.0.0/0 md5
    # block remote access for admin user and scm
    host all cloudera-scm,scm 0.0.0.0/0 reject
    # enable remote access for other users
    host sameuser all 0.0.0.0/0 md5

    It seems fishy to me that it is only allowing local hosts, but I am
    very newbie when it comes to this.

    Any thoughts?

    Thank you again for all of your help.

    -Ryan



    On Fri, Jul 12, 2013 at 5:06 PM, Darren Lo wrote:

    I meant the Hive service command available in the CM UI, not the hive
    CLI command, sorry for the confusion. The "hive" CLI command won't do
    anything until you deploy client configs to /etc/hive/conf, which is done
    near the end of installation, so that's normal. You should just retry your
    setup though rather than trying to run in manually.

    On Fri, Jul 12, 2013 at 1:43 PM, Ryan Collins wrote:

    Thank you for your advice. I executed that command and indeed the
    manager database is running. I could not find the hive command to create a
    new database though, and it seems like it would not work anyway because
    "hive" currently does nothing when I enter it into the ssh session.

    Is there anyway to make sure that that user "hive" will be able to
    access the database? For instance, when I tried to check if the postgres
    database existed it promted me for a password and I had no idea what it was
    so I sudo-ed my way around it.

    Thanks again.

    On Fri, Jul 12, 2013 at 4:24 PM, Darren Lo wrote:

    Opening the port was a good idea. Did you retry your setup after
    opening the port?

    If you still hit trouble, ssh into your CM host and run:
    service cloudera-scm-server-db status

    If the database is running, then try running the Hive command to
    create the hive database before creating the tables.

    If you get that working, you can probably retry the setup.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 12:21 PM, Ryan Collins wrote:

    I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.












    The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
    following error:

    [2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)












    - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

    I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm












    not sure if that was a bad idea.

    Here are the logs:
    *stderr:*

    + date
    + date
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + cloudera_config=/usr/lib/cmf/service/hive
    ++ cd /usr/lib/cmf/service/hive/../common
    ++ pwd
    + cloudera_config=/usr/lib/cmf/service/common
    + . /usr/lib/cmf/service/common/cloudera-config.sh
    ++ set -x
    + locate_java_home
    + '[' -z '' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
    + export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + break
    + '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
    + source_parcel_environment
    + '[' '!' -z '' ']'
    + set_hive_classpath
    + set_classpath_in_var AUX_CLASSPATH
    + '[' -z AUX_CLASSPATH ']'
    + '[' /usr/share/cmf ']'
    ++ tr '\n' :
    ++ find /usr/share/cmf/lib/plugins -name '*.jar'
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + eval 'OLD_VALUE=$AUX_CLASSPATH'
    ++ OLD_VALUE=
    + '[' -z ']'
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + '[' 4 = 4 ']'
    + export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
    + echo 'using 4 as CDH_VERSION'
    + export HADOOP_HOME=/usr/lib/hadoop
    + HADOOP_HOME=/usr/lib/hadoop
    + export HIVE_HOME=/usr/lib/hive
    + HIVE_HOME=/usr/lib/hive
    + export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
    + export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
    + cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + echo 'using /usr/lib/hive as HIVE_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
    + echo 'using /usr/lib/hadoop as HADOOP_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
    + perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
    + JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + [[ -z 4 ]]
    + '[' 1 -ne 1 ']'
    + [[ 4 == 3 ]]
    + [[ create_metastore_tables == webhcat ]]
    + [[ create_metastore_tables == updatelocation ]]
    + [[ create_metastore_tables == create_metastore_tables ]]
    + [[ -z '' ]]
    + CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
    Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    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:191)
    ... 2 more
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
    ... 15 more
    *STD OUT:
    *
    using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
    using 4 as CDH_VERSION
    using /usr/lib/hive as HIVE_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
    using /usr/lib/hadoop as HADOOP_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
    INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
    INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
    INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
    ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
    Any help is greatly appreciated!!

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren
  • Ryan Collins at Jul 16, 2013 at 5:34 pm
    Hi Darren,

    That is indeed what happened and I think that the issue is that this is the
    second time I have installed the manger on this server. I think the correct
    approach to resolve the issue would be to edit the:

    Hive Service Configuration Safety Valve for hive-site.xml

    and/or

    Hive Client Configuration Safety Valve for hive-site.xml

    On Tue, Jul 16, 2013 at 1:28 PM, Darren Lo wrote:

    Hi Ryan,

    Yes, that's correct. It needs to be the IP where the postgres is located,
    which is the same host as the cloudera manager server. If it's not, then I
    expect the psql command line will fail as well.

    Thanks,
    Darren

    On Tue, Jul 16, 2013 at 9:26 AM, Ryan Collins wrote:

    Hi Darren,

    One more: the ip listed in:

    <!--Autogenerated by Cloudera CM on 2013-07-16T15:44:38.278Z-->
    <configuration>
    <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:postgresql:/*/*ip-*xx-xxx-xx-x*.ec2.internal:7432/hive</value>
    </property>



    Should be the same as the ip for the cloudera manager ec2 instance right?
    Currently it is not

    Thanks,

    Ryan









    On Mon, Jul 15, 2013 at 4:23 PM, Darren Lo wrote:

    Hi Ryan,

    Your command to create the database failed because it already exists,
    right? That means that there must be a database with the name "hive".

    When I referred to the data directory, I meant the one you mentioned
    earlier, "/var/lib/cloudera-scm-server-db/data". Look in the file "
    /var/lib/cloudera-scm-server-db/data/generated_password.txt" to get the
    admin login info for your postgres, then use the "psql" command line to
    connect with that user to the database (must be ssh'd into the host where
    the cm server and db is hosted). The admin must log in using localhost.
    psql --host=localhost --port=7432 --username=cloudera-scm
    --dbname=postgres

    It will prompt you for the password, which is located in
    /var/lib/cloudera-scm-server-db/data/generated_password.txt.

    Once logged in, you should find that there is a hive user (select
    usename from pg_user;) and database (\list), since that's what the CM
    create database command said.

    Then try to log in using your hive info in hive-site.xml that you just
    sent over, remembering to replace host below with normal host name (must
    not be localhost):
    psql --host=ip-xx-xxx-xx-x.ec2.internal --port=7432 --username=hive
    --dbname=hive

    If that's not working, it is probably some kind of firewall setting.
    Once you get this command working, then the HMS should be able to create
    tables and then start up normally.

    Thanks,
    Darren

    On Mon, Jul 15, 2013 at 12:53 PM, Ryan Collins wrote:

    Hi Darren,

    Here is the database information:

    <?xml version="1.0" encoding="UTF-8"?>

    <!--Autogenerated by Cloudera CM on 2013-07-15T16:03:04.088Z-->
    <configuration>
    <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>org.postgresql.Driver</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>hive</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>AtIxEz750f</value>
    </property>
    <property>
    <name>hive.metastore.local</name>
    <value>true</value>
    </property>
    <property>
    <name>datanucleus.autoCreateSchema</name>
    <value>false</value>
    </property>
    <property>
    <name>datanucleus.metadata.validate</name>
    <value>false</value>
    </property>
    <property>
    <name>hive.metastore.warehouse.dir</name>
    <value>/user/hive/warehouse</value>
    </property>
    <property>
    <name>hive.warehouse.subdir.inherit.perms</name>
    <value>true</value>
    </property>
    <property>
    <name>mapred.reduce.tasks</name>
    <value>-1</value>
    </property>
    <property>
    <name>hive.exec.reducers.bytes.per.reducer</name>
    <value>1073741824</value>
    </property>
    <property>
    <name>hive.exec.reducers.max</name>
    <value>999</value>
    </property>
    <property>
    <name>hive.metastore.execute.setugi</name>
    <value>true</value>
    </property>
    <property>
    <name>hive.support.concurrency</name>
    <value>true</value>
    </property>
    <property>
    <name>hive.zookeeper.quorum</name>
    <value>ip-xx-xxx-xxx-xxx.ec2.internal</value>
    </property>
    <property>
    <name>hive.zookeeper.client.port</name>
    <value>2181</value>
    </property>
    <property>
    <name>hive.metastore.server.min.threads</name>
    <value>200</value>
    </property>
    <property>
    <name>hive.metastore.server.max.threads</name>
    <value>100000</value>
    </property>
    </configuration>


    When I look at the postgres database on the cloudera manager ec2
    instance, it does not recognize the user hive. There is also no database
    hive. Also, when I look in the directory where I found the authentication
    information there is no data directory. Am I looking in the right place for
    the psql info?

    Thank you again for all of your help and sorry for the newbie questions
    :P


    -Ryan

    On Fri, Jul 12, 2013 at 6:11 PM, Darren Lo wrote:

    Hi Ryan,

    The last line allows remote connections for users to a database named
    the same thing as the user, so db user "hive" can connect to database
    "hive" even if not on localhost.

    Can you try using psql and specifying all of the options that Hive is
    currently using, including host name, port, username, and database name?
    You can find hive's db info by clicking on the Hive service, clicking on
    the Hive Metastore, clicking on Processes, finding the process that tried
    to create the tables, clicking Show, then finding the file that has the db
    info and clicking it (I forget the name, but should be pretty clear).

    You might also want to try using postegres to manually reset hive's
    password or just delete the hive account. Maybe something messed up and CM
    re-generated the hive password, which no longer matches the db. You can
    find admin info in generated_password.txt in your /data directory where
    pg_hba.conf is located.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 2:20 PM, Ryan Collins wrote:

    I did retry the set up and each time it fails at the same step. When
    I try to create the hive database with the manager it says that the
    database already exists. Is there any chance it has to do with the psql
    permissions? I went into /var/lib/cloudera-scm-server-db/data and looked at
    the pg_hba.conf file and found this:

    # TYPE DATABASE USER CIDR-ADDRESS METHOD

    # "local" is for Unix domain socket connections only
    local all all md5
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
    # IPv6 local connections:
    host all all ::1/128 md5
    # Accept connections from all hosts
    host smon smon 0.0.0.0/0 md5
    host amon amon 0.0.0.0/0 md5
    host hmon hmon 0.0.0.0/0 md5
    host rman rman 0.0.0.0/0 md5
    host nav nav 0.0.0.0/0 md5
    # block remote access for admin user and scm
    host all cloudera-scm,scm 0.0.0.0/0 reject
    # enable remote access for other users
    host sameuser all 0.0.0.0/0 md5

    It seems fishy to me that it is only allowing local hosts, but I am
    very newbie when it comes to this.

    Any thoughts?

    Thank you again for all of your help.

    -Ryan



    On Fri, Jul 12, 2013 at 5:06 PM, Darren Lo wrote:

    I meant the Hive service command available in the CM UI, not the
    hive CLI command, sorry for the confusion. The "hive" CLI command won't do
    anything until you deploy client configs to /etc/hive/conf, which is done
    near the end of installation, so that's normal. You should just retry your
    setup though rather than trying to run in manually.

    On Fri, Jul 12, 2013 at 1:43 PM, Ryan Collins wrote:

    Thank you for your advice. I executed that command and indeed the
    manager database is running. I could not find the hive command to create a
    new database though, and it seems like it would not work anyway because
    "hive" currently does nothing when I enter it into the ssh session.

    Is there anyway to make sure that that user "hive" will be able to
    access the database? For instance, when I tried to check if the postgres
    database existed it promted me for a password and I had no idea what it was
    so I sudo-ed my way around it.

    Thanks again.

    On Fri, Jul 12, 2013 at 4:24 PM, Darren Lo wrote:

    Opening the port was a good idea. Did you retry your setup after
    opening the port?

    If you still hit trouble, ssh into your CM host and run:
    service cloudera-scm-server-db status

    If the database is running, then try running the Hive command to
    create the hive database before creating the tables.

    If you get that working, you can probably retry the setup.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 12:21 PM, Ryan Collins wrote:

    I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.














    The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
    following error:

    [2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)














    - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

    I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm














    not sure if that was a bad idea.

    Here are the logs:
    *stderr:*

    + date
    + date
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + cloudera_config=/usr/lib/cmf/service/hive
    ++ cd /usr/lib/cmf/service/hive/../common
    ++ pwd
    + cloudera_config=/usr/lib/cmf/service/common
    + . /usr/lib/cmf/service/common/cloudera-config.sh
    ++ set -x
    + locate_java_home
    + '[' -z '' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
    + export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + break
    + '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
    + source_parcel_environment
    + '[' '!' -z '' ']'
    + set_hive_classpath
    + set_classpath_in_var AUX_CLASSPATH
    + '[' -z AUX_CLASSPATH ']'
    + '[' /usr/share/cmf ']'
    ++ tr '\n' :
    ++ find /usr/share/cmf/lib/plugins -name '*.jar'
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + eval 'OLD_VALUE=$AUX_CLASSPATH'
    ++ OLD_VALUE=
    + '[' -z ']'
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + '[' 4 = 4 ']'
    + export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
    + echo 'using 4 as CDH_VERSION'
    + export HADOOP_HOME=/usr/lib/hadoop
    + HADOOP_HOME=/usr/lib/hadoop
    + export HIVE_HOME=/usr/lib/hive
    + HIVE_HOME=/usr/lib/hive
    + export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
    + export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
    + cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + echo 'using /usr/lib/hive as HIVE_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
    + echo 'using /usr/lib/hadoop as HADOOP_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
    + perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
    + JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + [[ -z 4 ]]
    + '[' 1 -ne 1 ']'
    + [[ 4 == 3 ]]
    + [[ create_metastore_tables == webhcat ]]
    + [[ create_metastore_tables == updatelocation ]]
    + [[ create_metastore_tables == create_metastore_tables ]]
    + [[ -z '' ]]
    + CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
    Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    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:191)
    ... 2 more
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
    ... 15 more
    *STD OUT:
    *
    using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
    using 4 as CDH_VERSION
    using /usr/lib/hive as HIVE_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
    using /usr/lib/hadoop as HADOOP_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
    INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
    INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
    INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
    ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
    Any help is greatly appreciated!!

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren
  • Darren Lo at Jul 16, 2013 at 5:51 pm
    Hi Ryan,

    You should edit the Hive Metastore Database Host rather than the safety
    valve. This configuration is under Service-Wide, in the sub-group Hive
    Metastore Database. You can also find it by searching for "database" in the
    search bar in the upper left.

    Note that the Service safety valve is for all Hive processes managed by CM
    (Hive Metastore Server, HiveServer2), while the Client safety valve is for
    clients that talk to Hive.

    Thanks,
    Darren

    On Tue, Jul 16, 2013 at 10:33 AM, Ryan Collins wrote:

    Hi Darren,

    That is indeed what happened and I think that the issue is that this is
    the second time I have installed the manger on this server. I think the
    correct approach to resolve the issue would be to edit the:

    Hive Service Configuration Safety Valve for hive-site.xml

    and/or

    Hive Client Configuration Safety Valve for hive-site.xml

    On Tue, Jul 16, 2013 at 1:28 PM, Darren Lo wrote:

    Hi Ryan,

    Yes, that's correct. It needs to be the IP where the postgres is located,
    which is the same host as the cloudera manager server. If it's not, then I
    expect the psql command line will fail as well.

    Thanks,
    Darren

    On Tue, Jul 16, 2013 at 9:26 AM, Ryan Collins wrote:

    Hi Darren,

    One more: the ip listed in:

    <!--Autogenerated by Cloudera CM on 2013-07-16T15:44:38.278Z-->
    <configuration>
    <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:postgresql:/*/*ip-*xx-xxx-xx-x*.ec2.internal:7432/hive</value>
    </property>



    Should be the same as the ip for the cloudera manager ec2 instance
    right? Currently it is not

    Thanks,

    Ryan










    On Mon, Jul 15, 2013 at 4:23 PM, Darren Lo wrote:

    Hi Ryan,

    Your command to create the database failed because it already exists,
    right? That means that there must be a database with the name "hive".

    When I referred to the data directory, I meant the one you mentioned
    earlier, "/var/lib/cloudera-scm-server-db/data". Look in the file "
    /var/lib/cloudera-scm-server-db/data/generated_password.txt" to get
    the admin login info for your postgres, then use the "psql" command line to
    connect with that user to the database (must be ssh'd into the host where
    the cm server and db is hosted). The admin must log in using localhost.
    psql --host=localhost --port=7432 --username=cloudera-scm
    --dbname=postgres

    It will prompt you for the password, which is located in
    /var/lib/cloudera-scm-server-db/data/generated_password.txt.

    Once logged in, you should find that there is a hive user (select
    usename from pg_user;) and database (\list), since that's what the CM
    create database command said.

    Then try to log in using your hive info in hive-site.xml that you just
    sent over, remembering to replace host below with normal host name (must
    not be localhost):
    psql --host=ip-xx-xxx-xx-x.ec2.internal --port=7432 --username=hive
    --dbname=hive

    If that's not working, it is probably some kind of firewall setting.
    Once you get this command working, then the HMS should be able to create
    tables and then start up normally.

    Thanks,
    Darren

    On Mon, Jul 15, 2013 at 12:53 PM, Ryan Collins wrote:

    Hi Darren,

    Here is the database information:

    <?xml version="1.0" encoding="UTF-8"?>

    <!--Autogenerated by Cloudera CM on 2013-07-15T16:03:04.088Z-->
    <configuration>
    <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>org.postgresql.Driver</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>hive</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>AtIxEz750f</value>
    </property>
    <property>
    <name>hive.metastore.local</name>
    <value>true</value>
    </property>
    <property>
    <name>datanucleus.autoCreateSchema</name>
    <value>false</value>
    </property>
    <property>
    <name>datanucleus.metadata.validate</name>
    <value>false</value>
    </property>
    <property>
    <name>hive.metastore.warehouse.dir</name>
    <value>/user/hive/warehouse</value>
    </property>
    <property>
    <name>hive.warehouse.subdir.inherit.perms</name>
    <value>true</value>
    </property>
    <property>
    <name>mapred.reduce.tasks</name>
    <value>-1</value>
    </property>
    <property>
    <name>hive.exec.reducers.bytes.per.reducer</name>
    <value>1073741824</value>
    </property>
    <property>
    <name>hive.exec.reducers.max</name>
    <value>999</value>
    </property>
    <property>
    <name>hive.metastore.execute.setugi</name>
    <value>true</value>
    </property>
    <property>
    <name>hive.support.concurrency</name>
    <value>true</value>
    </property>
    <property>
    <name>hive.zookeeper.quorum</name>
    <value>ip-xx-xxx-xxx-xxx.ec2.internal</value>
    </property>
    <property>
    <name>hive.zookeeper.client.port</name>
    <value>2181</value>
    </property>
    <property>
    <name>hive.metastore.server.min.threads</name>
    <value>200</value>
    </property>
    <property>
    <name>hive.metastore.server.max.threads</name>
    <value>100000</value>
    </property>
    </configuration>


    When I look at the postgres database on the cloudera manager ec2
    instance, it does not recognize the user hive. There is also no database
    hive. Also, when I look in the directory where I found the authentication
    information there is no data directory. Am I looking in the right place for
    the psql info?

    Thank you again for all of your help and sorry for the newbie
    questions :P


    -Ryan

    On Fri, Jul 12, 2013 at 6:11 PM, Darren Lo wrote:

    Hi Ryan,

    The last line allows remote connections for users to a database named
    the same thing as the user, so db user "hive" can connect to database
    "hive" even if not on localhost.

    Can you try using psql and specifying all of the options that Hive is
    currently using, including host name, port, username, and database name?
    You can find hive's db info by clicking on the Hive service, clicking on
    the Hive Metastore, clicking on Processes, finding the process that tried
    to create the tables, clicking Show, then finding the file that has the db
    info and clicking it (I forget the name, but should be pretty clear).

    You might also want to try using postegres to manually reset hive's
    password or just delete the hive account. Maybe something messed up and CM
    re-generated the hive password, which no longer matches the db. You can
    find admin info in generated_password.txt in your /data directory where
    pg_hba.conf is located.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 2:20 PM, Ryan Collins wrote:

    I did retry the set up and each time it fails at the same step. When
    I try to create the hive database with the manager it says that the
    database already exists. Is there any chance it has to do with the psql
    permissions? I went into /var/lib/cloudera-scm-server-db/data and looked at
    the pg_hba.conf file and found this:

    # TYPE DATABASE USER CIDR-ADDRESS METHOD

    # "local" is for Unix domain socket connections only
    local all all md5
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
    # IPv6 local connections:
    host all all ::1/128 md5
    # Accept connections from all hosts
    host smon smon 0.0.0.0/0 md5
    host amon amon 0.0.0.0/0 md5
    host hmon hmon 0.0.0.0/0 md5
    host rman rman 0.0.0.0/0 md5
    host nav nav 0.0.0.0/0 md5
    # block remote access for admin user and scm
    host all cloudera-scm,scm 0.0.0.0/0 reject
    # enable remote access for other users
    host sameuser all 0.0.0.0/0 md5

    It seems fishy to me that it is only allowing local hosts, but I am
    very newbie when it comes to this.

    Any thoughts?

    Thank you again for all of your help.

    -Ryan



    On Fri, Jul 12, 2013 at 5:06 PM, Darren Lo wrote:

    I meant the Hive service command available in the CM UI, not the
    hive CLI command, sorry for the confusion. The "hive" CLI command won't do
    anything until you deploy client configs to /etc/hive/conf, which is done
    near the end of installation, so that's normal. You should just retry your
    setup though rather than trying to run in manually.

    On Fri, Jul 12, 2013 at 1:43 PM, Ryan Collins wrote:

    Thank you for your advice. I executed that command and indeed the
    manager database is running. I could not find the hive command to create a
    new database though, and it seems like it would not work anyway because
    "hive" currently does nothing when I enter it into the ssh session.

    Is there anyway to make sure that that user "hive" will be able to
    access the database? For instance, when I tried to check if the postgres
    database existed it promted me for a password and I had no idea what it was
    so I sudo-ed my way around it.

    Thanks again.

    On Fri, Jul 12, 2013 at 4:24 PM, Darren Lo wrote:

    Opening the port was a good idea. Did you retry your setup after
    opening the port?

    If you still hit trouble, ssh into your CM host and run:
    service cloudera-scm-server-db status

    If the database is running, then try running the Hive command to
    create the hive database before creating the tables.

    If you get that working, you can probably retry the setup.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 12:21 PM, Ryan Collins wrote:

    I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.















    The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
    following error:

    [2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)















    - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

    I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm















    not sure if that was a bad idea.

    Here are the logs:
    *stderr:*

    + date
    + date
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + cloudera_config=/usr/lib/cmf/service/hive
    ++ cd /usr/lib/cmf/service/hive/../common
    ++ pwd
    + cloudera_config=/usr/lib/cmf/service/common
    + . /usr/lib/cmf/service/common/cloudera-config.sh
    ++ set -x
    + locate_java_home
    + '[' -z '' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
    + export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + break
    + '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
    + source_parcel_environment
    + '[' '!' -z '' ']'
    + set_hive_classpath
    + set_classpath_in_var AUX_CLASSPATH
    + '[' -z AUX_CLASSPATH ']'
    + '[' /usr/share/cmf ']'
    ++ tr '\n' :
    ++ find /usr/share/cmf/lib/plugins -name '*.jar'
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + eval 'OLD_VALUE=$AUX_CLASSPATH'
    ++ OLD_VALUE=
    + '[' -z ']'
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + '[' 4 = 4 ']'
    + export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
    + echo 'using 4 as CDH_VERSION'
    + export HADOOP_HOME=/usr/lib/hadoop
    + HADOOP_HOME=/usr/lib/hadoop
    + export HIVE_HOME=/usr/lib/hive
    + HIVE_HOME=/usr/lib/hive
    + export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
    + export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
    + cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + echo 'using /usr/lib/hive as HIVE_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
    + echo 'using /usr/lib/hadoop as HADOOP_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
    + perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
    + JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + [[ -z 4 ]]
    + '[' 1 -ne 1 ']'
    + [[ 4 == 3 ]]
    + [[ create_metastore_tables == webhcat ]]
    + [[ create_metastore_tables == updatelocation ]]
    + [[ create_metastore_tables == create_metastore_tables ]]
    + [[ -z '' ]]
    + CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
    Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    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:191)
    ... 2 more
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
    ... 15 more
    *STD OUT:
    *
    using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
    using 4 as CDH_VERSION
    using /usr/lib/hive as HIVE_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
    using /usr/lib/hadoop as HADOOP_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
    INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
    INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
    INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
    ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
    Any help is greatly appreciated!!

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren
  • Ryan Collins at Jul 16, 2013 at 7:44 pm
    Thank you for all of your help Darren. I ended up deleting the current hive
    service and then manually creating database for it which ended up working.
    The odd thing about the creating the hive database was that I was trying to
    use an embedded database originally, which was being created successfully
    on the CM server, but then when the tables were being created it tried to
    create them on an instance that no longer existed from a previous
    installation of CM. In any case I got things up and running.

    Thank you so much again for taking the time help out a beginner.

    -Ryan

    On Tue, Jul 16, 2013 at 1:51 PM, Darren Lo wrote:

    Hi Ryan,

    You should edit the Hive Metastore Database Host rather than the safety
    valve. This configuration is under Service-Wide, in the sub-group Hive
    Metastore Database. You can also find it by searching for "database" in the
    search bar in the upper left.

    Note that the Service safety valve is for all Hive processes managed by CM
    (Hive Metastore Server, HiveServer2), while the Client safety valve is for
    clients that talk to Hive.

    Thanks,
    Darren

    On Tue, Jul 16, 2013 at 10:33 AM, Ryan Collins wrote:

    Hi Darren,

    That is indeed what happened and I think that the issue is that this is
    the second time I have installed the manger on this server. I think the
    correct approach to resolve the issue would be to edit the:

    Hive Service Configuration Safety Valve for hive-site.xml

    and/or

    Hive Client Configuration Safety Valve for hive-site.xml

    On Tue, Jul 16, 2013 at 1:28 PM, Darren Lo wrote:

    Hi Ryan,

    Yes, that's correct. It needs to be the IP where the postgres is
    located, which is the same host as the cloudera manager server. If it's
    not, then I expect the psql command line will fail as well.

    Thanks,
    Darren

    On Tue, Jul 16, 2013 at 9:26 AM, Ryan Collins wrote:

    Hi Darren,

    One more: the ip listed in:

    <!--Autogenerated by Cloudera CM on 2013-07-16T15:44:38.278Z-->
    <configuration>
    <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:postgresql:/*/*ip-*xx-xxx-xx-x*.ec2.internal:7432/hive</value>
    </property>



    Should be the same as the ip for the cloudera manager ec2 instance
    right? Currently it is not

    Thanks,

    Ryan












    On Mon, Jul 15, 2013 at 4:23 PM, Darren Lo wrote:

    Hi Ryan,

    Your command to create the database failed because it already exists,
    right? That means that there must be a database with the name "hive".

    When I referred to the data directory, I meant the one you mentioned
    earlier, "/var/lib/cloudera-scm-server-db/data". Look in the file "
    /var/lib/cloudera-scm-server-db/data/generated_password.txt" to get
    the admin login info for your postgres, then use the "psql" command line to
    connect with that user to the database (must be ssh'd into the host where
    the cm server and db is hosted). The admin must log in using localhost.
    psql --host=localhost --port=7432 --username=cloudera-scm
    --dbname=postgres

    It will prompt you for the password, which is located in
    /var/lib/cloudera-scm-server-db/data/generated_password.txt.

    Once logged in, you should find that there is a hive user (select
    usename from pg_user;) and database (\list), since that's what the CM
    create database command said.

    Then try to log in using your hive info in hive-site.xml that you just
    sent over, remembering to replace host below with normal host name (must
    not be localhost):
    psql --host=ip-xx-xxx-xx-x.ec2.internal --port=7432 --username=hive
    --dbname=hive

    If that's not working, it is probably some kind of firewall setting.
    Once you get this command working, then the HMS should be able to create
    tables and then start up normally.

    Thanks,
    Darren

    On Mon, Jul 15, 2013 at 12:53 PM, Ryan Collins wrote:

    Hi Darren,

    Here is the database information:

    <?xml version="1.0" encoding="UTF-8"?>

    <!--Autogenerated by Cloudera CM on 2013-07-15T16:03:04.088Z-->
    <configuration>
    <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>org.postgresql.Driver</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>hive</value>
    </property>
    <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>AtIxEz750f</value>
    </property>
    <property>
    <name>hive.metastore.local</name>
    <value>true</value>
    </property>
    <property>
    <name>datanucleus.autoCreateSchema</name>
    <value>false</value>
    </property>
    <property>
    <name>datanucleus.metadata.validate</name>
    <value>false</value>
    </property>
    <property>
    <name>hive.metastore.warehouse.dir</name>
    <value>/user/hive/warehouse</value>
    </property>
    <property>
    <name>hive.warehouse.subdir.inherit.perms</name>
    <value>true</value>
    </property>
    <property>
    <name>mapred.reduce.tasks</name>
    <value>-1</value>
    </property>
    <property>
    <name>hive.exec.reducers.bytes.per.reducer</name>
    <value>1073741824</value>
    </property>
    <property>
    <name>hive.exec.reducers.max</name>
    <value>999</value>
    </property>
    <property>
    <name>hive.metastore.execute.setugi</name>
    <value>true</value>
    </property>
    <property>
    <name>hive.support.concurrency</name>
    <value>true</value>
    </property>
    <property>
    <name>hive.zookeeper.quorum</name>
    <value>ip-xx-xxx-xxx-xxx.ec2.internal</value>
    </property>
    <property>
    <name>hive.zookeeper.client.port</name>
    <value>2181</value>
    </property>
    <property>
    <name>hive.metastore.server.min.threads</name>
    <value>200</value>
    </property>
    <property>
    <name>hive.metastore.server.max.threads</name>
    <value>100000</value>
    </property>
    </configuration>


    When I look at the postgres database on the cloudera manager ec2
    instance, it does not recognize the user hive. There is also no database
    hive. Also, when I look in the directory where I found the authentication
    information there is no data directory. Am I looking in the right place for
    the psql info?

    Thank you again for all of your help and sorry for the newbie
    questions :P


    -Ryan

    On Fri, Jul 12, 2013 at 6:11 PM, Darren Lo wrote:

    Hi Ryan,

    The last line allows remote connections for users to a database
    named the same thing as the user, so db user "hive" can connect to database
    "hive" even if not on localhost.

    Can you try using psql and specifying all of the options that Hive
    is currently using, including host name, port, username, and database name?
    You can find hive's db info by clicking on the Hive service, clicking on
    the Hive Metastore, clicking on Processes, finding the process that tried
    to create the tables, clicking Show, then finding the file that has the db
    info and clicking it (I forget the name, but should be pretty clear).

    You might also want to try using postegres to manually reset hive's
    password or just delete the hive account. Maybe something messed up and CM
    re-generated the hive password, which no longer matches the db. You can
    find admin info in generated_password.txt in your /data directory where
    pg_hba.conf is located.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 2:20 PM, Ryan Collins wrote:

    I did retry the set up and each time it fails at the same step.
    When I try to create the hive database with the manager it says that the
    database already exists. Is there any chance it has to do with the psql
    permissions? I went into /var/lib/cloudera-scm-server-db/data and looked at
    the pg_hba.conf file and found this:

    # TYPE DATABASE USER CIDR-ADDRESS METHOD

    # "local" is for Unix domain socket connections only
    local all all md5
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
    # IPv6 local connections:
    host all all ::1/128 md5
    # Accept connections from all hosts
    host smon smon 0.0.0.0/0 md5
    host amon amon 0.0.0.0/0 md5
    host hmon hmon 0.0.0.0/0 md5
    host rman rman 0.0.0.0/0 md5
    host nav nav 0.0.0.0/0 md5
    # block remote access for admin user and scm
    host all cloudera-scm,scm 0.0.0.0/0 reject
    # enable remote access for other users
    host sameuser all 0.0.0.0/0 md5

    It seems fishy to me that it is only allowing local hosts, but I am
    very newbie when it comes to this.

    Any thoughts?

    Thank you again for all of your help.

    -Ryan



    On Fri, Jul 12, 2013 at 5:06 PM, Darren Lo wrote:

    I meant the Hive service command available in the CM UI, not the
    hive CLI command, sorry for the confusion. The "hive" CLI command won't do
    anything until you deploy client configs to /etc/hive/conf, which is done
    near the end of installation, so that's normal. You should just retry your
    setup though rather than trying to run in manually.

    On Fri, Jul 12, 2013 at 1:43 PM, Ryan Collins wrote:

    Thank you for your advice. I executed that command and indeed the
    manager database is running. I could not find the hive command to create a
    new database though, and it seems like it would not work anyway because
    "hive" currently does nothing when I enter it into the ssh session.

    Is there anyway to make sure that that user "hive" will be able
    to access the database? For instance, when I tried to check if the postgres
    database existed it promted me for a password and I had no idea what it was
    so I sudo-ed my way around it.

    Thanks again.

    On Fri, Jul 12, 2013 at 4:24 PM, Darren Lo wrote:

    Opening the port was a good idea. Did you retry your setup after
    opening the port?

    If you still hit trouble, ssh into your CM host and run:
    service cloudera-scm-server-db status

    If the database is running, then try running the Hive command to
    create the hive database before creating the tables.

    If you get that working, you can probably retry the setup.

    Thanks,
    Darren

    On Fri, Jul 12, 2013 at 12:21 PM, Ryan Collins wrote:

    I am installing Cloudera Manager onto an ec2 instance. I only added a single other ec2 instance to the cluster.

















    The installation succeeded, but when the manager initiates the cluster services (step 9 of 21) I get the
    following error:

    [2013-07-12 18:44:35,906]ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111)

















    - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'

    I manually opened port 7432 on the ec2 instance created by cloudera, because it did not appear to be open, I'm

















    not sure if that was a bad idea.

    Here are the logs:
    *stderr:*

    + date
    + date
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + cloudera_config=/usr/lib/cmf/service/hive
    ++ cd /usr/lib/cmf/service/hive/../common
    ++ pwd
    + cloudera_config=/usr/lib/cmf/service/common
    + . /usr/lib/cmf/service/common/cloudera-config.sh
    ++ set -x
    + locate_java_home
    + '[' -z '' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/j2sdk1.6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/java-6-sun/bin/java ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre//bin/java' ']'
    + for candidate in /usr/lib/j2sdk1.6-sun /usr/lib/jvm/java-6-sun '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*' '/usr/lib/jvm/java-1.6.0-sun-1.6.0.*/jre/' /usr/lib/jvm/j2sdk1.6-oracle /usr/lib/jvm/j2sdk1.6-oracle/jre '/usr/java/jdk1.6*' '/usr/java/jre1.6*' '/usr/java/jdk1.7*' '/usr/java/jre1.7*' /usr/lib/jvm/j2sdk1.7-oracle /usr/lib/jvm/j2sdk1.7-oracle/jre /Library/Java/Home /usr/java/default /usr/lib/jvm/default-java /usr/lib/jvm/java-openjdk /usr/lib/jvm/jre-openjdk '/usr/lib/jvm/java-1.7.0-openjdk*' '/usr/lib/jvm/java-7-openjdk*' '/usr/lib/jvm/java-1.6.0-openjdk-1.6.*' '/usr/lib/jvm/jre-1.6.0-openjdk*'
    + '[' -e /usr/lib/jvm/j2sdk1.6-oracle/bin/java ']'
    + export JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
    + break
    + '[' -z /usr/lib/jvm/j2sdk1.6-oracle ']'
    + source_parcel_environment
    + '[' '!' -z '' ']'
    + set_hive_classpath
    + set_classpath_in_var AUX_CLASSPATH
    + '[' -z AUX_CLASSPATH ']'
    + '[' /usr/share/cmf ']'
    ++ tr '\n' :
    ++ find /usr/share/cmf/lib/plugins -name '*.jar'
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:
    + ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + eval 'OLD_VALUE=$AUX_CLASSPATH'
    ++ OLD_VALUE=
    + '[' -z ']'
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar
    + '[' 4 = 4 ']'
    + export 'HADOOP_CLIENT_OPTS=-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + HADOOP_CLIENT_OPTS='-Djava.net.preferIPv4Stack=true -Xmx71254295 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:-CMSConcurrentMTEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled '
    + echo 'using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME'
    + echo 'using 4 as CDH_VERSION'
    + export HADOOP_HOME=/usr/lib/hadoop
    + HADOOP_HOME=/usr/lib/hadoop
    + export HIVE_HOME=/usr/lib/hive
    + HIVE_HOME=/usr/lib/hive
    + export HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + HIVE_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/yarn-conf ']'
    + '[' -d /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf ']'
    + export HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + HADOOP_CONF_DIR=/run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + '[' -f /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml ']'
    + cp -af /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf
    + echo 'using /usr/lib/hive as HIVE_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR'
    + echo 'using /usr/lib/hadoop as HADOOP_HOME'
    + echo 'using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR'
    + perl -pi -e 's#{{CMF_CONF_DIR}}#/run/cloudera-scm-agent/process/20-hive-metastore-create-tables#g' /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/core-site.xml /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hive-site.xml
    + JDBC_JARS=/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + [[ -z /usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar ]]
    + export AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + AUX_CLASSPATH=/usr/share/cmf/lib/plugins/tt-instrumentation-4.6.1.jar:/usr/share/cmf/lib/plugins/navigator-plugin-4.6.1-shaded.jar:/usr/share/cmf/lib/plugins/event-publish-4.6.1-shaded.jar:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar
    + copy_hive_default /run/cloudera-scm-agent/process/20-hive-metastore-create-tables
    + [[ -z 4 ]]
    + '[' 1 -ne 1 ']'
    + [[ 4 == 3 ]]
    + [[ create_metastore_tables == webhcat ]]
    + [[ create_metastore_tables == updatelocation ]]
    + [[ create_metastore_tables == create_metastore_tables ]]
    + [[ -z '' ]]
    + CREATE_TABLES_CLASSPATH='/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar'
    ++ dirname /usr/lib/cmf/service/hive/hive.sh
    + exec /usr/lib/jvm/j2sdk1.6-oracle/bin/java -Djava.net.preferIPv4Stack=true -cp '/usr/share/cmf/lib/*:/usr/share/java/mysql-connector-java.jar:/usr/share/cmf/lib/postgresql-9.0-801.jdbc4.jar:/usr/share/java/oracle-connector-java.jar' com.cloudera.cmf.service.hive.HiveMetastoreDbUtil /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/metastore_db_py.properties /usr/lib/cmf/service/hive/ddl --createTables
    log4j:ERROR Could not find value for key log4j.appender.A
    log4j:ERROR Could not instantiate appender named "A".
    Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.countTables(HiveMetastoreDbUtil.java:196)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:214)
    at com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.main(HiveMetastoreDbUtil.java:257)
    Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
    at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
    at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
    at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
    at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
    at org.postgresql.Driver.makeConnection(Driver.java:393)
    at org.postgresql.Driver.connect(Driver.java:267)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)
    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:191)
    ... 2 more
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at org.postgresql.core.PGStream.<init>(PGStream.java:62)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
    ... 15 more
    *STD OUT:
    *
    using /usr/lib/jvm/j2sdk1.6-oracle as JAVA_HOME
    using 4 as CDH_VERSION
    using /usr/lib/hive as HIVE_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables as HIVE_CONF_DIR
    using /usr/lib/hadoop as HADOOP_HOME
    using /run/cloudera-scm-agent/process/20-hive-metastore-create-tables/hadoop-conf as HADOOP_CONF_DIR
    INFO 0[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.listDdlInLib(HiveMetastoreDbUtil.java:108) - Listing ddls in dir: /usr/lib/hive/scripts/metastore/upgrade/mysql
    INFO 26[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:210) - Detected Hive version 0.10.0
    INFO 27[main] - com.cloudera.cmf.service.hive.HiveMetastoreDbUtil.createTables(HiveMetastoreDbUtil.java:212) - Using ddl file: /usr/lib/hive/scripts/metastore/upgrade/postgres/hive-schema-0.10.0.postgres.sql
    ERROR 63227[main] - com.cloudera.enterprise.dbutil.SqlRunner.open(SqlRunner.java:111) - Error connecting to db with user 'hive' and jdbcUrl 'jdbc:postgresql://ip-xx-xxx-xx-x.ec2.internal:7432/hive'
    Any help is greatly appreciated!!

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

    --
    Thanks,
    Darren

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupscm-users @
categorieshadoop
postedJul 12, '13 at 7:21p
activeJul 16, '13 at 7:44p
posts13
users2
websitecloudera.com
irc#hadoop

2 users in discussion

Ryan Collins: 7 posts Darren Lo: 6 posts

People

Translate

site design / logo © 2022 Grokbase