简体   繁体   English

在Hortonworks Sandbox 2.4上,Spark使用SQLServer驱动程序会导致“找不到合适的驱动程序”

[英]On Hortonworks Sandbox 2.4, Spark use of SQLServer driver results in “No Suitable Driver Found”

HDP version 2.4 HDP版本2.4

I am trying to write to a SQL Server database via the Microsoft SQL Server JDBC driver sqljdbc41.jar. 我正在尝试通过Microsoft SQL Server JDBC驱动程序sqljdbc41.jar写入SQL Server数据库。 I'm executing the following in Zeppelin: 我正在齐柏林飞艇执行以下命令:

val foo = sqlContext.jdbc("jdbc:sqlserver://X;databaseName=X;user=X;password=X", "X")

在此处输入图片说明

which yields the "no suitable driver found" error. 产生“找不到合适的驱动程序”错误。

This is a common issue and so far I've tried the following, without luck, based on various remedies I've found through the interwebs: 这是一个常见的问题,到目前为止,根据我通过网络发现的各种补救措施,我尝试了以下尝试,但没有走运:

  • add the full path to the JAR for the following properties in spark-defaults.conf: 在spark-defaults.conf中为以下属性添加JAR的完整路径:
 spark.driver.extraClassPath spark.executor.extraClassPath spark.files 
  • add SPARK_CLASSPATH with the same JAR path in spark_env.sh 在spark_env.sh中添加具有相同JAR路径的SPARK_CLASSPATH

After making these changes I've stopped and started the Spark service through the Ambari interface, and I do see the changes reflected in both the Ambari portal and within the configuration files on the VM. 进行了这些更改之后,我已经通过Ambari界面停止并启动了Spark服务,并且确实看到了更改在Ambari门户和VM的配置文件中均得到反映。

I did notice that many posts indicate you still have to provide the jar on the classpath when running spark-submit, but I'm accessing through Zeppelin, so not sure how that applies. 我确实注意到,很多帖子都表明您在运行spark-submit时仍需要在类路径上提供jar,但是我正在通过Zeppelin访问,因此不确定如何应用。

Try using JDBC Interpreter with Zeppelin 0.6.0 and configure MySQL driver. 尝试将JDBC Interpreter与Zeppelin 0.6.0一起使用,并配置MySQL驱动程序。

JDBC解释器配置

You can also try to follow http://thedataist.com/tutorial-using-apache-zeppelin-with-mysql/ 您也可以尝试遵循http://thedataist.com/tutorial-using-apache-zeppelin-with-mysql/

Perhaps you just need to change the connection string as this post suggests. 也许您只需要更改此帖子建议的连接字符串即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Docker 找不到合适的驱动程序 sqlserver - Docker no suitable driver found sqlserver 找不到适用于jdbc:sqlserver的驱动程序 - No suitable driver found for jdbc:sqlserver 玩! + Tomcat:找不到合适的驱动程序sqlserver - play! + Tomcat : No suitable driver found sqlserver 在Spring框架中找不到适用于jdbc:sqlserver的驱动程序 - No suitable driver found for jdbc:sqlserver in Spring framework Java EE-找不到适用于jdbc:sqlserver的驱动程序 - Java EE - No suitable driver found for jdbc:sqlserver “找不到适用于jdbc:microsoft:sqlserver的驱动程序” - “No suitable driver found for jdbc:microsoft:sqlserver” 找不到适用于jdbc:sqlserver:// repcode; DatabaseName = reporting的驱动程序 - No suitable driver found for jdbc:sqlserver://repcode;DatabaseName=reporting java.sql.SQLException:找不到适用于jdbc:sqlserver的驱动程序: - java.sql.SQLException: No suitable driver found for jdbc:sqlserver: 没有找到适合 jdbc:sqlserver:ex;databaseName=Cities_names 的驱动程序 - No suitable driver found for jdbc:sqlserver:ex;databaseName=Cities_names 修复 Java db 连接到 sqlserver 中的“找不到适合 jdbc 的驱动程序”错误 - Fix 'No suitable driver found for jdbc' error in Java db connection to sqlserver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM