[英]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: 这是一个常见的问题,到目前为止,根据我通过网络发现的各种补救措施,我尝试了以下尝试,但没有走运:
spark.driver.extraClassPath spark.executor.extraClassPath spark.files
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驱动程序。
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.