20221225 海豚调度2.0.5 星环驱动包踩坑(一)

这篇具有很好参考价值的文章主要介绍了20221225 海豚调度2.0.5 星环驱动包踩坑(一)。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

阳阳的一周,算是挺过来了,现在只剩感冒了,迷迷糊糊的干了一周,混口饭吃不容易呀!简单记录一下遇到的问题吧!

连接hive(星环)数据库失败

  • 方案一 : 海豚调度2.0.5使用的hive包是2.0版本,星环库包装的是hive 1.0版本,因此连接不上,将hive包降为1.0(<hive.jdbc.version>1.1.0</hive.jdbc.version>),同时修改VALIDATION_QUERY 为"select 1 from system.dual"即可
    20221225 海豚调度2.0.5 星环驱动包踩坑(一)
    org.apache.dolphinscheduler.spi.utils.Constants
    
    20221225 海豚调度2.0.5 星环驱动包踩坑(一)
  • 方案二(推荐) : 删除hive-jdbc jar包,引入星环驱动包inceptor-driver-4.8.3.jar下了半天没成功,如果连接星环库肯定项目里面有这个包,直接拿过来吧),连接过程中若是包某类或方法不存在,则为jar包冲突,需要继续删除hive相关包(目前遇到的只有hive1.0的service包冲突,2.0只删除了jdbc包,其它没报冲突),同样也需要修改VALIDATION_QUERY 为"select 1 from system.dual",同上
    <dependency>
    	<groupId>inceptor.hive</groupId>
    	<artifactId>inceptor.driver</artifactId>
    	<version>4.8.3</version>
    </dependency>
    
    <dependency>
    	<groupId>com.transwarp</groupId>
    	<artifactId>inceptor-driver</artifactId>
    	<version>4.8.3</version>
    </dependency>
    
    推荐理由:hive1.0 不支持存储过程调用方法,会报错,详情如下
    [ERROR] 2022-12-12 17:54:44.313 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.procedure.ProcedureTask:[123] - procedure task error
    java.sql.SQLException: Method not supported
    	at org.apache.hive.jdbc.HiveConnection.prepareCall(HiveConnection.java:922)
    	at com.zaxxer.hikari.pool.ProxyConnection.prepareCall(ProxyConnection.java:316)
    	at com.zaxxer.hikari.pool.HikariProxyConnection.prepareCall(HikariProxyConnection.java)
    	at org.apache.dolphinscheduler.plugin.task.procedure.ProcedureTask.handle(ProcedureTask.java:107)
    	at org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread.run(TaskExecuteThread.java:191)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
    	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
    	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at java.lang.Thread.run(Thread.java:745)
    

执行星环(hive) sql节点,工作流实例一直执行中,任务实例则为提交状态,一直不执行

原因是common.properties 配置文件中的resource.storage.type=HDFS,配置了HDFS存储,但是并未按照hadoop集群,master一直尝试连接hdfs服务器,因此出现上述情况。将resource.storage.type=HDFS改为resource.storage.type=NONE,重启服务即可

