1、
在Spark的conf目录中 vi hive-site.xml
<configuration><property>
<name>hive.metastore.uris</name>
<value>thrift://tgmaster:9083</value>
<description>Thrift URI for the remote metastore.Used by metastore client to connect to metastore.</description>
</property>
</configuration>
2、
在Spark的lib目录中,添加mysql-connector-java***.jar
3、
启动hive的metastore服务:
hive --service metastore >metastore.log 2>& 1&
4、启动Spark-shell: spark-shell --master