使用dataGrip连接spark

概述:

spark的配置共有5种

1、本地模式

2、集群模式:standalone, yarn,k8s,mesos四种集群模式

spark本身只是一个计算引擎,是没有数据库的,所以说数据需要在hdfs上存放,而数据库就是使用hive,都已经启动hdfs了,就使用yarn模式即可,而使用standalone模式就不合适了。

因此以下的配置是基于hdfs+yarn+spark进行配置的。

一、配置

要想spark知道hive中所有的数据库,那么就需要将spark和metastore服务联系起来

1、在hive下的hive-site.xml中添加

<property>
		<name>hive.metastore.schema.verification</name>
		<value>false</value>
	</property>

2、将hive的该文件复制到spark的conf下

cp /opt/installs/hive/conf/hive-site.xml /opt/installs/spark/conf

3、分发一下spark中的该文件

xsync.sh opt/installs/spark/conf/hive-site.xml

二、启动

1、启动hadoop
2、启动metastore
3、启动Spark Thrift Server

启动ThriftServer:若已经启动过hiveserver2 那么记得将端口号改为10001

opt/installs/spark/sbin/start-thriftserver.sh \
--hiveconf hive.server2.thrift.port=10000 \
--hiveconf hive.server2.thrift.bind.host=bigdata01 \
--master yarn \
--conf spark.sql.shuffle.partitions=2

hiveServer2 和 thriftserver的区别:

只需访问 Hive 表,无需 Spark 的计算能力:

使用 HiveServer2,更简单,且原生支持 Hive 功能。

需要访问 Hive 表,并利用 Spark 的计算引擎:

使用 Spark Thrift Server,可以充分利用 Spark 的分布式计算能力。

相关推荐
知初~3 小时前
出行项目案例
hive·hadoop·redis·sql·mysql·spark·database
狮歌~资深攻城狮7 小时前
HBase性能优化秘籍:让数据处理飞起来
大数据·hbase
Elastic 中国社区官方博客7 小时前
Elasticsearch Open Inference API 增加了对 Jina AI 嵌入和 Rerank 模型的支持
大数据·人工智能·elasticsearch·搜索引擎·ai·全文检索·jina
努力的小T8 小时前
使用 Docker 部署 Apache Spark 集群教程
linux·运维·服务器·docker·容器·spark·云计算
shaodong11238 小时前
鸿蒙系统-同应用跨设备数据同步(分布式功能)
分布式·华为·harmonyos
workflower8 小时前
Prompt Engineering的重要性
大数据·人工智能·设计模式·prompt·软件工程·需求分析·ai编程
API_technology10 小时前
电商搜索API的Elasticsearch优化策略
大数据·elasticsearch·搜索引擎
黄雪超10 小时前
大数据SQL调优专题——引擎优化
大数据·数据库·sql
The god of big data10 小时前
MapReduce 第二部:深入分析与实践
大数据·mapreduce
xiao-xiang11 小时前
kafka-保姆级配置说明(producer)
分布式·kafka