Configure proxy for HiveServer2

Let us see how we can configure a proxy for HiveServer2.

  • We have seen how to launch Hive CLI and run the commands. However, we need to use JDBC to connect to Hive with respect to tools like Tableau so that we can generate reports.
  • As part of the cluster, we get a tool called beeline using which we can validate connecting to Hive Server via JDBC. beeline -u jdbc:hive2://bigdataserver-4:10000 -n itversity
  • As of now, Hive Server is running on bigdataserver-4. We can add bigdataserver-3 using Cloudera Manager.
  • Configuring HA
    • Servers – bigdataserver-3 and bigdataserver-4
    • Proxy Server – bigdataserver-1
    • Proxy Port – 10001
    • Port Number – 10000
    • Update haproxy.cfg file

https://gist.github.com/dgadiraju/df639040f8eaf11f4e89dd9ad5cd6607

  • Restart the service – sudo /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg
  • Validate by using beeline and connecting to hiveserver using bigdataserver-1 as a proxy.
  • Sample Command – beeline -u jdbc:hive2://bigdataserver-1:10001 -n itversity

Share this post