[jira] [Updated] (HIVE-25096) beeline can't get the correct hiveserver2 using the zoopkeeper with serviceDiscoveryMode=zooKeeper.
[ https://issues.apache.org/jira/browse/HIVE-25096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] hezhang updated HIVE-25096: --- Fix Version/s: (was: 3.1.2) > beeline can't get the correct hiveserver2 using the zoopkeeper with > serviceDiscoveryMode=zooKeeper. > --- > > Key: HIVE-25096 > URL: https://issues.apache.org/jira/browse/HIVE-25096 > Project: Hive > Issue Type: Bug > Components: Beeline >Affects Versions: 3.1.2 > Environment: centos7.4 > x86_64 >Reporter: xiaozhongcheng >Assignee: hezhang >Priority: Major > Attachments: HIVE-25096.patch > > > beeline can't get the correct hiveserver2 using the zoopkeeper with > serviceDiscoveryMode=zooKeeper. > > {code:java} > // code placeholder > [root@vhost-120-28 hive]# beeline -u > "jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2" > --verbose=true > SLF4J: Class path contains multiple SLF4J bindings. > SLF4J: Found binding in > [jar:file:/usr/wdp/1.0/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] > SLF4J: Found binding in > [jar:file:/usr/wdp/1.0/hadoop/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] > !connect > jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 > '' [passwd stripped] > Connecting to > jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 > Error: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read > HiveServer2 configs from ZooKeeper (state=,code=0) > java.sql.SQLException: org.apache.hive.jdbc.ZooKeeperHiveClientException: > Unable to read HiveServer2 configs from ZooKeeper > at org.apache.hive.jdbc.HiveConnection.(HiveConnection.java:170) > at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) > at java.sql.DriverManager.getConnection(DriverManager.java:664) > at java.sql.DriverManager.getConnection(DriverManager.java:208) > at > org.apache.hive.beeline.DatabaseConnection.connect(DatabaseConnection.java:145) > at > org.apache.hive.beeline.DatabaseConnection.getConnection(DatabaseConnection.java:209) > at org.apache.hive.beeline.Commands.connect(Commands.java:1641) > at org.apache.hive.beeline.Commands.connect(Commands.java:1536) > 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.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:56) > at > org.apache.hive.beeline.BeeLine.execCommandWithPrefix(BeeLine.java:1384) > at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1423) > at org.apache.hive.beeline.BeeLine.connectUsingArgs(BeeLine.java:900) > at org.apache.hive.beeline.BeeLine.initArgs(BeeLine.java:795) > at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1048) > at > org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:538) > at org.apache.hive.beeline.BeeLine.main(BeeLine.java:520) > 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: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read > HiveServer2 configs from ZooKeeper > at > org.apache.hive.jdbc.ZooKeeperHiveClientHelper.configureConnParams(ZooKeeperHiveClientHelper.java:147) > at > org.apache.hive.jdbc.Utils.configureConnParamsFromZooKeeper(Utils.java:511) > at org.apache.hive.jdbc.Utils.parseURL(Utils.java:334) > at org.apache.hive.jdbc.HiveConnection.(HiveConnection.java:168) > ... 25 more > {code} > > You know, HiveServer2#startPrivilegeSynchronizer will create the namespace > of /hiveserver2/leader in the zookeeper, > however, if you want to connect to the hiveserver2
[jira] [Updated] (HIVE-25096) beeline can't get the correct hiveserver2 using the zoopkeeper with serviceDiscoveryMode=zooKeeper.
[ https://issues.apache.org/jira/browse/HIVE-25096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] hezhang updated HIVE-25096: --- Fix Version/s: 3.1.2 > beeline can't get the correct hiveserver2 using the zoopkeeper with > serviceDiscoveryMode=zooKeeper. > --- > > Key: HIVE-25096 > URL: https://issues.apache.org/jira/browse/HIVE-25096 > Project: Hive > Issue Type: Bug > Components: Beeline >Affects Versions: 3.1.2 > Environment: centos7.4 > x86_64 >Reporter: xiaozhongcheng >Assignee: hezhang >Priority: Major > Fix For: 3.1.2 > > Attachments: HIVE-25096.patch > > > beeline can't get the correct hiveserver2 using the zoopkeeper with > serviceDiscoveryMode=zooKeeper. > > {code:java} > // code placeholder > [root@vhost-120-28 hive]# beeline -u > "jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2" > --verbose=true > SLF4J: Class path contains multiple SLF4J bindings. > SLF4J: Found binding in > [jar:file:/usr/wdp/1.0/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] > SLF4J: Found binding in > [jar:file:/usr/wdp/1.0/hadoop/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] > !connect > jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 > '' [passwd stripped] > Connecting to > jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 > Error: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read > HiveServer2 configs from ZooKeeper (state=,code=0) > java.sql.SQLException: org.apache.hive.jdbc.ZooKeeperHiveClientException: > Unable to read HiveServer2 configs from ZooKeeper > at org.apache.hive.jdbc.HiveConnection.(HiveConnection.java:170) > at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) > at java.sql.DriverManager.getConnection(DriverManager.java:664) > at java.sql.DriverManager.getConnection(DriverManager.java:208) > at > org.apache.hive.beeline.DatabaseConnection.connect(DatabaseConnection.java:145) > at > org.apache.hive.beeline.DatabaseConnection.getConnection(DatabaseConnection.java:209) > at org.apache.hive.beeline.Commands.connect(Commands.java:1641) > at org.apache.hive.beeline.Commands.connect(Commands.java:1536) > 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.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:56) > at > org.apache.hive.beeline.BeeLine.execCommandWithPrefix(BeeLine.java:1384) > at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1423) > at org.apache.hive.beeline.BeeLine.connectUsingArgs(BeeLine.java:900) > at org.apache.hive.beeline.BeeLine.initArgs(BeeLine.java:795) > at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1048) > at > org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:538) > at org.apache.hive.beeline.BeeLine.main(BeeLine.java:520) > 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: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read > HiveServer2 configs from ZooKeeper > at > org.apache.hive.jdbc.ZooKeeperHiveClientHelper.configureConnParams(ZooKeeperHiveClientHelper.java:147) > at > org.apache.hive.jdbc.Utils.configureConnParamsFromZooKeeper(Utils.java:511) > at org.apache.hive.jdbc.Utils.parseURL(Utils.java:334) > at org.apache.hive.jdbc.HiveConnection.(HiveConnection.java:168) > ... 25 more > {code} > > You know, HiveServer2#startPrivilegeSynchronizer will create the namespace > of /hiveserver2/leader in the zookeeper, > however, if you want to connect to
[jira] [Updated] (HIVE-25096) beeline can't get the correct hiveserver2 using the zoopkeeper with serviceDiscoveryMode=zooKeeper.
[ https://issues.apache.org/jira/browse/HIVE-25096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stamatis Zampetakis updated HIVE-25096: --- Fix Version/s: (was: 4.0.0) I cleared the fixVersion field since this ticket is still open. Please review this ticket and if the fix is already committed to a specific version please set the version accordingly and mark the ticket as RESOLVED. According to the [JIRA guidelines|https://cwiki.apache.org/confluence/display/Hive/HowToContribute] the fixVersion should be set only when the issue is resolved/closed. > beeline can't get the correct hiveserver2 using the zoopkeeper with > serviceDiscoveryMode=zooKeeper. > --- > > Key: HIVE-25096 > URL: https://issues.apache.org/jira/browse/HIVE-25096 > Project: Hive > Issue Type: Bug > Components: Beeline >Affects Versions: 3.1.2 > Environment: centos7.4 > x86_64 >Reporter: xiaozhongcheng >Assignee: hezhang >Priority: Major > Attachments: HIVE-25096.patch > > > beeline can't get the correct hiveserver2 using the zoopkeeper with > serviceDiscoveryMode=zooKeeper. > > {code:java} > // code placeholder > [root@vhost-120-28 hive]# beeline -u > "jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2" > --verbose=true > SLF4J: Class path contains multiple SLF4J bindings. > SLF4J: Found binding in > [jar:file:/usr/wdp/1.0/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] > SLF4J: Found binding in > [jar:file:/usr/wdp/1.0/hadoop/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] > !connect > jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 > '' [passwd stripped] > Connecting to > jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 > Error: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read > HiveServer2 configs from ZooKeeper (state=,code=0) > java.sql.SQLException: org.apache.hive.jdbc.ZooKeeperHiveClientException: > Unable to read HiveServer2 configs from ZooKeeper > at org.apache.hive.jdbc.HiveConnection.(HiveConnection.java:170) > at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) > at java.sql.DriverManager.getConnection(DriverManager.java:664) > at java.sql.DriverManager.getConnection(DriverManager.java:208) > at > org.apache.hive.beeline.DatabaseConnection.connect(DatabaseConnection.java:145) > at > org.apache.hive.beeline.DatabaseConnection.getConnection(DatabaseConnection.java:209) > at org.apache.hive.beeline.Commands.connect(Commands.java:1641) > at org.apache.hive.beeline.Commands.connect(Commands.java:1536) > 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.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:56) > at > org.apache.hive.beeline.BeeLine.execCommandWithPrefix(BeeLine.java:1384) > at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1423) > at org.apache.hive.beeline.BeeLine.connectUsingArgs(BeeLine.java:900) > at org.apache.hive.beeline.BeeLine.initArgs(BeeLine.java:795) > at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1048) > at > org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:538) > at org.apache.hive.beeline.BeeLine.main(BeeLine.java:520) > 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: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read > HiveServer2 configs from ZooKeeper > at > org.apache.hive.jdbc.ZooKeeperHiveClientHelper.configureConnParams(ZooKeeperHiveClientHelper.java:147) > at >
[jira] [Updated] (HIVE-25096) beeline can't get the correct hiveserver2 using the zoopkeeper with serviceDiscoveryMode=zooKeeper.
[ https://issues.apache.org/jira/browse/HIVE-25096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] hezhang updated HIVE-25096: --- Attachment: HIVE-25096.patch > beeline can't get the correct hiveserver2 using the zoopkeeper with > serviceDiscoveryMode=zooKeeper. > --- > > Key: HIVE-25096 > URL: https://issues.apache.org/jira/browse/HIVE-25096 > Project: Hive > Issue Type: Bug > Components: Beeline >Affects Versions: 3.1.2 > Environment: centos7.4 > x86_64 >Reporter: xiaozhongcheng >Assignee: hezhang >Priority: Major > Fix For: 4.0.0 > > Attachments: HIVE-25096.patch > > > beeline can't get the correct hiveserver2 using the zoopkeeper with > serviceDiscoveryMode=zooKeeper. > > {code:java} > // code placeholder > [root@vhost-120-28 hive]# beeline -u > "jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2" > --verbose=true > SLF4J: Class path contains multiple SLF4J bindings. > SLF4J: Found binding in > [jar:file:/usr/wdp/1.0/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] > SLF4J: Found binding in > [jar:file:/usr/wdp/1.0/hadoop/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] > !connect > jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 > '' [passwd stripped] > Connecting to > jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 > Error: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read > HiveServer2 configs from ZooKeeper (state=,code=0) > java.sql.SQLException: org.apache.hive.jdbc.ZooKeeperHiveClientException: > Unable to read HiveServer2 configs from ZooKeeper > at org.apache.hive.jdbc.HiveConnection.(HiveConnection.java:170) > at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) > at java.sql.DriverManager.getConnection(DriverManager.java:664) > at java.sql.DriverManager.getConnection(DriverManager.java:208) > at > org.apache.hive.beeline.DatabaseConnection.connect(DatabaseConnection.java:145) > at > org.apache.hive.beeline.DatabaseConnection.getConnection(DatabaseConnection.java:209) > at org.apache.hive.beeline.Commands.connect(Commands.java:1641) > at org.apache.hive.beeline.Commands.connect(Commands.java:1536) > 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.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:56) > at > org.apache.hive.beeline.BeeLine.execCommandWithPrefix(BeeLine.java:1384) > at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1423) > at org.apache.hive.beeline.BeeLine.connectUsingArgs(BeeLine.java:900) > at org.apache.hive.beeline.BeeLine.initArgs(BeeLine.java:795) > at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1048) > at > org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:538) > at org.apache.hive.beeline.BeeLine.main(BeeLine.java:520) > 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: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read > HiveServer2 configs from ZooKeeper > at > org.apache.hive.jdbc.ZooKeeperHiveClientHelper.configureConnParams(ZooKeeperHiveClientHelper.java:147) > at > org.apache.hive.jdbc.Utils.configureConnParamsFromZooKeeper(Utils.java:511) > at org.apache.hive.jdbc.Utils.parseURL(Utils.java:334) > at org.apache.hive.jdbc.HiveConnection.(HiveConnection.java:168) > ... 25 more > {code} > > You know, HiveServer2#startPrivilegeSynchronizer will create the namespace > of /hiveserver2/leader in the zookeeper, > however, if you want to
[jira] [Updated] (HIVE-25096) beeline can't get the correct hiveserver2 using the zoopkeeper with serviceDiscoveryMode=zooKeeper.
[ https://issues.apache.org/jira/browse/HIVE-25096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] xiaozhongcheng updated HIVE-25096: -- Description: beeline can't get the correct hiveserver2 using the zoopkeeper with serviceDiscoveryMode=zooKeeper. {code:java} // code placeholder [root@vhost-120-28 hive]# beeline -u "jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2" --verbose=true SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/wdp/1.0/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/wdp/1.0/hadoop/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] !connect jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 '' [passwd stripped] Connecting to jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 Error: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read HiveServer2 configs from ZooKeeper (state=,code=0) java.sql.SQLException: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read HiveServer2 configs from ZooKeeper at org.apache.hive.jdbc.HiveConnection.(HiveConnection.java:170) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:208) at org.apache.hive.beeline.DatabaseConnection.connect(DatabaseConnection.java:145) at org.apache.hive.beeline.DatabaseConnection.getConnection(DatabaseConnection.java:209) at org.apache.hive.beeline.Commands.connect(Commands.java:1641) at org.apache.hive.beeline.Commands.connect(Commands.java:1536) 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.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:56) at org.apache.hive.beeline.BeeLine.execCommandWithPrefix(BeeLine.java:1384) at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1423) at org.apache.hive.beeline.BeeLine.connectUsingArgs(BeeLine.java:900) at org.apache.hive.beeline.BeeLine.initArgs(BeeLine.java:795) at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1048) at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:538) at org.apache.hive.beeline.BeeLine.main(BeeLine.java:520) 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: org.apache.hive.jdbc.ZooKeeperHiveClientException: Unable to read HiveServer2 configs from ZooKeeper at org.apache.hive.jdbc.ZooKeeperHiveClientHelper.configureConnParams(ZooKeeperHiveClientHelper.java:147) at org.apache.hive.jdbc.Utils.configureConnParamsFromZooKeeper(Utils.java:511) at org.apache.hive.jdbc.Utils.parseURL(Utils.java:334) at org.apache.hive.jdbc.HiveConnection.(HiveConnection.java:168) ... 25 more {code} You know, HiveServer2#startPrivilegeSynchronizer will create the namespace of /hiveserver2/leader in the zookeeper, however, if you want to connect to the hiveserver2 using beeline with the command like "jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2", the beeline will randomly chose the sub-namespace under /hiveserver2. That arises a problem that the beeline will not find the hiveserver2 information in the namespace of /hiveserver2/leader, it's impossible to detect the hiveserver2 connection information. That's to say, the sub-namespace of /hiveserver2 is like this: [zk: vhost-120-28:2181,vhost-120-27:2181,vhost-120-26:2181(CONNECTED) 1] ls /hiveserver2 [leader, serverUri=vhost-120-26:1;version=3.1.2;sequence=10, serverUri=vhost-120-28:1;version=3.1.2;sequence=11] Codes list bellow show
[jira] [Updated] (HIVE-25096) beeline can't get the correct hiveserver2 using the zoopkeeper with serviceDiscoveryMode=zooKeeper.
[ https://issues.apache.org/jira/browse/HIVE-25096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] xiaozhongcheng updated HIVE-25096: -- Description: beeline can't get the correct hiveserver2 using the zoopkeeper with serviceDiscoveryMode=zooKeeper. You know, HiveServer2#startPrivilegeSynchronizer will create the namespace of /hiveserver2/leader in the zookeeper, however, if you want to connect to the hiveserver2 using beeline with the command like "jdbc:hive2://vhost-120-26:2181,vhost-120-27:2181,vhost-120-28:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2", the beeline will randomly chose the sub-namespace under /hiveserver2. That arises a problem that the beeline will not find the hiveserver2 information in the namespace of /hiveserver2/leader, it's impossible to detect the hiveserver2 connection information. That's to say, the sub-namespace of /hiveserver2 is like this: [zk: vhost-120-28:2181,vhost-120-27:2181,vhost-120-26:2181(CONNECTED) 1] ls /hiveserver2 [leader, serverUri=vhost-120-26:1;version=3.1.2;sequence=10, serverUri=vhost-120-28:1;version=3.1.2;sequence=11] Codes list bellow show {color:#22}HiveServer2#startPrivilegeSynchronizer and beeline how to connect the hiveserver2.{color} {color:#22}HiveServer2#startPrivilegeSynchronizer:{color} {color:#22} public void startPrivilegeSynchronizer(HiveConf hiveConf) throws Exception {{color} {color:#22} {color} {color:#22} if (!HiveConf.getBoolVar(hiveConf, ConfVars.HIVE_PRIVILEGE_SYNCHRONIZER)) {{color} {color:#22} return;{color} {color:#22} }{color} {color:#22} PolicyProviderContainer policyContainer = new PolicyProviderContainer();{color} {color:#22} HiveAuthorizer authorizer = SessionState.get().getAuthorizerV2();{color} {color:#22} if (authorizer.getHivePolicyProvider() != null) {{color} {color:#22} policyContainer.addAuthorizer(authorizer);{color} {color:#22} }{color} {color:#22} if (MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.PRE_EVENT_LISTENERS) != null &&{color} {color:#22} MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.PRE_EVENT_LISTENERS).contains({color} {color:#22} "org.apache.hadoop.hive.ql.security.authorization.AuthorizationPreEventListener") &&{color} {color:#22} MetastoreConf.getVar(hiveConf, MetastoreConf.ConfVars.HIVE_AUTHORIZATION_MANAGER)!= null) {{color} {color:#22} List providers = HiveUtils.getMetaStoreAuthorizeProviderManagers({color} {color:#22} hiveConf, HiveConf.ConfVars.HIVE_METASTORE_AUTHORIZATION_MANAGER, SessionState.get().getAuthenticator());{color} {color:#22} for (HiveMetastoreAuthorizationProvider provider : providers) {{color} {color:#22} if (provider.getHivePolicyProvider() != null) {{color} {color:#22} policyContainer.addAuthorizationProvider(provider);{color} {color:#22} }{color} {color:#22} }{color} {color:#22} }{color} {color:#22} {color} {color:#22} if (policyContainer.size() > 0) {{color} {color:#22} setUpZooKeeperAuth(hiveConf);{color} {color:#22} zKClientForPrivSync = hiveConf.getZKConfig().startZookeeperClient(zooKeeperAclProvider, true);{color} {color:#22} String rootNamespace = hiveConf.getVar(HiveConf.ConfVars.HIVE_SERVER2_ZOOKEEPER_NAMESPACE);{color} {color:#172b4d} *String path = ZooKeeperHiveHelper.ZOOKEEPER_PATH_SEPARATOR + rootNamespace*{color} *{color:#172b4d} + ZooKeeperHiveHelper.ZOOKEEPER_PATH_SEPARATOR + "leader";{color}* {color:#22} LeaderLatch privilegeSynchronizerLatch = new LeaderLatch(zKClientForPrivSync, path);{color} {color:#22} privilegeSynchronizerLatch.start();{color} {color:#22} LOG.info("Find " + policyContainer.size() + " policy to synchronize, start PrivilegeSynchronizer");{color} {color:#22} Thread privilegeSynchronizerThread = new Thread({color} {color:#22} new PrivilegeSynchronizer(privilegeSynchronizerLatch, policyContainer, hiveConf), "PrivilegeSynchronizer");{color} {color:#22} privilegeSynchronizerThread.setDaemon(true);{color} {color:#22} privilegeSynchronizerThread.start();{color} {color:#22} } else {{color} {color:#22} LOG.warn({color} {color:#22} "No policy provider found, skip creating PrivilegeSynchronizer");{color} {color:#22} }{color} {color:#22} }{color} {color:#22}ZooKeeperHiveClientHelper#configureConnParams{color} {color:#22} static void configureConnParams(JdbcConnectionParams connParams) throws ZooKeeperHiveClientException {{color} {color:#22} if (isZkHADynamicDiscoveryMode(connParams.getSessionVars())) {{color} {color:#22}