美文网首页
hive的几种连接方式

hive的几种连接方式

作者: wind_103 | 来源:发表于2020-12-11 22:30 被阅读0次

    hive在客户端除了直接执行hive命令连接外,还可以利用beeline连接,常用到的就是以下三种:

    1.beeline直接连接:

    beeline -u jdbc:hive2://192.168.188.100:10000 -n wind(用户名)

    2.beeline的参数化连接

    hiveserver2_url="jdbc:hive2://192.168.188.100:10000 -n wind(用户名)"

    beeline -u  ${hiveserver2_url} -f /home/hadoop/app/shell/hive/ --hivevar v_data=value;

    3.beeline的高可用性连接

    beeline -u "jdbc:hive2://192.168.188.100:2181,192.168.188.101:2181,192.168.188.102:2181,192.168.188.103:2181/;serviceDiscoveryMode=zookeeper;zookeeperNmaespace=hiveserver2  -n wind(用户名)"

    4.beeline的有权限的高可用连接

    beeline -u "jdbc:hive2://dn02.hadoop.cn:2181,dn01.hadoop.cn:2181,dn03.hadoop.cn:2181/devportaldemo;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;auth=kerberos;principal=hive/dn04.hadoop.cn@HADOOP.CN?mapreduce.job.queuename=0122a8ed-08e0-4945-acb7-d04f910b196c"

    相关文章

      网友评论

          本文标题:hive的几种连接方式

          本文链接:https://www.haomeiwen.com/subject/fybsgktx.html