sparksql读取hive数据源配置
2017-08-24 21:23
453 查看
1、将hive-site.xml内容添加到spark conf配置文件中,内容仅需要元数据连接信息即可
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property>
<name>hive.metastore.uris</name>
<value>thrift://master-centos:9083</value>
<description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>
</configuration>
并分发到各个节点中
2、如hive元数据采用的是mysql,则需将mysql-connector-java-5.1.25-bin.jar放置 spark/lib下
3、修改 spark-defaults.conf 配置文件
spark-default.conf
spark.master spark://192.168.130.140:7077
spark.driver.memory 512m
spark.executor.memory 512m
spark.eventLog.enabled true
spark.eventLog.dir hdfs://192.168.130.140:8020/user/spark/logs (需提前在hadoop上创建好该目录)
并分发到各个节点中
4、启动hive metastore 服务
5、如需通过jdbc方式连接spark,则启动spark thriftserver服务
start-thriftserver.sh --master spark://192.168.130.140:7077 --executor-memory 1g --total-executor-cores 2 --executor-cores 1 --hiveconf hive.server2.thrift.port=10050 --conf spark.dynamicAllocation.enabled=false
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property>
<name>hive.metastore.uris</name>
<value>thrift://master-centos:9083</value>
<description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>
</configuration>
并分发到各个节点中
2、如hive元数据采用的是mysql,则需将mysql-connector-java-5.1.25-bin.jar放置 spark/lib下
3、修改 spark-defaults.conf 配置文件
spark-default.conf
spark.master spark://192.168.130.140:7077
spark.driver.memory 512m
spark.executor.memory 512m
spark.eventLog.enabled true
spark.eventLog.dir hdfs://192.168.130.140:8020/user/spark/logs (需提前在hadoop上创建好该目录)
并分发到各个节点中
4、启动hive metastore 服务
5、如需通过jdbc方式连接spark,则启动spark thriftserver服务
start-thriftserver.sh --master spark://192.168.130.140:7077 --executor-memory 1g --total-executor-cores 2 --executor-cores 1 --hiveconf hive.server2.thrift.port=10050 --conf spark.dynamicAllocation.enabled=false
相关文章推荐
- SparkSQL读取HBase数据,通过自定义外部数据源(hbase的Hive外关联表)
- spark SQL (五)数据源 Data Source----json hive jdbc等数据的的读取与加载
- SparkSQL on Hive配置与实战
- 大数据IMF传奇行动绝密课程第69课:Spark SQL通过Hive数据源实战
- spark-sql读取hive
- Spark SQL读取数据源创建DataFrame(三)
- spark sql读取mysql数据源并且将结果写入mysql
- 第69课:SparkSQL通过Hive数据源实战学习笔记
- [Spark][Hive][Python][SQL]Spark 读取Hive表的小例子
- spark-sql读取hive挂载alluxio
- 【Spark篇】---SparkSQL on Hive的配置和使用
- sparkSQL读取hive分区表的问题追踪
- spark sql on hive配置及其使用
- Spark SQL读取hive数据时报找不到mysql驱动
- SparkSQL读取Hive中的数据
- spark-sql读取映射hbase数据的hive外部表
- spark-sql读取映射hbase数据的hive外部表
- 第57课:Spark SQL on Hive配置及实战
- SparkSQL读取数据源
- spark sql 使用hive作为数据源