如何在oozie工作流程中运行spark程序?

时间:2018-09-26 23:59:52

标签: apache-spark hadoop hive oozie

当我们在oozie-hue中运行spark程序时,它失败了,因为找不到配置单元数据库“ zdm_ssso”。

似乎还有一些配置问题:

”未成功,可能的原因是:新客户端正在与旧服务器通信。 org.apache.thrift.transport.TTransportException“

2018-09-26 20:35:36,267 WARN [main] hive.metastore: set_ugi() not successful, Likely cause: new client talking to old server. Continuing without it.
    org.apache.thrift.transport.TTransportException
        at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132)
        at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)

火花程序

          public static void main(String[] args) throws IOException {
            System.setSecurityManager(null);

        String warehouseLocation = new File("spark-warehouse").getAbsolutePath();
        SparkSession spark = SparkSession
                .builder()
                .appName("Java Spark Hive Example")
                .master("yarn")
                .config("spark.sql.warehouse.dir", warehouseLocation)
                .config("spark.driver.maxResultSize", "3g")
                .config("spark.debug.maxToStringFields", "10000")
                .config("spark.sql.crossJoin.enabled", "true")
                .enableHiveSupport()
                .getOrCreate();
        spark.conf().set("spark.driver.maxResultSize", "3g");


        spark.sql("use database_example");

    }

enter image description here

enter image description here

2018-09-26 22:02:01,535 INFO [main] org.apache.spark.deploy.yarn.Client: 
     client token: Token { kind: YARN_CLIENT_TOKEN, service:  }
     diagnostics: User class threw exception: org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException: Database 'database_example' not found;
     ApplicationMaster host: 10.74.234.5
     ApplicationMaster RPC port: 0
     queue: default
     queue user: administrador
     start time: 1538010085426
     final status: FAILED
     tracking URL: https://br-pc-centos-02:26001/proxy/application_1537467570666_4459/
     user: administrador

enter image description here

0 个答案:

没有答案