天天看點

spark-sql(spark sql cli)用戶端內建hive

1、安裝hadoop叢集

2、安裝hive

3、安裝配置spark

4、spark-sql內建hive

拷貝hdfs-site.xml、hive-site.xml配置檔案到spark conf/目錄下:

$ cp /opt/cdh-5.3.6/hive-0.13.1-cdh5.3.6/conf/hive-site.xml .

$ cp /opt/cdh-5.3.6/hadoop-2.5.0-cdh5.3.6/etc/hadoop/hdfs-site.xml .

5、啟動spark-sql

$ bin/spark-sql  --master local[2]

啟動之後可以在shell用戶端進行互動式HQL通路hive資料庫了。