Support Questions

Find answers, ask questions, and share your expertise

Error starting registry in Ambari (HDF 3.0)

Explorer

Hi,

After installing the HDF (3.0.0.0) platform with NiFi, I am trying to start the Registry service (0.3.0), but it fails due to the following error:

Downloading mysql jar from url: https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.zip
Downloading file mysql-connector-java-5.1.40.zip into /tmp
Failed to download the mysql driver from https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.zip
Error occurred while downloading MySQL jar. bootstrap dir: /usr/hdf/current/registry/bootstrap

I have modified my ambari-server/ambari-env.sh file with the correct proxy host name and port, but does not appear to help. I have also tried manually installing this version of the mysql-connector, again no luck.

Any ideas?

1 ACCEPTED SOLUTION

Explorer

Hi,

I had the same issue and I resolved it incluiding proxy information

-Dhttps.proxyHost=proxy_name

-Dhttps.proxyPort=xxxx

when bootstrap-storage.sh call the class ${TABLE_INITIALIZER_MAIN_CLASS}

(functions dropTables, createTables, checkStorageConnection).

View solution in original post

12 REPLIES 12

Super Mentor

@Gavin Duffy

Can you please share the complete error from ambari-server.log?

Are you able to do wget from the host where you are trying to start the registry service? With our Without Proxy?

# wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.zip

.

Explorer

Hi Jay,

