问题已解决!
首先参考了https://coding.imooc.com/learn/questiondetail/69693.html
然后在服务器上执行
spark-submit \
--class com.spark.ETLStepTwoLocal \
--master local[*] \
--jars /opt/hive-1.1.0-cdh5.7.0/lib/mysql-connector-java-5.1.27-bin.jar,/opt/lib/ipdatabase-1.0.jar,/opt/lib/poi-3.14.jar,/opt/lib/poi-ooxml-schemas-3.14.jar,/opt/lib/poi-ooxml-3.14.jar,/opt/lib/xmlbeans-2.6.0.jar \
--conf spark.sql.warehouse.dir=hdfs://hadoop:9000/user/hive/warehouse \
/opt/lib/spark-sql-1.0.jar \
file:///root/data/access.log \
file:///root/data/step2_parquet \
file:///root/data/step2_json
其中关联的jar包中,xmlbeans-2.6.0.jar是单独下载的
下载地址:http://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans/2.6.0