美文网首页
spark sql with hive

spark sql with hive

作者: GK_斯皮利特 | 来源:发表于2017-03-03 11:45 被阅读680次

    spark standalone

    spark-1.5.0-bin-hadoop2.6

    spark-env.sh配置

    export SPARK_MASTER_IP=172.16.31.11

    export SPARK_MASTER_PORT=7077

    export SPARK_WORKER_CORES=1

    export SPARK_WORDER_INSTANCES=1

    export SPARK_WORKER_MEMORY=1g

    export MASTER=spark://172.16.31.11:7077

    slaves

    MRguan

    启动

    ./sbin/start-all.sh

    ./bin/spark-submit --class org.apache.spark.examples.SparkPi --master yarn --deploy-mode client lib/spark-examples-1.5.0-hadoop2.6.0.jar

    spark sql with hive

    spark-env.sh添加

    export HADOOP_CONF_DIR=/opt/beh/core/hadoop/etc/hadoop

    export YARN_CONF_DIR=/opt/beh/core/hadoop/etc/hadoop

    export HADOOP_HOME=/opt/beh/core/hadoop

    export SPARK_JAR=/opt/beh/core/spark/lib/spark-assembly-1.5.0-hadoop2.6.0.jar

    export SPARK_CLASSPATH=/opt/beh/core/spark/lib/mysql-connector-java-5.1.30-bin.jar

     将hive-site.xml和hive-log4j.properties复制到$SPARK_HOME/conf下

     将 $HIVE_HOME/lib下 mysql-connector-java-5.1.30-bin.jar复制到$SPARK_HOME/lib下

    注意版本 不然报错

    17/02/28 09:12:48 WARN HiveMetaStore: Retrying creating default database after error: Error creating transactional connection factory

    javax.jdo.JDOFatalInternalException: Error creating transactional connection factory

    重启spark

    执行./bin/spark-sql.sh

    相关文章

      网友评论

          本文标题:spark sql with hive

          本文链接:https://www.haomeiwen.com/subject/trdqwttx.html