Member since
05-15-2024
1
Post
0
Kudos Received
0
Solutions
08-07-2024
12:08 AM
At times in a CDH/CDP cluster, users may have multiple HS2 mapped under a load balancer to achieve high availability and user connection load balancing.
However, for scenarios like separating high-priority jobs, dedicated queue/HS2 requirement for a business unit, dedicated resource allocation, etc., users may have a dedicated HS2 in their cluster.
Below are two methods to create and connect to a dedicated Hive HS2 using ZooKeeper details:
Method 1: Connect using HS2 instance hostname/IP.
Add an instance with an HS2 role on it.
Ensure that this HS2 is not part of your load balancer, in case you want to keep it separate for certain jobs. But this is optional.
To connect to this dedicated HS2 use the below beeline command: beeline> !connect jdbc:hive2://<serverName>:10000/default;
Method 2: Connect using Zookeeper instance details.
Go to Hive_on Tez service > Instances. Add a new HS2 instance.
Click on the "Role Groups" option on the top right side of the instance list.
Click on "Create Role Group". Give name as "Dedicated HS2". Role type: "HiveServer2" and Copy From: "HiveServer2 Default Group".
Select "HiveServer2 Default Group" from the left side menu, select the dedicated HS2 host select "Move Selected Instances To Group" and choose "Dedicated HS2" role group.
After this on the instance page, you will see the dedicated HS2 host reflecting under the "Dedicated HS2" role group.
Now, on the instance page click on the "HiveServer2" hyperlink of your dedicated HS2. Click on Configurations.
Under Dedicated HS2 > Configurations > Advanced > HiveServer2 Advanced Configuration Snippet (Safety Valve) for hive-site.xml.
Add the below parameters and save it. Name: hive.server2.zookeeper.namespace
Value: dedicatedhs2
Restart the dedicated HS2 to apply the changes.
Now, to connect to this dedicated HS2 via beeline using Zookeeper details, you need to mention "zooKeeperNamespace=dedicatedhs2" in your beeline string instead of "zooKeeperNamespace=hiveserver2". Syntax example: beeline -u "jdbc:hive2://<Zk1>:2181,<Zk2>:2181,<Zk3>:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=dedicatedhs2"
DISCLAIMER: An external user contributed to this article. Cloudera may not verify that the steps may be applicable for all use cases and may be very specific to a particular distribution. Please follow with caution and at your own risk. If needed, raise a support case to get confirmation.
... View more
Labels: