在 yarn 上提交 job 可以,不代表通过 sql-client 可以,他们使用的是不同的脚本和配置。前者跟 bin/flink, bin/yarn-session.sh, conf/flink-conf.yaml 有关,后跟 bin/sql-client.sh, conf/sql-client-defaults.yaml 有关。
你可以理一下这个逻辑,或者给出你的相关配置文件,以及 sql-client.sh 启动完整命令。 op <520075...@qq.com> 于2020年7月27日周一 下午5:29写道: > 你好, > 很确定,检查了好几遍,提交到yarn上执行都没问题,sql-client里面报这个错,1.11.0版本 > ------------------ 原始邮件 ------------------ > 发件人: > "user-zh" > < > samyang31...@gmail.com>; > 发送时间: 2020年7月27日(星期一) 下午5:25 > 收件人: "user-zh"<user-zh@flink.apache.org>; > > 主题: Re: sql-client 的jdbc表出错 > > > > hi, > > 你能确定你的 class path 下有 mysql-connector-java-5.1.38.jar 依赖吗?请在运行时确认下这一点。 > > op <520075...@qq.com> 于2020年7月27日周一 下午2:45写道: > > > 您好,我创建了一个jdbc的表 > > > > > > CREATE TABLE mvp_dim_anticheat_args_all ( > > &nbsp; &nbsp; id BIGINT, > > &nbsp; &nbsp; dt STRING, > > &nbsp; &nbsp; cnt_7d INT, > > &nbsp; &nbsp;cnt_30d INT, > > &nbsp; PRIMARY KEY (id) NOT ENFORCED > > ) WITH ( > > &nbsp; &nbsp;'connector' = 'jdbc', > > &nbsp; &nbsp;'driver'='com.mysql.jdbc.Driver', > > &nbsp; &nbsp;'url' = 'jdbc:mysql://localhost:3306/huyou_oi', > > &nbsp; &nbsp;'table-name' = 'mvp_dim_ll', > > &nbsp; &nbsp;'username' = 'huy_oi', > > &nbsp; &nbsp;'password' = '420123' > > ); > > > > > > > > 查询的时候报&nbsp; > > [ERROR] Could not execute SQL statement. Reason: > > java.lang.ClassNotFoundException: com.mysql.jdbc.Driver > > > > > > > > > > > > 我的安装目录lib下面有&nbsp;flink-connector-jdbc_2.11-1.11.0.jar > > 和&nbsp;mysql-connector-java-5.1.38.jar 这俩,请问是什么原因?? > > 谢谢