Java Connection Hive use of Zookeeper

  Java connection Hive way is connected by way of JDBC, URL is jdbc: hive2: // host: port / db; [email protected], etc., in this way is directly connected HiveServer2 services, but in reality , there is a way to connect to Zookeeper, for example:

jdbc:hive2://zk01:2181,zk02:2181,zk03:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2

So, what is the principle in this way?

  

  In actual production, there may be multiple HiveServer2 services, they also provide services, if one hang up, the other can continue to work. So, in order to achieve this characteristic of HA, HA-based HiveServer2 provide a Zookeeper deploy solutions that serve multiple HiveServer2 registered to a directory under the Zookeeper, Java JDBC registered by reading the following Zookeeper in this catalog HiveServer2 examples, to select one of them to connect and access. Please refer to the specific deployment information, will not be described here.

  Another way is to be achieved HA load balancing or the like HAProxy Ngix software, hardware may be used F5.

 

  Hereby record.

Guess you like

Origin www.cnblogs.com/flowerbirds/p/11256515.html