注意:这不是教程!不是教程!不是教程
这只是我趟雷踩坑的记录。
启动Hadoop
start-dfs.sh start
启动Hiveserver2
hiveserver2 &
查看是否启动成功
netstat -anp |grep 10000
'''
[root@liuxch-TM1612 hadoop]# netstat -anp |grep 10000
tcp 0 0 127.0.0.1:36040 127.0.0.1:10000 ESTABLISHED 6141/java
tcp6 0 0 :::10000 :::* LISTEN 9674/java
tcp6 0 0 127.0.0.1:10000 127.0.0.1:36040 ESTABLISHED 9674/java
'''
beeline
启动
beeline> !connect jdbc hive2://localhost:10000/default
报错No known driver to handle “jdbc”
解决:
beeline -u jdbc:hive2://localhost:10000/db_hive_edu -n root -p
在命令中加入账号密码连接, 数据库改为我的数据库db_hive_edu;
(后来发现我是因为少打了一个冒号才报错)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html##multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html##multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://localhost:10000/db_hive_edu;user=root
Enter password for jdbc:hive2://localhost:10000/db_hive_edu: ****
Connected to: Apache Hive (version 3.1.1)
Driver: Hive JDBC (version 3.1.1)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 3.1.1 by Apache Hive
0: jdbc:hive2://localhost:10000/db_hive_edu>
成功启动
查看beeline使用手册
实践练习
-
退出beeline
0: jdbc:hive2://localhost:10000/db_hive_edu> !quit
使用beeline -r重新连接 beeline -r
[root@liuxch-TM1612 liuxch]# beeline -r
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Beeline version 3.1.1 by Apache Hive
beeline>
发现并没有重新连接到上一次的链接
原因是没有生成 URL
使用!connect生成URL
!connect jdbc:hive2://localhost:10000/db_hive_edu root root /usr/local/software/mysql-connector-java-8.0.17.jar
beeline> !connect jdbc:hive2://localhost:10000/db_hive_edu root root /usr/local/software/mysql-connector-java-8.0.17.jar
Connecting to jdbc:hive2://localhost:10000/db_hive_edu
/usr/local/software/mysql-connector-java-8.0.17.jar
0: jdbc:hive2://localhost:10000/db_hive_edu (closed)>
不知道为什么后面多了个(closed)
再次使用beeline -r
[root@liuxch-TM1612 liuxch]# beeline -r
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Beeline version 3.1.1 by Apache Hive
beeline>
还是没有重连成功
###再次使用!connect连接,这次不指定账号密码和jdbc
beeline> !connect jdbc:hive2://localhost:10000/db_hive_edu;
Connecting to jdbc:hive2://localhost:10000/db_hive_edu;
Enter username for jdbc:hive2://localhost:10000/db_hive_edu: root
Enter password for jdbc:hive2://localhost:10000/db_hive_edu: ****
Connected to: Apache Hive (version 3.1.1)
Driver: Hive JDBC (version 3.1.1)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://localhost:10000/db_hive_edu>
连接成功
使用!save保存配置信息
0: jdbc:hive2://localhost:10000/db_hive_edu> !save
Saving preferences to: /root/.beeline/beeline.properties
退出!exit
0: jdbc:hive2://localhost:10000/db_hive_edu> !exit
Closing: 0: jdbc:hive2://localhost:10000/db_hive_edu;
再再次使用beeline -r重连
[root@liuxch-TM1612 liuxch]# beeline -r
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://localhost:10000/db_hive_edu;
Connected to: Apache Hive (version 3.1.1)
Driver: Hive JDBC (version 3.1.1)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 3.1.1 by Apache Hive
0: jdbc:hive2://localhost:10000/db_hive_edu>
** 连接成功**
beeline -f执行脚本
在/home/liuxch/sugon/tmp路径创建文件hive_shell
添加内容:
!connect jdbc:hive2://localhost:10000/db_hive_edu;
root
root
desc score;
PS:我的数据库名称叫db_hive_edu 里面有一个表叫score,我的账号密码都是root
执行命令beeline -f hive_shell
[root@liuxch-TM1612 tmp]# beeline -f hive_shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
beeline> !connect jdbc:hive2://localhost:10000/db_hive_edu;
Connecting to jdbc:hive2://localhost:10000/db_hive_edu;
Enter username for jdbc:hive2://localhost:10000/db_hive_edu: root
Enter password for jdbc:hive2://localhost:10000/db_hive_edu: ****
Connected to: Apache Hive (version 3.1.1)
Driver: Hive JDBC (version 3.1.1)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://localhost:10000/db_hive_edu> desc score;
INFO : Compiling command(queryId=root_20190808134812_3a07ac9c-094e-45bc-a7fc-77419e60382a): desc score
INFO : Semantic Analysis Completed (retrial = false)
INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:col_name, type:string, comment:from deserializer), FieldSchema(name:data_type, type:string, comment:from deserializer), FieldSchema(name:comment, type:string, comment:from deserializer)], properties:null)
INFO : Completed compiling command(queryId=root_20190808134812_3a07ac9c-094e-45bc-a7fc-77419e60382a); Time taken: 0.634 seconds
INFO : Executing command(queryId=root_20190808134812_3a07ac9c-094e-45bc-a7fc-77419e60382a): desc score
INFO : Starting task [Stage-0:DDL] in serial mode
INFO : Completed executing command(queryId=root_20190808134812_3a07ac9c-094e-45bc-a7fc-77419e60382a); Time taken: 0.055 seconds
INFO : OK
+-----------+----------------+----------+
| col_name | data_type | comment |
+-----------+----------------+----------+
| sno | int | |
| cno | int | |
| degree | decimal(10,1) | |
+-----------+----------------+----------+
3 rows selected (1.023 seconds)
0: jdbc:hive2://localhost:10000/db_hive_edu>
0: jdbc:hive2://localhost:10000/db_hive_edu> Closing: 0: jdbc:hive2://localhost:10000/db_hive_edu;
[root@liuxch-TM1612 tmp]#
可以看到脚本成功运行
使用URL名字建立连接
从Hive 2.1.0 (HIVE-13670)起, Beeline 现在也支持通过环境变量命名的URL连接字符串。如果你尝试对一个看起来不像URL的名字执行 !connect , 那么Beeline将会尝试查看是否有一个环境变量叫BEELINE_URL_。例如,如果你指定 !connect blue, 它将会查找BEELINE_URL_BLUE然后用它来建立连接。这样听起来更加方便系统管理员为用户指定环境变量,用户也不需要每次连接都键入全部URL。
在/etc/profile文件中添加环境变量BEELINE_URL_EDU=jdbc:hive2://localhost:10000/db_hive_edu
'''
[root@liuxch-TM1612 tmp]# vim /etc/profile
[root@liuxch-TM1612 tmp]# source /etc/profile
'''
在/home/liuxch/sugon/tmp目录下创建文件hive_shell_url
添加内容:
!connect edu;
root
root
执行命令:beeline -f /home/liuxch/sugon/tmp/hive_shell_url
[root@liuxch-TM1612 tmp]# beeline -f /home/liuxch/sugon/tmp/hive_shell_url
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
beeline> !connect edu;
scan complete in 4ms
scan complete in 3ms
No known driver to handle "edu;"
报错找不到jdbc,推测原因是找不到环境变量edu。
编辑hive-env.sh(我也不知道这几个字为什么变色了)
[root@liuxch-TM1612 tmp]# vim /usr/local/software/apache-hive-3.1.1-bin/conf/hive-env.sh
[root@liuxch-TM1612 tmp]# source /usr/local/software/apache-hive-3.1.1-bin/conf/hive-env.sh
添加代码:
export BEELINE_URL_EDU=jdbc:hive2://localhost:10000/db_hive_edu
PS:我的hive安装位置是/usr/local/software/
完成之后再次执行beeline -f /home/liuxch/sugon/tmp/hive_shell_url
‘’’
运行结果和上次一样。。。还是报错
把环境变量改成jdbc:hive2://localhost:10000/db_hive_edu\ root\ root\ /usr/local/software/mysql-connector-java-8.0.17.jar
再次执行 beeline -f /home/liuxch/sugon/tmp/hive_shell_url
还是报错
。。。。。。。(官方,你个大骗子)
使用配置文件自动连接hiveserver2
使用hive-site.xml 自动连接HiveServer2
从Hive 2.2.0 (HIVE-14063)起, BeeLine 增加了对使用存放在安装路径中的hive-site.xml生成一个基于hive配置文件和用户额外配置文件的连接URL。不是所有的URL配置都能够从hive-site.xml中得到,因此为了更好的使用这个特性,用户需要创建一个Hadoop xml格式的配置文件“beeline-hs2-connection.xml”。这个文件用来提供用户指定好的连接参数。BeeLine 会在${user.home}/.beeline/ (Unix based OS) 或者 KaTeX parse error: Expected 'EOF', got '\beeline' at position 12: {user.home}\̲b̲e̲e̲l̲i̲n̲e̲\ (Windows环境)目录…{HIVE_CONF_DIR} 和 /etc/hive/conf (Check HIVE-16335 which fixes this location from /etc/conf/hive in Hive 2.2.0) 这个顺序查找该文件。一旦文件被找到,Beeline 会结合beeline-hs2-connection.xml 和路径中hive-site.xml来决定 连接URL。
beeline-hs2-connection.xml中的连接属性必须有前缀“beeline.hs2.connection.”后面是url的属性名称。例如:为了提供属性ssl,beeline-hs2-connection.xml中的属性关键字应该是“beeline.hs2.connection.ssl”。 下方beeline.hs2.connection.xml的样例提供了Beeline连接URL的用户名和密码的值。在这个案例中剩下的例如HS2主机名和端口信息,kerberos配置属性,SSL属性,传输模式等会从路径里的hive-site.xml文件中获取。如果密码是空,beeline.hs2.connection.password 应该被删掉。在大部分案例中下面beeline-hs2-connection.xml的配置值 和路径中正确的hive-site.xml应该准备好来保证HiveServer2的连接
+先创建文件beeline-hs2-connection.xml
根据官方描述文件应该在这{user.home}/.beeline/
[root@liuxch-TM1612 .beeline]# cd ~/.beeline/
[root@liuxch-TM1612 .beeline]# ls
beeline.properties history
[root@liuxch-TM1612 .beeline]# touch beeline-hs2-connection.xml
[root@liuxch-TM1612 .beeline]# vim beeline-hs2-connection.xml
[root@liuxch-TM1612 .beeline]#
文件内容:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>beeline.hs2.connection.url</name>
<value>jdbc:hive2://localhost:10000/db_hive_edu</value>
</property>
<property>
<name>beeline.hs2.connection.user</name>
<value>root</value>
</property>
<property>
<name>beeline.hs2.connection.password</name>
<value>root</value>
</property>
</configuration>
测试一下
[root@liuxch-TM1612 .beeline]# beeline
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://localhost:10000/default;password=root;url=jdbc:hive2://localhost:10000/db_hive_edu;user=root
Connected to: Apache Hive (version 3.1.1)
Driver: Hive JDBC (version 3.1.1)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 3.1.1 by Apache Hive
0: jdbc:hive2://localhost:10000/default>
从结果可以看出连接成功了,但是连的数据库是default。
从倒数第六行可以看到,连接的参数。url居然成了 default数据库的一个参数。
看一下官方给出的配置文件模板:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>beeline.hs2.connection.user</name>
<value>hive</value>
</property>
<property>
<name>beeline.hs2.connection.password</name>
<value>hive</value>
</property>
</configuration>
并不能配置URL
所以我们更改配置文件为:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>beeline.hs2.connection.user</name>
<value>root</value>
</property>
<property>
<name>beeline.hs2.connection.password</name>
<value>root</value>
</property>
</configuration>
然后通过命令指定URL:
[root@liuxch-TM1612 .beeline]# beeline jdbc:hive2://localhost:10000/db_hive_edu
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://localhost:10000/default;password=root;user=root
Connected to: Apache Hive (version 3.1.1)
Driver: Hive JDBC (version 3.1.1)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 3.1.1 by Apache Hive
0: jdbc:hive2://localhost:10000/default>
???
咋又给我连default上去了
看官方文档
当beeline-hs2-connection.xml 已经存在同时没有其他参数被提供,Beeline自动连接由配置文件生成的URL。当连接参数(-u, -n or -p)被提供,Beeline将使用它们而不是用beeline-hs2-connection.xml中的值来建立连接。去除或者重命名beeline-hs2-connection.xml禁用这个特性。
所以我打算指定这三个参数,其中-u表示指定URL,-n表示指定username, -p表示password
这里我们就指定URL试试看
[root@liuxch-TM1612 .beeline]# beeline -u jdbc:hive2://localhost:10000/db_hive_edu
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/software/apache-hive-3.1.1-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/software/hadoop-3.1.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://localhost:10000/db_hive_edu
Connected to: Apache Hive (version 3.1.1)
Driver: Hive JDBC (version 3.1.1)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 3.1.1 by Apache Hive
0: jdbc:hive2://localhost:10000/db_hive_edu>
成功!
使用了我们指定的URL和配置文件指定的账号密码登录
使用JDBC
明天再写