执行星环(hive) 存储过程节点,超过30秒变报超时错

  • 错误详情

    org.apache.dolphinscheduler.plugin.task.procedure.ProcedureTask
    [ERROR] 2022-12-22 20:49:10.275 TaskLogLogger-class org.apache.dolphinscheduler.plugin.task.procedure.ProcedureTask:[123] - procedure task error
    java.sql.SQLException: org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out
    	at org.apache.hive.jdbc.HivePreparedStatement2.executeInternal(HivePreparedStatement2.java:158)
    	at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:419)
    	at org.apache.hive.jdbc.HivePreparedStatement2.execute(HivePreparedStatement2.java:165)
    	at org.apache.hive.jdbc.HiveCallableStatement.execute(HiveCallableStatement.java:41)
    	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
    	at com.zaxxer.hikari.pool.HikariProxyCallableStatement.execute(HikariProxyCallableStatement.java)
    	at org.apache.dolphinscheduler.plugin.task.procedure.ProcedureTask.handle(ProcedureTask.java:116)
    	at org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread.run(TaskExecuteThread.java:191)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
    	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
    	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by: org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out
    	at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129)
    	at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
    	at org.apache.thrift.transport.TSaslTransport.readLength(TSaslTransport.java:376)
    	at org.apache.thrift.transport.TSaslTransport.readFrame(TSaslTransport.java:453)
    	at org.apache.thrift.transport.TSaslTransport.read(TSaslTransport.java:435)
    	at org.apache.thrift.transport.TSaslClientTransport.read(TSaslClientTransport.java:37)
    	at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
    	at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:429)
    	at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:318)
    	at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:219)
    	at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
    	at org.apache.hive.service.cli.thrift.TCLIService$Client.recv_ExecutePreCompiledStatement(TCLIService.java:763)
    	at org.apache.hive.service.cli.thrift.TCLIService$Client.ExecutePreCompiledStatement(TCLIService.java:750)
    	at org.apache.hive.jdbc.HivePreparedStatement2.executeInternal(HivePreparedStatement2.java:141)
    	... 14 common frames omitted
    
  • 解决办法:修改HiveDataSourceClient 类中的hive连接超时时间
    20221225 海豚调度2.0.5 星环驱动包踩坑(一)

  • HiveDataSourceClient文章来源地址https://www.toymoban.com/news/detail-493087.html

    /*
     * Licensed to the Apache Software Foundation (ASF) under one or more
     * contributor license agreements.  See the NOTICE file distributed with
     * this work for additional information regarding copyright ownership.
     * The ASF licenses this file to You under the Apache License, Version 2.0
     * (the "License"); you may not use this file except in compliance with
     * the License.  You may obtain a copy of the License at
     *
     *    http://www.apache.org/licenses/LICENSE-2.0
     *
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    package org.apache.dolphinscheduler.plugin.datasource.hive;
    
    import static org.apache.dolphinscheduler.spi.task.TaskConstants.HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE;
    import static org.apache.dolphinscheduler.spi.task.TaskConstants.JAVA_SECURITY_KRB5_CONF;
    import static org.apache.dolphinscheduler.spi.task.TaskConstants.JAVA_SECURITY_KRB5_CONF_PATH;
    
    import java.io.IOException;
    import java.lang.reflect.Field;
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.util.concurrent.Executors;
    import java.util.concurrent.ScheduledExecutorService;
    import java.util.concurrent.TimeUnit;
    
    import org.apache.dolphinscheduler.plugin.datasource.api.client.CommonDataSourceClient;
    import org.apache.dolphinscheduler.plugin.datasource.api.provider.JdbcDataSourceProvider;
    import org.apache.dolphinscheduler.plugin.datasource.utils.CommonUtil;
    import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
    import org.apache.dolphinscheduler.spi.enums.DbType;
    import org.apache.dolphinscheduler.spi.utils.Constants;
    import org.apache.dolphinscheduler.spi.utils.PropertyUtils;
    import org.apache.dolphinscheduler.spi.utils.StringUtils;
    import org.apache.hadoop.conf.Configuration;
    import org.apache.hadoop.security.UserGroupInformation;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    
    import com.zaxxer.hikari.HikariDataSource;
    
    import sun.security.krb5.Config;
    
    public class HiveDataSourceClient extends CommonDataSourceClient {
    
        private static final Logger logger = LoggerFactory.getLogger(HiveDataSourceClient.class);
    
        private ScheduledExecutorService kerberosRenewalService;
    
        private Configuration hadoopConf;
        protected HikariDataSource oneSessionDataSource;
        private UserGroupInformation ugi;
    
        public HiveDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
            super(baseConnectionParam, dbType);
        }
    
        @Override
        protected void preInit() {
            logger.info("PreInit in {}", getClass().getName());
            this.kerberosRenewalService = Executors.newSingleThreadScheduledExecutor();
        }
    
        @Override
        protected void initClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
            logger.info("Create Configuration for hive configuration.");
            this.hadoopConf = createHadoopConf();
            logger.info("Create Configuration success.");
    
            logger.info("Create UserGroupInformation.");
            this.ugi = createUserGroupInformation(baseConnectionParam.getUser());
            logger.info("Create ugi success.");
    
            super.initClient(baseConnectionParam, dbType);
            this.oneSessionDataSource = JdbcDataSourceProvider.createOneSessionJdbcDataSource(baseConnectionParam, dbType);
            logger.info("Init {} success.", getClass().getName());
        }
    
        @Override
        protected void checkEnv(BaseConnectionParam baseConnectionParam) {
            super.checkEnv(baseConnectionParam);
            checkKerberosEnv();
        }
    
        private void checkKerberosEnv() {
            String krb5File = PropertyUtils.getString(JAVA_SECURITY_KRB5_CONF_PATH);
            Boolean kerberosStartupState = PropertyUtils.getBoolean(HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE, false);
            if (kerberosStartupState && StringUtils.isNotBlank(krb5File)) {
                System.setProperty(JAVA_SECURITY_KRB5_CONF, krb5File);
                try {
                    Config.refresh();
                    Class<?> kerberosName = Class.forName("org.apache.hadoop.security.authentication.util.KerberosName");
                    Field field = kerberosName.getDeclaredField("defaultRealm");
                    field.setAccessible(true);
                    field.set(null, Config.getInstance().getDefaultRealm());
                } catch (Exception e) {
                    throw new RuntimeException("Update Kerberos environment failed.", e);
                }
            }
        }
    
        private UserGroupInformation createUserGroupInformation(String username) {
            String krb5File = PropertyUtils.getString(Constants.JAVA_SECURITY_KRB5_CONF_PATH);
            String keytab = PropertyUtils.getString(Constants.LOGIN_USER_KEY_TAB_PATH);
            String principal = PropertyUtils.getString(Constants.LOGIN_USER_KEY_TAB_USERNAME);
    
            try {
                UserGroupInformation ugi = CommonUtil.createUGI(getHadoopConf(), principal, keytab, krb5File, username);
                try {
                    Field isKeytabField = ugi.getClass().getDeclaredField("isKeytab");
                    isKeytabField.setAccessible(true);
                    isKeytabField.set(ugi, true);
                } catch (NoSuchFieldException | IllegalAccessException e) {
                    logger.warn(e.getMessage());
                }
    
                kerberosRenewalService.scheduleWithFixedDelay(() -> {
                    try {
                        ugi.checkTGTAndReloginFromKeytab();
                    } catch (IOException e) {
                        logger.error("Check TGT and Renewal from Keytab error", e);
                    }
                }, 5, 5, TimeUnit.MINUTES);
                return ugi;
            } catch (IOException e) {
                throw new RuntimeException("createUserGroupInformation fail. ", e);
            }
        }
    
        protected Configuration createHadoopConf() {
            Configuration hadoopConf = new Configuration();
            hadoopConf.setBoolean("ipc.client.fallback-to-simple-auth-allowed", true);
            return hadoopConf;
        }
    
        protected Configuration getHadoopConf() {
            return this.hadoopConf;
        }
    
        @Override
        public Connection getConnection() {
            try {
            	oneSessionDataSource.setConnectionTimeout(172800L);//设置连接超时时间 2天
            	//oneSessionDataSource.setIdleTimeout(60000L);// 非必须(空闲超时时间),保持默认值就行
            	//oneSessionDataSource.setMaxLifetime(600000L);// 非必须(最大生命周期),保持默认值就行
                return oneSessionDataSource.getConnection();
            } catch (SQLException e) {
                logger.error("get oneSessionDataSource Connection fail SQLException: {}", e.getMessage(), e);
                return null;
            }
        }
    
        @Override
        public void close() {
            super.close();
    
            logger.info("close HiveDataSourceClient.");
            kerberosRenewalService.shutdown();
            this.ugi = null;
    
            this.oneSessionDataSource.close();
            this.oneSessionDataSource = null;
        }
    }
    
    

http执行报错:java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory

  • 错误详情
    [ERROR] 2022-12-26 11:37:12.532 org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread:[209] - task scheduler failure
    java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory
    	at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:912)
    	at org.apache.dolphinscheduler.plugin.task.http.HttpTask.createHttpClient(HttpTask.java:333)
    	at org.apache.dolphinscheduler.plugin.task.http.HttpTask.handle(HttpTask.java:98)
    	at org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread.run(TaskExecuteThread.java:191)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
    	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
    	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:750)
    
  • 解决版本:删除星环驱动包中的http目录
    20221225 海豚调度2.0.5 星环驱动包踩坑(一)

到了这里,关于20221225 海豚调度2.0.5 星环驱动包踩坑(一)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 用海豚调度器定时调度从Kafka到HDFS的kettle任务脚本

    在实际项目中,从Kafka到HDFS的数据是每天自动生成一个文件,按日期区分。而且Kafka在不断生产数据,因此看看kettle是不是需要时刻运行?能不能按照每日自动生成数据文件? 为了测试实际项目中的海豚定时调度从Kafka到HDFS的Kettle任务情况,特地提前跑一下海豚定时调度这个

    2024年04月15日
    浏览(25)
  • 【DBeaver】驱动添加-Hive和星环

    hive驱动可以直接去官网下载官网地址,填一下个人信息。 如果想直接下载可以去我上次的资源下地址,需要用zip解压。 星环驱动是我第一次接触,是国产的基于开源Hive驱动自研的产品,我看到官网上有很多类型的数据库产品,没过两天星环的销售人员还给我打了电话,可见

    2024年02月03日
    浏览(26)
  • 告别手动调度,海豚调度器 3.1.x 集群部署让你轻松管理多机!

    转载自第一片心意 由于海豚调度器官网的集群部署文档写的较乱,安装过程中需要跳转到很多地方进行操作,所以自己总结了一篇可以直接跟着从头到尾进行操作的文档,以方便后续的部署、升级、新增节点、减少节点的相关操作。 JDK:下载JDK (1.8+),安装并配置 JAVA_HOME 环

    2024年04月24日
    浏览(23)
  • 海豚²来了丨DolphinDB 集成 DolphinScheduler,任务调度更轻松

    DolphinDB 是一款高性能时序数据库。DolphinDB 集成了功能强大的编程语言和高容量高速度的批流一体数据分析系统,为海量数据(特别是时间序列数据)的快速存储、检索、计算及分析提供一站式解决方案。在实际生产环境中,经常存在 数据导入、转换、查询计算,更新等一系

    2024年02月03日
    浏览(40)
  • 最新版海豚调度dolphinscheduler-3.1.3安装部署详细教程

    本文基于Ambari集群搭建最新版本的海豚调度dolphinscheduler-3.1.3版本,后续会尝试整合到Ambari中。 安装dolphinscheduler需要在环境中安装如下依赖 ① JDK8 下载JDK (1.8+),安装并配置 JAVA_HOME 环境变量,并将其下的 bin 目录追加到 PATH 环境变量中 ② 数据库:PostgreSQL (8.2.15+) 或者 MySQL

    2023年04月15日
    浏览(39)
  • 一百六十八、Kettle——用海豚调度器定时调度从Kafka到HDFS的任务脚本(持续更新追踪、持续完善)

    在实际项目中,从Kafka到HDFS的数据是每天自动生成一个文件,按日期区分。而且Kafka在不断生产数据,因此看看kettle是不是需要时刻运行?能不能按照每日自动生成数据文件? 为了测试实际项目中的海豚定时调度从Kafka到HDFS的kettle任务情况,特地提前跑一下海豚定时调度这个

    2024年02月10日
    浏览(32)
  • 一百六十五、Kettle——用海豚调度器调度Linux资源库中的kettle任务脚本(亲测、附流程截图)

    在Linux上脚本运行kettle的转换任务、无论是Linux本地还是Linux资源库都成功后,接下来就是用海豚调度Linux上kettle任务 尤其是团队开发中,基本都要使用共享资源库,所以我直接使用海豚调度Linux资源库的kettle任务脚本 1、先开启zookeeper服务 2、再开启海豚调度器服务 3、开启服

    2024年02月11日
    浏览(37)
  • 海豚调度 DolphinScheduler(2.x和3.x版本) 本地环境搭建,方便本地调式代码

    💡 本系列文章是 DolphinScheduler 由浅入深的教程,涵盖搭建、二开迭代、核心原理解读、运维和管理等一系列内容。适用于想对 DolphinScheduler了解或想要加深理解的读者。 祝开卷有益。 大数据学习指南 DolphinScheduler 的开源版本有不少的 BUG,所以在公司生产使用的话,需要做二

    2024年02月11日
    浏览(36)
  • 【大数据进阶第三阶段之DolphinScheduler学习笔记】DolphinScheduler(海豚调度)的部署指南

    参考官网部署方式:https://dolphinscheduler.apache.org/zh-cn/docs/3.1.3/guide/installation/standalone 部署方式:单机部署,伪集群部署,集群部署。 如果是新手,想要体验 DolphinScheduler 的功能,推荐使用Standalone方式体检。如果你是在生产中使用,推荐使用 集群部署或者 kubernetes。 Standalone

    2024年01月22日
    浏览(33)
  • 一百六十八、Kettle——用海豚调度器定时调度从Kafka到HDFS的kettle任务脚本(持续更新追踪、持续完善)

    在实际项目中,从Kafka到HDFS的数据是每天自动生成一个文件,按日期区分。而且Kafka在不断生产数据,因此看看kettle是不是需要时刻运行?能不能按照每日自动生成数据文件? 为了测试实际项目中的海豚定时调度从Kafka到HDFS的kettle任务情况,特地提前跑一下海豚定时调度这个

    2024年02月09日
    浏览(29)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包