[ 
https://issues.apache.org/jira/browse/HIVE-28423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17870213#comment-17870213
 ] 

Qiheng He commented on HIVE-28423:
----------------------------------

- [~zabetak] To be honest, I have never used Confluence directly, so I assume 
it does not have a PR area for change review like 
[https://github.com/apache/shardingsphere/pull/31934] . It looks like neither 
Jira nor Confluence's editors support using markdown.
 - I do have an ASF Confluence account at 
[https://cwiki.apache.org/confluence/display/~linghengqian] , which is tied to 
my apache id, which is *linghengq...@apache.org* .
 - I also noticed that HIVE-8376 was not closed, and I don't know if the 
current issue is one of the tasks of HIVE-8376 .
 - I'll make a post explaining the changes I want to make to confirm your 
opinion.

 - 
[https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-HiveServer2]
 should be added as follows.

{code:bash}
hive.server2.support.dynamic.service.discovery

- Default Value: false
- Added In: Hive 0.14.0 with HIVE-7935

Whether HiveServer2 supports dynamic service discovery for its clients. To 
support this, each instance of HiveServer2 currently uses ZooKeeper to register 
itself, when it is brought up. JDBC/ODBC clients should use the ZooKeeper 
ensemble:  hive.zookeeper.quorum in their connection string.
{code}
 - Then for the following from 
[https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-ConnectionURLWhenZooKeeperServiceDiscoveryIsEnabled]
 ,

{code:bash}
A JDBC URL that specifies <zookeeper quorum> needs to be used to make use of 
these features.
{code}
 - Change to,

{code:bash}
A JDBC URL that specifies <zookeeper quorum> needs to be used to make use of 
these features. That is, at least in `hive-site.xml` or other configuration 
files for HiveServer2, `hive.server2.support.dynamic.service.discovery` should 
be set to `true`, and `hive.zookeeper.quorum` should be defined to point to 
several started Zookeeper Servers. Reference 
https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties .

The minimal configuration example is as follows.

```
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <property>
        <name>hive.server2.support.dynamic.service.discovery</name>
        <value>true</value>
    </property>
    <property>
        <name>hive.zookeeper.quorum</name>
        <value>127.0.0.1:2181</value>
    </property>
</configuration>
```
{code}

> The doc for enabling ZooKeeper Service Discovery on HiveServer2 is missing 
> the requirement statement for `hive.server2.support.dynamic.service.discovery`
> ---------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-28423
>                 URL: https://issues.apache.org/jira/browse/HIVE-28423
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Qiheng He
>            Priority: Major
>
> - The doc for enabling ZooKeeper Service Discovery on HiveServer2 is missing 
> the requirement statement for 
> *hive.server2.support.dynamic.service.discovery*. This is a documentation 
> issue I noticed at [https://github.com/dbeaver/dbeaver/issues/22777] , where 
> dbeaver contributors spent 6 months trying to figure out how to start 
> ZooKeeper Service Discovery on HiveServer2.
> - 
> https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-ConnectionURLWhenZooKeeperServiceDiscoveryIsEnabled
>  describes ZooKeeper Service Discovery like this.
> {code:bash}
> ZooKeeper-based service discovery introduced in Hive 0.14.0 (HIVE-7935) 
> enables high availability and rolling upgrade for HiveServer2. A JDBC URL 
> that specifies <zookeeper quorum> needs to be used to make use of these 
> features.
> With further changes in Hive 2.0.0 and 1.3.0 (unreleased, HIVE-11581), none 
> of the additional configuration parameters such as authentication mode, 
> transport mode, or SSL parameters need to be specified, as they are retrieved 
> from the ZooKeeper entries along with the hostname.
> The JDBC connection URL: jdbc:hive2://<zookeeper 
> quorum>/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2 .
> The <zookeeper quorum> is the same as the value of hive.zookeeper.quorum 
> configuration parameter in hive-site.xml/hivserver2-site.xml used by 
> HiveServer2.
> {code}
> - I did a test at https://github.com/linghengqian/hivesever2-v400-sd-test to 
> verify that setting *hive.zookeeper.quorum* only on HiveServer2 was not 
> enough. I found the *hive.server2.support.dynamic.service.discovery* property 
> defined in the *org.apache.hadoop.hive.conf.HiveConf* class in a 
> stackoverflow discussion. 
> - To verify this git, just execute the following shell. Related unit tests 
> occupy *2181*, *10000*, *10002* ports to start Docker Container.
> {code:bash}
> sdk install java 22.0.2-graalce
> sdk use java 22.0.2-graalce
> git clone g...@github.com:linghengqian/hivesever2-v400-sd-test.git
> cd ./hivesever2-v400-sd-test/
> docker compose -f ./docker-compose-lingh.yml pull
> docker compose -f ./docker-compose-lingh.yml up -d
> # ... Wait five seconds for HiveServer2 to finish initializing.
> ./mvnw clean test
> docker compose -f ./docker-compose-lingh.yml down
> {code}
> - I also searched for the keyword 
> *hive.server2.support.dynamic.service.discovery* in https://cwiki.apache.org/ 
> , but I could only find this property in the documentation page of the KNOX 
> project 
> https://cwiki.apache.org/confluence/display/KNOX/Dynamic+HA+Provider+Configuration
>  , which doesn't make sense from my perspective.
> - From my perspective, it is reasonable to add the description of 
> *hive.server2.support.dynamic.service.discovery* properties to the 
> documentation of apache/hive:4.0.0.



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

Reply via email to