ARTICLE DETAIL

资讯详情

深耕网站视觉设计与运营推广的一线实战洞察。

使用dataGrip连接spark

使用dataGrip连接spark 概述spark的配置共有5种1、本地模式2、集群模式standalone yarnk8smesos四种集群模式spark本身只是一个计算引擎是没有数据库的所以说数据需要在hdfs上存放而数据库就是使用hive都已经启动hdfs了就使用yarn模式即可而使用standalone模式就不合适了。因此以下的配置是基于hdfsyarnspark进行配置的。一、配置要想spark知道hive中所有的数据库那么就需要将spark和metastore服务联系起来1、在hive下的hive-site.xml中添加property namehive.metastore.schema.verification/name valuefalse/value /property2、将hive的该文件复制到spark的conf下cp /opt/installs/hive/conf/hive-site.xml /opt/installs/spark/conf3、分发一下spark中的该文件xsync.sh opt/installs/spark/conf/hive-site.xml二、启动1、启动hadoop 2、启动metastore 3、启动Spark Thrift Server启动ThriftServer若已经启动过hiveserver2 那么记得将端口号改为10001opt/installs/spark/sbin/start-thriftserver.sh \ --hiveconf hive.server2.thrift.port10000 \ --hiveconf hive.server2.thrift.bind.hostbigdata01 \ --master yarn \ --conf spark.sql.shuffle.partitions2hiveServer2 和 thriftserver的区别只需访问 Hive 表无需 Spark 的计算能力使用 HiveServer2更简单且原生支持 Hive 功能。需要访问 Hive 表并利用 Spark 的计算引擎使用 Spark Thrift Server可以充分利用 Spark 的分布式计算能力。
返回列表