Full error log here from /var/lib/ambari-agent/data/errors-156.txt

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/common-services/REGISTRY/0.3.0/package/scripts/registry_server.py", line 120, in <module>
    RegistryServer().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 329, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/common-services/REGISTRY/0.3.0/package/scripts/registry_server.py", line 66, in start
    user="root")
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 262, in action_run
    tries=self.resource.tries, try_sleep=self.resource.try_sleep)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 72, in inner
    result = function(command, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 102, in checked_call
    tries=tries, try_sleep=try_sleep, timeout_kill_strategy=timeout_kill_strategy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 150, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 303, in _call
    raise ExecutionFailed(err_msg, code, out, err)
resource_management.core.exceptions.ExecutionFailed: Execution of 'source /usr/hdf/current/registry/conf/registry-env.sh ; /usr/hdf/current/registry/bootstrap/bootstrap-storage.sh' returned 1. Using Configuration file: /usr/hdf/current/registry/bootstrap/../conf/registry.yaml
Downloading mysql jar from url: https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.zip
Downloading file mysql-connector-java-5.1.40.zip into /tmp
Failed to download the mysql driver from https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.zip
Error occurred while downloading MySQL jar. bootstrap dir: /usr/hdf/current/registry/bootstrap

I also tried the wget request and it failed. I then updated the wget config file to use a http proxy and https proxy and the wget download then succeeded. However the issue above still persists when trying to start the registry service through Ambari.

For completeness here is the log from /var/lib/ambari-agent/data/output-202.txt

2017-07-05 10:05:03,512 - Group['hadoop'] {}
2017-07-05 10:05:03,515 - Group['nifi'] {}
2017-07-05 10:05:03,515 - User['streamline'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2017-07-05 10:05:03,516 - User['registry'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2017-07-05 10:05:03,517 - User['storm'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2017-07-05 10:05:03,517 - User['infra-solr'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2017-07-05 10:05:03,518 - User['zookeeper'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2017-07-05 10:05:03,519 - User['ams'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2017-07-05 10:05:03,519 - User['ambari-qa'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['users']}
2017-07-05 10:05:03,520 - User['kafka'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'hadoop']}
2017-07-05 10:05:03,520 - User['nifi'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': [u'nifi']}
2017-07-05 10:05:03,521 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2017-07-05 10:05:03,525 - 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'] {'not_if': '(test $(id -u ambari-qa) -gt 1000) || (false)'}
2017-07-05 10:05:03,532 - 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'] due to not_if
2017-07-05 10:05:03,549 - Execute[('setenforce', '0')] {'not_if': '(! which getenforce ) || (which getenforce && getenforce | grep -q Disabled)', 'sudo': True, 'only_if': 'test -f /selinux/enforce'}
2017-07-05 10:05:03,561 - Skipping Execute[('setenforce', '0')] due to only_if
2017-07-05 10:05:03,764 - Stack Feature Version Info: stack_version=3.0, version=3.0.0.0-453, current_cluster_version=3.0.0.0-453 -> 3.0.0.0-453
2017-07-05 10:05:03,766 - Directory['/var/log/registry'] {'group': 'hadoop', 'cd_access': 'a', 'create_parents': True, 'recursive_ownership': True, 'owner': 'registry', 'mode': 0755}
2017-07-05 10:05:03,768 - Directory['/var/run/registry'] {'group': 'hadoop', 'cd_access': 'a', 'create_parents': True, 'recursive_ownership': True, 'owner': 'registry', 'mode': 0755}
2017-07-05 10:05:03,769 - Directory['/usr/hdf/current/registry/conf'] {'group': 'hadoop', 'cd_access': 'a', 'create_parents': True, 'recursive_ownership': True, 'owner': 'registry', 'mode': 0755}
2017-07-05 10:05:03,770 - Directory['/var/lib/ambari-agent/data/registry'] {'group': 'hadoop', 'cd_access': 'a', 'create_parents': True, 'mode': 0755, 'owner': 'registry', 'recursive_ownership': True}
2017-07-05 10:05:03,775 - File['/usr/hdf/current/registry/conf/registry-env.sh'] {'content': InlineTemplate(...), 'owner': 'registry'}
2017-07-05 10:05:03,776 - Directory['/etc/security/limits.d'] {'owner': 'root', 'create_parents': True, 'group': 'root'}
2017-07-05 10:05:03,777 - Directory['/hdf/registry'] {'owner': 'registry', 'group': 'hadoop', 'create_parents': True, 'mode': 0755, 'cd_access': 'a'}
2017-07-05 10:05:03,781 - File['/etc/security/limits.d/registry.conf'] {'content': Template('registry.conf.j2'), 'owner': 'root', 'group': 'root', 'mode': 0644}
2017-07-05 10:05:03,788 - File['/usr/hdf/current/registry/conf/registry.yaml'] {'owner': 'registry', 'content': Template('registry.yaml.j2'), 'group': 'hadoop', 'mode': 0644}
2017-07-05 10:05:03,790 - File['/usr/lib/ambari-agent/DBConnectionVerification.jar'] {'content': DownloadSource('http://ourhostname.com:8080/resources/DBConnectionVerification.jar')}
2017-07-05 10:05:03,790 - Not downloading the file from http://ourhostname.com:8080/resources/DBConnectionVerification.jar, because /var/lib/ambari-agent/tmp/DBConnectionVerification.jar already exists
2017-07-05 10:05:03,792 - Execute['source /usr/hdf/current/registry/conf/registry-env.sh ; /usr/hdf/current/registry/bootstrap/bootstrap-storage.sh'] {'user': 'root'}
2017-07-05 10:07:12,077 - Execute['find /var/log/registry -maxdepth 1 -type f -name '*' -exec echo '==> {} <==' \; -exec tail -n 40 {} \;'] {'logoutput': True, 'ignore_failures': True, 'user': 'registry'}


Super Mentor

@Gavin Duffy

Ambari Server is a Java program , Where as Ambari Agent is a python program so if you have set the proxy property to the ambari server then it will not have any effect on agent behaviour.

You should try the following:

On all the ambari Agent Host, in the "~/.bash_profile" or "~/.profile" profile we can add the following:

export http_proxy=http://YOURPOROXY:PORT

.

Explorer

Unfortunately, no luck either with that. Still the same error as above

Super Mentor

@Gavin Duffy

I see that the URL is "https" here:

 https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.zip

So you should also set the"https_proxy" as well.

export http_proxy=http://YOURPOROXY:PORT
export https_proxy=https://YOURPOROXY:PORT

.

Explorer

Sorry I should have said that, I added that in as well, but no luck

Explorer

Hi,

I had the same issue and I resolved it incluiding proxy information

-Dhttps.proxyHost=proxy_name

-Dhttps.proxyPort=xxxx

when bootstrap-storage.sh call the class ${TABLE_INITIALIZER_MAIN_CLASS}

(functions dropTables, createTables, checkStorageConnection).

Explorer

Hi Juan,

Thanks for sharing. Where exactly did you add this proxy information?

Explorer

Thanks Juan,

I have made the changes you suggested and now Registry service is starting without issue. For clarity, I edited the file

/usr/hdf/current/registry/bootstrap/bootstrap-storage.sh

I updated the following lines with the proxy information, as suggested by Juan, by adding in the values for

-Dhttps.proxyHost=proxy_name

-Dhttps.proxyPort=xxxx

Example:

function dropTables {
    ${JAVA} -Dbootstrap.dir=$BOOTSTRAP_DIR -Dhttps.proxyHost=<YOUR_PROXY_HOST> -Dhttps.proxyPort=<YOUR_PROXY_PORT>  -cp ${CLASSPATH} ${TABLE_INITIALIZER_MAIN_CLASS} -m ${MYSQL_JAR_URL_PATH} -c ${CONFIG_FILE_PATH} -s ${SCRIPT_ROOT_DIR} --drop
}

function createTables {
    ${JAVA} -Dbootstrap.dir=$BOOTSTRAP_DIR -Dhttps.proxyHost=<YOUR_PROXY_HOST> -Dhttps.proxyPort=<YOUR_PROXY_PORT>  -cp ${CLASSPATH} ${TABLE_INITIALIZER_MAIN_CLASS} -m ${MYSQL_JAR_URL_PATH} -c ${CONFIG_FILE_PATH} -s ${SCRIPT_ROOT_DIR} --create
}

function checkStorageConnection {
    ${JAVA} -Dbootstrap.dir=$BOOTSTRAP_DIR -Dhttps.proxyHost=<YOUR_PROXY_HOST> -Dhttps.proxyPort=<YOUR_PROXY_PORT>  -cp ${CLASSPATH} ${TABLE_INITIALIZER_MAIN_CLASS} -m ${MYSQL_JAR_URL_PATH} -c ${CONFIG_FILE_PATH} -s ${SCRIPT_ROOT_DIR} --check-connection
}

Hope this helps someone in the future

New Contributor

This is the bug (AMBARI-21492): https://issues.apache.org/jira/browse/AMBARI-21492

Another simple workaround is to download the file, stuff it somewhere on a web server and edit the MYSQL_JAR_URL_PATH in this file: /usr/hdf/current/registry/bootstrap/bootstrap-storage.sh
If you're super lazy, this can work too:

yum install httpd -y  # Installs the Apache HTTP Server.
apachectl start  # Starts it.
# You can optionally use the jar brought by 'yum install mysql-connector-java', if it's up to date, to pack it into a format the script expects:
# mkdir /tmp/mysql-connector-java-5.1.40
# cp /usr/share/java/mysql-connector-java.jar /tmp/mysql-connector-java-5.1.40/mysql-connector-java-5.1.40-bin.jar
# cd /tmp
# zip /tmp/mysql-connector-java-5.1.40/ mysql-connector-java-5.1.40.zip
cp <wherever>/mysql-connector-java-5.1.40.zip /var/www/html/  # Based on environment, this one's for RHEL/Centos.
vi /usr/hdf/current/registry/bootstrap/bootstrap-storage.sh
# MYSQL_JAR_URL_PATH=http://yourserver/mysql-connector-java-5.1.40.zip

New Contributor

I was able to resolve the issue by copying the jar "mysql-connector-java-5.1.40-bin.jar" in /usr/share/java and /usr/hdf/current/registry/bootstrap/lib/. Below are the steps I followed:

1. Remove the mysql-connector-java.jar or other version jars from /usr/share/java and /usr/hdf/current/registry/bootstrap/

2. copy the jar mysql-connector-java-5.1.40-bin.jar in /usr/hdf/current/registry/bootstrap/lib/ and /usr/share/java

3. Create the symlinks:

ln -s /usr/share/java/ mysql-connector-java-5.1.40-bin.jar /usr/share/mysql-connector-java.jar

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

5. ambari-server restart

6. Start the registry service from ambari

Thanks, Sinha

,

I was able to resolve the issue by copying the jar "mysql-connector-java-5.1.40-bin.jar" in /usr/share/java and /usr/hdf/current/registry/bootstrap/lib/. Below are the steps I followed:

1. Remove the mysql-connector-java.jar or other version jars from /usr/share/java and /usr/hdf/current/registry/bootstrap/

2. copy the jar mysql-connector-java-5.1.40-bin.jar in /usr/hdf/current/registry/bootstrap/lib/ and /usr/share/java

3. Crete the symlinks: ln -s /usr/share/java/ mysql-connector-java-5.1.40-bin.jar /usr/share/mysql-connector-java.jar

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

5. ambari-server restart 6. Start the registry service from ambari

Thanks,

Sinha

,

I was able to resolve the issue by copying the jar "mysql-connector-java-5.1.40-bin.jar" in /usr/hdf/current/registry/bootstrap/lib/ and /usr/share/java location. I created symlink with the mysql jar:

ln -s /usr/share/java/mysql-connector-java-5.1.40-bin.jar /usr/share/java/mysql-connector-java.jar

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

ambari-server restart

Start the registry service

Thanks,

Sinha

New Contributor

If the proxy configuration is not working for you, You can download it manually from https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.zip on the machine and change the MYSQL_JAR_URL_PATH variable in /usr/hdf/current/registry/bootstrap/bootstrap-storage.sh to local path where file is stored using the file:// format i.e MYSQL_JAR_URL_PATH=file:///root/mysql-connector-java-5.1.40.zip

,

If the proxy configuration is not working for you, You can download it manually from https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.zip on the machine and change the MYSQL_JAR_URL_PATH variable in /usr/hdf/current/registry/bootstrap/bootstrap-storage.sh to local path where file is stored using the file:// format i.e MYSQL_JAR_URL_PATH=file:///root/mysql-connector-java-5.1.40.zip.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.