MK created HIVE-26120:
-------------------------

             Summary: beeline return 0 when Could not open connection to the 
HS2 server
                 Key: HIVE-26120
                 URL: https://issues.apache.org/jira/browse/HIVE-26120
             Project: Hive
          Issue Type: Bug
          Components: Beeline
            Reporter: MK


when execute  :  beeline -u 'jdbc:hive2://bigdata-hs111:10003' -n 'etl' -p 
'******' -f /opt/project/DWD/SPD/xxx.sql    and  bigdata-hs111  doesn't exists  
or can't connect , the command return code is 0 ,  NOT a Non-zero value . 

 

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in 
[jar:file:/data/programs/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.17.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in 
[jar:file:/data/programs/hadoop-3.1.4/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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]
Connecting to jdbc:hive2://bigdata-hs111:10003
2022-04-06T17:28:04,247 WARN [main] org.apache.hive.jdbc.Utils - Could not 
retrieve canonical hostname for bigdata-hs111
java.net.UnknownHostException: bigdata-hs111: Name or service not known
        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) 
~[?:1.8.0_191]
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929) 
~[?:1.8.0_191]
        at 
java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324) 
~[?:1.8.0_191]
        at java.net.InetAddress.getAllByName0(InetAddress.java:1277) 
~[?:1.8.0_191]
        at java.net.InetAddress.getAllByName(InetAddress.java:1193) 
~[?:1.8.0_191]
        at java.net.InetAddress.getAllByName(InetAddress.java:1127) 
~[?:1.8.0_191]
        at java.net.InetAddress.getByName(InetAddress.java:1077) ~[?:1.8.0_191]
        at org.apache.hive.jdbc.Utils.getCanonicalHostName(Utils.java:701) 
[hive-jdbc-3.1.2.jar:3.1.2]
        at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:178) 
[hive-jdbc-3.1.2.jar:3.1.2]
        at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) 
[hive-jdbc-3.1.2.jar:3.1.2]
        at java.sql.DriverManager.getConnection(DriverManager.java:664) 
[?:1.8.0_191]
        at java.sql.DriverManager.getConnection(DriverManager.java:208) 
[?:1.8.0_191]
        at 
org.apache.hive.beeline.DatabaseConnection.connect(DatabaseConnection.java:145) 
[hive-beeline-3.1.2.jar:3.1.2]
        at 
org.apache.hive.beeline.DatabaseConnection.getConnection(DatabaseConnection.java:209)
 [hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.Commands.connect(Commands.java:1641) 
[hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.Commands.connect(Commands.java:1536) 
[hive-beeline-3.1.2.jar:3.1.2]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[?:1.8.0_191]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[?:1.8.0_191]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[?:1.8.0_191]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_191]
        at 
org.apache.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:56)
 [hive-beeline-3.1.2.jar:3.1.2]
        at 
org.apache.hive.beeline.BeeLine.execCommandWithPrefix(BeeLine.java:1384) 
[hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1423) 
[hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.BeeLine.connectUsingArgs(BeeLine.java:900) 
[hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.BeeLine.initArgs(BeeLine.java:795) 
[hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1048) 
[hive-beeline-3.1.2.jar:3.1.2]
        at 
org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:538) 
[hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.BeeLine.main(BeeLine.java:520) 
[hive-beeline-3.1.2.jar:3.1.2]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[?:1.8.0_191]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[?:1.8.0_191]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[?:1.8.0_191]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_191]
        at org.apache.hadoop.util.RunJar.run(RunJar.java:318) 
[hadoop-common-3.1.4.jar:?]
        at org.apache.hadoop.util.RunJar.main(RunJar.java:232) 
[hadoop-common-3.1.4.jar:?]
2022-04-06T17:28:04,335 WARN [main] org.apache.hive.jdbc.HiveConnection - 
Failed to connect to bigdata-hs111:10003
Could not open connection to the HS2 server. Please check the server URI and if 
the URI is correct, then ask the administrator to check the server status.
Error: Could not open client transport with JDBC Uri: 
jdbc:hive2://bigdata-hs111:10003: java.net.UnknownHostException: bigdata-hs111 
(state=08S01,code=0)
bi_etl@sh1-int-data /opt/project/DWD/SPD $ *echo $?*
*0*
bi_etl@sh1-int-data /opt/project/DWD/SPD $



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to