You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Yu Hou (Jira)" <ji...@apache.org> on 2023/03/18 14:40:00 UTC

[jira] [Resolved] (AMBARI-25887) Blueprint inconsistent import/export logic for database connection url

     [ https://issues.apache.org/jira/browse/AMBARI-25887?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yu Hou resolved AMBARI-25887.
-----------------------------
    Resolution: Resolved

> Blueprint inconsistent import/export logic for database connection url
> ----------------------------------------------------------------------
>
>                 Key: AMBARI-25887
>                 URL: https://issues.apache.org/jira/browse/AMBARI-25887
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server, blueprints
>            Reporter: Zhiguo Wu
>            Assignee: Zhiguo Wu
>            Priority: Major
>             Fix For: 2.8.0
>
>         Attachments: blueprint-configuration.json, image-2023-03-09-18-53-14-454.png
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> When I manually deploy a cluster which contains hive service, and get blueprint config from the cluster: 
> !image-2023-03-09-18-53-14-454.png!
>  
> then create a new cluster by this config, an error occurs because it cannot resolve mysql connection url on hive-site configuration
> {code:java}
> Traceback (most recent call last):
>   File "/var/lib/ambari-agent/cache/stacks/BIGTOP/3.2.0/services/HIVE/package/scripts/hive_metastore.py", line 201, in <module>
>     HiveMetastore().execute()
>   File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 355, in execute
>     method(env)
>   File "/var/lib/ambari-agent/cache/stacks/BIGTOP/3.2.0/services/HIVE/package/scripts/hive_metastore.py", line 61, in start
>     create_metastore_schema() # execute without config lock
>   File "/var/lib/ambari-agent/cache/stacks/BIGTOP/3.2.0/services/HIVE/package/scripts/hive.py", line 466, in create_metastore_schema
>     user = params.hive_user
>   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 280, 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 'export HIVE_CONF_DIR=/etc/hive/conf ; /usr/bigtop/current/hive-client/bin/schematool -initSchema -dbType mysql -userName hive -passWord [PROTECTED] -verbose' returned 1. SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in [jar:file:/usr/bigtop/3.2.0/usr/lib/hive/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in [jar:file:/usr/bigtop/3.2.0/usr/lib/hadoop/lib/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
> SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
> Metastore connection URL:	 jdbc:mysql://%HOSTGROUP::host_group_1%/hive
> Metastore Connection Driver :	 com.mysql.jdbc.Driver
> Metastore connection User:	 hive
> org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
> Underlying cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException : Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: ":host_group_1%"'.
> SQL Error code: 0
> org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
> 	at org.apache.hadoop.hive.metastore.tools.HiveSchemaHelper.getConnectionToMetastore(HiveSchemaHelper.java:94)
> 	at org.apache.hive.beeline.HiveSchemaTool.getConnectionToMetastore(HiveSchemaTool.java:169)
> 	at org.apache.hive.beeline.HiveSchemaTool.testConnectionToMetastore(HiveSchemaTool.java:475)
> 	at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:581)
> 	at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:567)
> 	at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1517)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at org.apache.hadoop.util.RunJar.run(RunJar.java:323)
> 	at org.apache.hadoop.util.RunJar.main(RunJar.java:236)
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: ":host_group_1%"'.
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> 	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
> 	at com.mysql.jdbc.Util.getInstance(Util.java:408)
> 	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
> 	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
> 	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
> 	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861)
> 	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:338)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:664)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:247)
> 	at org.apache.hadoop.hive.metastore.tools.HiveSchemaHelper.getConnectionToMetastore(HiveSchemaHelper.java:88)
> 	... 11 more
> Caused by: java.lang.NumberFormatException: For input string: ":host_group_1%"
> 	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> 	at java.lang.Integer.parseInt(Integer.java:580)
> 	at java.lang.Integer.parseInt(Integer.java:615)
> 	at com.mysql.jdbc.NonRegisteringDriver.port(NonRegisteringDriver.java:825)
> 	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
> 	... 14 more {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ambari.apache.org
For additional commands, e-mail: issues-help@ambari.apache.org