ThriftServer

1、启动,[[email protected] sbin]$ ./start-thriftserver.sh

【大数据学习】之 ThriftServer

【大数据学习】之 ThriftServer

查看是否启动成功jps -m

【大数据学习】之 ThriftServer

查看UI界面

【大数据学习】之 ThriftServer

2、通过客户端beeline来连接

a、进入 /home/hadoop/app/spark-2.3.1-bin-2.6.0-cdh5.12.0/bin

b、[[email protected] bin]$ ./beeline -u jdbc:hive2://localhost:10000 -n hadoop

-n 是当前登录机器的用户名

【大数据学习】之 ThriftServer

c、查询一下(访问)hive表的数据

【大数据学习】之 ThriftServer

 

另:thriftserver vs Spark Application ,或两者之间的区别?

thriftserver是长服务,而Spark Application是例行的服务。用thriftserver只需启动时申请资源,无论启动多少个客户端(beeline),只要是连在一个thriftserver上,它都是一个spark application,后面不用在重新申请资源。能数据共享(上一个beeline做了缓存,下一个beeline能用)。而Spark Application是每次都要申请资源的。

相关文章: