问题:
<console>:16: error: not found: value sqlContext
import sqlContext.implicits._
^
<console>:16: error: not found: value sqlContext
import sqlContext.sql
方案:
1. 切换root用户
su root
2.开启mysql 服务
service mysqld start
3. 在spark目录下运行该命令
bin/spark-shell --master spark://192.168.2.181:7077 --executor-memory 4g --total-executor-cores 4 --driver-class-path /home/hadoop/apache-hive-1.2.1-bin/lib/mysql-connector-java-5.1.35-bin.jar
注意添加mysql-connector-java相关jar
上述运行若不成功的,则使用该代码:
hive --service metastore > matastore.log 2>&1 &