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

Ambari Server Installation Failed

Highlighted

Ambari Server Installation Failed

Hi All,

I have encountered a problem during installation in Ambari Server. (I am relatively new in this). I have followed the steps defined in the documentation on installing it.

The problem I encountered that fails the installation is on the Ranger KMS, it stated as follow :

stdout : /var/lib/ambari-agent/data/output-122.txt

2018-10-12 15:17:23,352 - Stack Feature Version Info: Cluster Stack=3.0, Command Stack=None, Command Version=None -> 3.0
2018-10-12 15:17:23,354 - Using hadoop conf dir: /usr/hdp/3.0.1.0-187/hadoop/conf
2018-10-12 15:17:23,355 - Group['kms'] {}
2018-10-12 15:17:23,355 - Group['livy'] {}
2018-10-12 15:17:23,356 - Group['spark'] {}
2018-10-12 15:17:23,356 - Group['ranger'] {}
2018-10-12 15:17:23,356 - Group['hdfs'] {}
2018-10-12 15:17:23,356 - Group['zeppelin'] {}
2018-10-12 15:17:23,356 - Group['hadoop'] {}
2018-10-12 15:17:23,356 - Group['users'] {}
2018-10-12 15:17:23,356 - Group['knox'] {}
2018-10-12 15:17:23,356 - User['yarn-ats'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,357 - User['hive'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,357 - User['storm'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,358 - User['infra-solr'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,358 - User['zookeeper'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,359 - User['oozie'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop', 'users'], 'uid': None}
2018-10-12 15:17:23,359 - User['atlas'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,360 - User['ams'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,360 - User['ranger'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['ranger', 'hadoop'], 'uid': None}
2018-10-12 15:17:23,361 - User['tez'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop', 'users'], 'uid': None}
2018-10-12 15:17:23,361 - User['zeppelin'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['zeppelin', 'hadoop'], 'uid': None}
2018-10-12 15:17:23,362 - User['kms'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['kms', 'hadoop'], 'uid': None}
2018-10-12 15:17:23,362 - User['accumulo'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,363 - User['livy'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['livy', 'hadoop'], 'uid': None}
2018-10-12 15:17:23,363 - User['druid'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,364 - User['spark'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['spark', 'hadoop'], 'uid': None}
2018-10-12 15:17:23,364 - User['ambari-qa'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop', 'users'], 'uid': None}
2018-10-12 15:17:23,365 - User['kafka'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,365 - User['hdfs'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hdfs', 'hadoop'], 'uid': None}
2018-10-12 15:17:23,365 - User['sqoop'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,366 - User['yarn'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,366 - User['mapred'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,367 - User['hbase'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-10-12 15:17:23,367 - User['knox'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop', 'knox'], 'uid': None}
2018-10-12 15:17:23,368 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2018-10-12 15:17:23,368 - Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa 0'] {'not_if': '(test $(id -u ambari-qa) -gt 1000) || (false)'}
2018-10-12 15:17:23,371 - Skipping Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa 0'] due to not_if
2018-10-12 15:17:23,371 - Directory['/tmp/hbase-hbase'] {'owner': 'hbase', 'create_parents': True, 'mode': 0775, 'cd_access': 'a'}
2018-10-12 15:17:23,372 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2018-10-12 15:17:23,372 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2018-10-12 15:17:23,372 - call['/var/lib/ambari-agent/tmp/changeUid.sh hbase'] {}
2018-10-12 15:17:23,376 - call returned (0, '1023')
2018-10-12 15:17:23,377 - Execute['/var/lib/ambari-agent/tmp/changeUid.sh hbase /home/hbase,/tmp/hbase,/usr/bin/hbase,/var/log/hbase,/tmp/hbase-hbase 1023'] {'not_if': '(test $(id -u hbase) -gt 1000) || (false)'}
2018-10-12 15:17:23,383 - Skipping Execute['/var/lib/ambari-agent/tmp/changeUid.sh hbase /home/hbase,/tmp/hbase,/usr/bin/hbase,/var/log/hbase,/tmp/hbase-hbase 1023'] due to not_if
2018-10-12 15:17:23,383 - Group['hdfs'] {}
2018-10-12 15:17:23,384 - User['hdfs'] {'fetch_nonlocal_groups': True, 'groups': ['hdfs', 'hadoop', u'hdfs']}
2018-10-12 15:17:23,384 - FS Type: HDFS
2018-10-12 15:17:23,384 - Directory['/etc/hadoop'] {'mode': 0755}
2018-10-12 15:17:23,393 - File['/usr/hdp/3.0.1.0-187/hadoop/conf/hadoop-env.sh'] {'content': InlineTemplate(...), 'owner': 'hdfs', 'group': 'hadoop'}
2018-10-12 15:17:23,393 - Directory['/var/lib/ambari-agent/tmp/hadoop_java_io_tmpdir'] {'owner': 'hdfs', 'group': 'hadoop', 'mode': 01777}
2018-10-12 15:17:23,411 - Repository['HDP-3.0-repo-1'] {'base_url': 'http://public-repo-1.hortonworks.com/HDP/ubuntu16/3.x/updates/3.0.1.0', 'action': ['prepare'], 'components': [u'HDP', 'main'], 'repo_template': '{{package_type}} {{base_url}} {{components}}', 'repo_file_name': 'ambari-hdp-1', 'mirror_list': None}
2018-10-12 15:17:23,414 - Repository['HDP-3.0-GPL-repo-1'] {'base_url': 'http://public-repo-1.hortonworks.com/HDP-GPL/ubuntu16/3.x/updates/3.0.1.0', 'action': ['prepare'], 'components': [u'HDP-GPL', 'main'], 'repo_template': '{{package_type}} {{base_url}} {{components}}', 'repo_file_name': 'ambari-hdp-1', 'mirror_list': None}
2018-10-12 15:17:23,414 - Repository['HDP-UTILS-1.1.0.22-repo-1'] {'base_url': 'http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/ubuntu16', 'action': ['prepare'], 'components': [u'HDP-UTILS', 'main'], 'repo_template': '{{package_type}} {{base_url}} {{components}}', 'repo_file_name': 'ambari-hdp-1', 'mirror_list': None}
2018-10-12 15:17:23,415 - Repository[None] {'action': ['create']}
2018-10-12 15:17:23,416 - File['/tmp/tmpdQOBOp'] {'content': 'deb http://public-repo-1.hortonworks.com/HDP/ubuntu16/3.x/updates/3.0.1.0 HDP main\ndeb http://public-repo-1.hortonworks.com/HDP-GPL/ubuntu16/3.x/updates/3.0.1.0 HDP-GPL main\ndeb http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/ubuntu16 HDP-UTILS main'}
2018-10-12 15:17:23,416 - Writing File['/tmp/tmpdQOBOp'] because contents don't match
2018-10-12 15:17:23,416 - File['/tmp/tmppUJIwy'] {'content': StaticFile('/etc/apt/sources.list.d/ambari-hdp-1.list')}
2018-10-12 15:17:23,416 - Writing File['/tmp/tmppUJIwy'] because contents don't match
2018-10-12 15:17:23,418 - Package['unzip'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2018-10-12 15:17:23,486 - Skipping installation of existing package unzip
2018-10-12 15:17:23,486 - Package['curl'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2018-10-12 15:17:23,553 - Skipping installation of existing package curl
2018-10-12 15:17:23,554 - Package['hdp-select'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2018-10-12 15:17:23,619 - Skipping installation of existing package hdp-select
2018-10-12 15:17:23,622 - The repository with version 3.0.1.0-187 for this command has been marked as resolved. It will be used to report the version of the component which was installed
2018-10-12 15:17:23,818 - Package['ranger-3-0-1-0-187-kms'] {'retry_on_repo_unavailability': False, 'retry_count': 5}
2018-10-12 15:17:23,886 - Installing package ranger-3-0-1-0-187-kms ('/usr/bin/apt-get -o Dpkg::Options::=--force-confdef --allow-unauthenticated --assume-yes install ranger-3-0-1-0-187-kms')
2018-10-12 15:18:49,021 - Stack Feature Version Info: Cluster Stack=3.0, Command Stack=None, Command Version=None -> 3.0
2018-10-12 15:18:49,031 - Using hadoop conf dir: /usr/hdp/3.0.1.0-187/hadoop/conf
2018-10-12 15:18:49,034 - Execute[('cp', '-f', u'/usr/hdp/current/ranger-kms/install.properties', u'/usr/hdp/current/ranger-kms/install-backup.properties')] {'not_if': 'ls /usr/hdp/current/ranger-kms/install-backup.properties', 'sudo': True, 'only_if': 'ls /usr/hdp/current/ranger-kms/install.properties'}
2018-10-12 15:18:49,047 - Password validated
2018-10-12 15:18:49,047 - File['/var/lib/ambari-agent/tmp/mysql-connector-java-8.0.12.jar'] {'content': DownloadSource('http://MYPTJ020DT-Linux:8080/resources/mysql-connector-java-8.0.12.jar'), 'mode': 0644}
2018-10-12 15:18:49,048 - Downloading the file from http://MYPTJ020DT-Linux:8080/resources/mysql-connector-java-8.0.12.jar
2018-10-12 15:18:49,056 - Directory['/usr/hdp/current/ranger-kms/ews/lib'] {'mode': 0755}
2018-10-12 15:18:49,056 - Creating directory Directory['/usr/hdp/current/ranger-kms/ews/lib'] since it doesn't exist.
2018-10-12 15:18:49,056 - Execute[('cp', '--remove-destination', u'/var/lib/ambari-agent/tmp/mysql-connector-java-8.0.12.jar', u'/usr/hdp/current/ranger-kms/ews/webapp/lib')] {'path': ['/bin', '/usr/bin/'], 'sudo': True}
2018-10-12 15:18:49,060 - File['/usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar'] {'mode': 0644}
2018-10-12 15:18:49,061 - ModifyPropertiesFile['/usr/hdp/current/ranger-kms/install.properties'] {'owner': 'kms', 'properties': ...}
2018-10-12 15:18:49,061 - Modifying existing properties file: /usr/hdp/current/ranger-kms/install.properties
2018-10-12 15:18:49,066 - File['/usr/hdp/current/ranger-kms/install.properties'] {'owner': 'kms', 'content': ..., 'group': None, 'mode': None, 'encoding': 'utf-8'}
2018-10-12 15:18:49,066 - Writing File['/usr/hdp/current/ranger-kms/install.properties'] because contents don't match
2018-10-12 15:18:49,067 - Changing owner for /usr/hdp/current/ranger-kms/install.properties from 0 to kms
2018-10-12 15:18:49,067 - ModifyPropertiesFile['/usr/hdp/current/ranger-kms/install.properties'] {'owner': 'kms', 'properties': {'SQL_CONNECTOR_JAR': u'/usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar'}}
2018-10-12 15:18:49,067 - Modifying existing properties file: /usr/hdp/current/ranger-kms/install.properties
2018-10-12 15:18:49,068 - File['/usr/hdp/current/ranger-kms/install.properties'] {'owner': 'kms', 'content': ..., 'group': None, 'mode': None, 'encoding': 'utf-8'}
2018-10-12 15:18:49,068 - Setting up Ranger KMS DB and DB User
2018-10-12 15:18:49,068 - Execute['ambari-python-wrap /usr/hdp/current/ranger-kms/dba_script.py -q'] {'logoutput': True, 'environment': {'RANGER_KMS_HOME': u'/usr/hdp/current/ranger-kms', 'JAVA_HOME': u'/usr/jdk64/jdk1.8.0_112'}, 'tries': 5, 'user': 'kms', 'try_sleep': 10}
2018-10-12 15:18:49,098  [I] Running DBA setup script. QuiteMode:True
2018-10-12 15:18:49,098  [I] Using Java:/usr/jdk64/jdk1.8.0_112/bin/java
2018-10-12 15:18:49,098  [I] DB FLAVOR:MYSQL
2018-10-12 15:18:49,098  [I] DB Host:localhost
2018-10-12 15:18:49,098  [I] ---------- Verifing DB root password ---------- 
2018-10-12 15:18:49,098  [I] DBA root user password validated
2018-10-12 15:18:49,098  [I] ---------- Verifing Ranger KMS db user password ---------- 
2018-10-12 15:18:49,098  [I] KMS user password validated
2018-10-12 15:18:49,098  [I] ---------- Creating Ranger KMS db user ---------- 
2018-10-12 15:18:49,098  [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SQLException : SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2018-10-12 15:18:49,314  [E] Can't establish db connection.. Exiting..
2018-10-12 15:18:49,321 - Retrying after 10 seconds. Reason: Execution of 'ambari-python-wrap /usr/hdp/current/ranger-kms/dba_script.py -q' returned 1. 2018-10-12 15:18:49,098  [I] Running DBA setup script. QuiteMode:True
2018-10-12 15:18:49,098  [I] Using Java:/usr/jdk64/jdk1.8.0_112/bin/java
2018-10-12 15:18:49,098  [I] DB FLAVOR:MYSQL
2018-10-12 15:18:49,098  [I] DB Host:localhost
2018-10-12 15:18:49,098  [I] ---------- Verifing DB root password ---------- 
2018-10-12 15:18:49,098  [I] DBA root user password validated
2018-10-12 15:18:49,098  [I] ---------- Verifing Ranger KMS db user password ---------- 
2018-10-12 15:18:49,098  [I] KMS user password validated
2018-10-12 15:18:49,098  [I] ---------- Creating Ranger KMS db user ---------- 
2018-10-12 15:18:49,098  [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SQLException : SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2018-10-12 15:18:49,314  [E] Can't establish db connection.. Exiting..
2018-10-12 15:18:59,359  [I] Running DBA setup script. QuiteMode:True
2018-10-12 15:18:59,359  [I] Using Java:/usr/jdk64/jdk1.8.0_112/bin/java
2018-10-12 15:18:59,359  [I] DB FLAVOR:MYSQL
2018-10-12 15:18:59,359  [I] DB Host:localhost
2018-10-12 15:18:59,359  [I] ---------- Verifing DB root password ---------- 
2018-10-12 15:18:59,359  [I] DBA root user password validated
2018-10-12 15:18:59,359  [I] ---------- Verifing Ranger KMS db user password ---------- 
2018-10-12 15:18:59,359  [I] KMS user password validated
2018-10-12 15:18:59,359  [I] ---------- Creating Ranger KMS db user ---------- 
2018-10-12 15:18:59,359  [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SQLException : SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2018-10-12 15:18:59,556  [E] Can't establish db connection.. Exiting..
2018-10-12 15:18:59,562 - Retrying after 10 seconds. Reason: Execution of 'ambari-python-wrap /usr/hdp/current/ranger-kms/dba_script.py -q' returned 1. 2018-10-12 15:18:59,359  [I] Running DBA setup script. QuiteMode:True
2018-10-12 15:18:59,359  [I] Using Java:/usr/jdk64/jdk1.8.0_112/bin/java
2018-10-12 15:18:59,359  [I] DB FLAVOR:MYSQL
2018-10-12 15:18:59,359  [I] DB Host:localhost
2018-10-12 15:18:59,359  [I] ---------- Verifing DB root password ---------- 
2018-10-12 15:18:59,359  [I] DBA root user password validated
2018-10-12 15:18:59,359  [I] ---------- Verifing Ranger KMS db user password ---------- 
2018-10-12 15:18:59,359  [I] KMS user password validated
2018-10-12 15:18:59,359  [I] ---------- Creating Ranger KMS db user ---------- 
2018-10-12 15:18:59,359  [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SQLException : SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2018-10-12 15:18:59,556  [E] Can't establish db connection.. Exiting..
2018-10-12 15:19:09,593  [I] Running DBA setup script. QuiteMode:True
2018-10-12 15:19:09,593  [I] Using Java:/usr/jdk64/jdk1.8.0_112/bin/java
2018-10-12 15:19:09,593  [I] DB FLAVOR:MYSQL
2018-10-12 15:19:09,593  [I] DB Host:localhost
2018-10-12 15:19:09,593  [I] ---------- Verifing DB root password ---------- 
2018-10-12 15:19:09,593  [I] DBA root user password validated
2018-10-12 15:19:09,593  [I] ---------- Verifing Ranger KMS db user password ---------- 
2018-10-12 15:19:09,593  [I] KMS user password validated
2018-10-12 15:19:09,593  [I] ---------- Creating Ranger KMS db user ---------- 
2018-10-12 15:19:09,594  [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SQLException : SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2018-10-12 15:19:09,796  [E] Can't establish db connection.. Exiting..
2018-10-12 15:19:09,800 - Retrying after 10 seconds. Reason: Execution of 'ambari-python-wrap /usr/hdp/current/ranger-kms/dba_script.py -q' returned 1. 2018-10-12 15:19:09,593  [I] Running DBA setup script. QuiteMode:True
2018-10-12 15:19:09,593  [I] Using Java:/usr/jdk64/jdk1.8.0_112/bin/java
2018-10-12 15:19:09,593  [I] DB FLAVOR:MYSQL
2018-10-12 15:19:09,593  [I] DB Host:localhost
2018-10-12 15:19:09,593  [I] ---------- Verifing DB root password ---------- 
2018-10-12 15:19:09,593  [I] DBA root user password validated
2018-10-12 15:19:09,593  [I] ---------- Verifing Ranger KMS db user password ---------- 
2018-10-12 15:19:09,593  [I] KMS user password validated
2018-10-12 15:19:09,593  [I] ---------- Creating Ranger KMS db user ---------- 
2018-10-12 15:19:09,594  [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SQLException : SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2018-10-12 15:19:09,796  [E] Can't establish db connection.. Exiting..
2018-10-12 15:19:19,840  [I] Running DBA setup script. QuiteMode:True
2018-10-12 15:19:19,841  [I] Using Java:/usr/jdk64/jdk1.8.0_112/bin/java
2018-10-12 15:19:19,841  [I] DB FLAVOR:MYSQL
2018-10-12 15:19:19,841  [I] DB Host:localhost
2018-10-12 15:19:19,841  [I] ---------- Verifing DB root password ---------- 
2018-10-12 15:19:19,841  [I] DBA root user password validated
2018-10-12 15:19:19,841  [I] ---------- Verifing Ranger KMS db user password ---------- 
2018-10-12 15:19:19,841  [I] KMS user password validated
2018-10-12 15:19:19,841  [I] ---------- Creating Ranger KMS db user ---------- 
2018-10-12 15:19:19,841  [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SQLException : SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2018-10-12 15:19:20,064  [E] Can't establish db connection.. Exiting..
2018-10-12 15:19:20,067 - Retrying after 10 seconds. Reason: Execution of 'ambari-python-wrap /usr/hdp/current/ranger-kms/dba_script.py -q' returned 1. 2018-10-12 15:19:19,840  [I] Running DBA setup script. QuiteMode:True
2018-10-12 15:19:19,841  [I] Using Java:/usr/jdk64/jdk1.8.0_112/bin/java
2018-10-12 15:19:19,841  [I] DB FLAVOR:MYSQL
2018-10-12 15:19:19,841  [I] DB Host:localhost
2018-10-12 15:19:19,841  [I] ---------- Verifing DB root password ---------- 
2018-10-12 15:19:19,841  [I] DBA root user password validated
2018-10-12 15:19:19,841  [I] ---------- Verifing Ranger KMS db user password ---------- 
2018-10-12 15:19:19,841  [I] KMS user password validated
2018-10-12 15:19:19,841  [I] ---------- Creating Ranger KMS db user ---------- 
2018-10-12 15:19:19,841  [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SQLException : SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2018-10-12 15:19:20,064  [E] Can't establish db connection.. Exiting..
2018-10-12 15:19:30,107  [I] Running DBA setup script. QuiteMode:True
2018-10-12 15:19:30,107  [I] Using Java:/usr/jdk64/jdk1.8.0_112/bin/java
2018-10-12 15:19:30,107  [I] DB FLAVOR:MYSQL
2018-10-12 15:19:30,107  [I] DB Host:localhost
2018-10-12 15:19:30,107  [I] ---------- Verifing DB root password ---------- 
2018-10-12 15:19:30,107  [I] DBA root user password validated
2018-10-12 15:19:30,107  [I] ---------- Verifing Ranger KMS db user password ---------- 
2018-10-12 15:19:30,108  [I] KMS user password validated
2018-10-12 15:19:30,108  [I] ---------- Creating Ranger KMS db user ---------- 
2018-10-12 15:19:30,108  [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SQLException : SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2018-10-12 15:19:30,321  [E] Can't establish db connection.. Exiting..
2018-10-12 15:19:30,326 - The repository with version 3.0.1.0-187 for this command has been marked as resolved. It will be used to report the version of the component which was installed

Command failed after 1 tries

stderr : /var/lib/ambari-agent/data/errors-122.txt

Traceback (most recent call last):
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 150, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 314, in _call
    raise ExecutionFailed(err_msg, code, out, err)
ExecutionFailed: Execution of 'ambari-python-wrap /usr/hdp/current/ranger-kms/dba_script.py -q' returned 1. 2018-10-12 15:19:19,840  [I] Running DBA setup script. QuiteMode:True
2018-10-12 15:19:19,841  [I] Using Java:/usr/jdk64/jdk1.8.0_112/bin/java
2018-10-12 15:19:19,841  [I] DB FLAVOR:MYSQL
2018-10-12 15:19:19,841  [I] DB Host:localhost
2018-10-12 15:19:19,841  [I] ---------- Verifing DB root password ---------- 
2018-10-12 15:19:19,841  [I] DBA root user password validated
2018-10-12 15:19:19,841  [I] ---------- Verifing Ranger KMS db user password ---------- 
2018-10-12 15:19:19,841  [I] KMS user password validated
2018-10-12 15:19:19,841  [I] ---------- Creating Ranger KMS db user ---------- 
2018-10-12 15:19:19,841  [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SQLException : SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2018-10-12 15:19:20,064  [E] Can't establish db connection.. Exiting..

The above exception was the cause of the following exception:

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/RANGER_KMS/package/scripts/kms_server.py", line 137, in <module>
    KmsServer().execute()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 351, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/RANGER_KMS/package/scripts/kms_server.py", line 51, in install
    kms.setup_kms_db()
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/RANGER_KMS/package/scripts/kms.py", line 79, in setup_kms_db
    Execute(dba_setup, environment=env_dict, logoutput=True, user=params.kms_user, tries=5, try_sleep=10)
  File "/usr/lib/ambari-agent/lib/resource_management/core/base.py", line 166, in __init__
    self.env.run()
  File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/ambari-agent/lib/resource_management/core/providers/system.py", line 263, in action_run
    returns=self.resource.returns)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 72, in inner
    result = function(command, **kwargs)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 102, in checked_call
    tries=tries, try_sleep=try_sleep, timeout_kill_strategy=timeout_kill_strategy, returns=returns)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 150, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 314, in _call
    raise ExecutionFailed(err_msg, code, out, err)
resource_management.core.exceptions.ExecutionFailed: Execution of 'ambari-python-wrap /usr/hdp/current/ranger-kms/dba_script.py -q' returned 1. 2018-10-12 15:19:30,107  [I] Running DBA setup script. QuiteMode:True
2018-10-12 15:19:30,107  [I] Using Java:/usr/jdk64/jdk1.8.0_112/bin/java
2018-10-12 15:19:30,107  [I] DB FLAVOR:MYSQL
2018-10-12 15:19:30,107  [I] DB Host:localhost
2018-10-12 15:19:30,107  [I] ---------- Verifing DB root password ---------- 
2018-10-12 15:19:30,107  [I] DBA root user password validated
2018-10-12 15:19:30,107  [I] ---------- Verifing Ranger KMS db user password ---------- 
2018-10-12 15:19:30,108  [I] KMS user password validated
2018-10-12 15:19:30,108  [I] ---------- Creating Ranger KMS db user ---------- 
2018-10-12 15:19:30,108  [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SQLException : SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0
2018-10-12 15:19:30,321  [E] Can't establish db connection.. Exiting..

It would be wonderful if someone could help me on this.

P/S : My current setup for the cluster is a single cluster node for testing purposes before going into Production

Thank you.

5 REPLIES 5
Highlighted

Re: Ambari Server Installation Failed

Super Mentor

@Arif Ishak

We see the error as following:

SQLException : SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. ErrorCode: 0

.

Which basically indicates that Ranger process is not able to connect to MySQL. Mostly it is due to some N/W error Or If the MySQL DB is not running or having some issues.

So please check the following:

1. Verify if the DB URL is correct? Are you running MySQL locally ? as we see localhost tin the URL.

jdbc:mysql://localhost/mysql 

2. Check if MySQL is running and listening on default port 3306? Do you see connections there or TIME_WAIT ...etc

# netstat -tnlpa | grep 3306

.

3. Can you try to manually run the command to see if you are able to connect to the DB?

# /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"

.

Please replace "*********" with your MySQL root password.

Highlighted

Re: Ambari Server Installation Failed

Hi @Jay Kumar SenSharma,

Yes the MySQL is running locally, and after a few checks I have found out i have yet to connect to it (my bad), and I have follow it back the steps on configuring MySQL for Ranger and have connected the MySQL, and I tried to continue back for my installation

(https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.1.0/bk_ambari-installation/content/configuring_mysql_for_ranger.html)

But now, I have encountered another problem in which I have cancelled the installation (which is way after the Deploy), and I tried to make a new one or try to Deploy again but it gave me the following error:

500 status code received on DELETE method for API: /api/v1/clusters/cluster01

Error message: org.apache.ambari.server.controller.spi.SystemException: An internal system exception occurred: Could not delete cluster, clusterName=cluster01

I have tried to stop and restart the ambari-server but nothing works for me currently, it would be great if you or someone could help me on this so that I could deploy a new one/or re-deploy the one I made before this.

Thank you.

Re: Ambari Server Installation Failed

Super Mentor
@Arif Ishak

Looks like you are trying to delete the cluster and that time it is failing.

500 status code received on DELETE method for API: /api/v1/clusters/cluster01

Is there any specific reason that you want to Delete the cluster?

If you really want to reset the ambari DB so that all the OLD cluster information and configs can be cleaned then you will need to check if you are using Embedded Poistgres DB for Ambari ? If yes then you can do it simply by running the following DB command:

NOTE: Please take a latest DB dump for safe backup.

For resetting Embedded Postgres DB for Ambari

# ambari-server stop
# ambari-server reset

.

For resetting External Ambari DB reset

You will have to Drop your "ambari" DB from MySQL Database and then recreate the Ambari Schema by importing the corresponding Ambari Schema based on your database type.

https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.2.0/bk_ambari-administration/content/ch_amb_ref...

.

Highlighted

Re: Ambari Server Installation Failed

Hi @Jay Kumar SenSharma

After I have followed on resetting it I have tried to make a new cluster but unfortunately I have encountered the same problem I had before this which is in regards of the Ranger KMS installation failure

The following commands gives me this :

# netstat -tnlpa | grep 3306

91707-93u4m.png

# /usr/jdk64/jdk1.8.0_112/bin/java  -cp /usr/hdp/current/ranger-kms/ews/webapp/lib/mysql-connector-java-8.0.12.jar:/usr/hdp/current/ranger-kms/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://localhost/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"

91710-4q6nz.png

***** have changed into my own password

Ranger KMS settings

91711-guk0r.png

How could I resolve this issue?

Thank you.

Highlighted

Re: Ambari Server Installation Failed

Super Mentor

@Arif Ishak

I see that this time the error is different

SQL state: 28000 java.sql.SQLException: Access denied for user 'root@'localhost' 

.

This can happen when you have not setup the DB access for root user from localhost. So pleaAse run the following MySQL Queries on your MySQL db to grand permission :

# mysql -u root -p
Enter Password: 


mysql> use mysql;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION; 
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; 
mysql> FLUSH PRIVILEGES;

.

Similarly please check if for Ranger you have given proper permissions or not? As mentioned in : https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.4/bk_security/content/configuring_mysql_for_r...

CREATE USER 'rangerdba'@'localhost' IDENTIFIED BY 'rangerdba';
GRANT ALL PRIVILEGES ON *.* TO 'rangerdba'@'localhost';
CREATE USER 'rangerdba'@'%' IDENTIFIED BY 'rangerdba';
GRANT ALL PRIVILEGES ON *.* TO 'rangerdba'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'rangerdba'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'rangerdba'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

.