![](/img/trans.png)
[英]Cannot connect to Jupyter Notebook server in Azure HDInsight
[英]Azure HDInsight Jupyter and pyspark not working
我使用以下参数在 azure 上创建了一个 HDInsight 集群:
Spark 2.4 (HDI 4.0)
我用 PySpark Jupyter Notebook 尝试了Apache Spark的 HDInsights 教程,它工作得很好。 但是自从我第二次重新运行笔记本或启动新笔记本后,运行简单
from pyspark.sql import *
或其他命令,它们都以
The code failed because of a fatal error:
Session 7 did not start up in 180 seconds..
Some things to try:
a) Make sure Spark has enough available resources for Jupyter to create a Spark context. For instructions on how to assign resources see http://go.microsoft.com/fwlink/?LinkId=717038
b) Contact your cluster administrator to make sure the Spark magics library is configured correctly.
在此之后,我还尝试了 pyspark 和 ssh。当我通过 ssh 连接到集群并运行
$ pyspark
它显示以下信息
SPARK_MAJOR_VERSION is set to 2, using Spark2
Python 2.7.12 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:42:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
并卡在那里。
我想知道我是否错过了任何手术? 或者它是一个错误或什么的。 我该如何解决这个问题?
根据我的观察,当您遇到“YARN”服务示例问题时,您会收到此错误消息:YARN 服务已停止。
错误:首先我停止了“YARN”服务。
现在我开始使用 Jupyter 笔记本,当我运行相同的查询时,遇到与您相同的错误消息。
演练:错误消息
成功:所有 Ambari 服务都在正常运行。
要成功运行“Jupyter Notebook”查询,请确保所有服务都在正常运行。
演练:成功消息
++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++
以下是创建 Jupyter notebook 并在 Azure HDInsight Spark 集群上运行查询的步骤:
Go 到Azure 门户=> 从集群仪表板=> Select Jupyter 笔记本=> 创建Pyspark笔记本 => 并执行查询,如图所示。
您可以使用交互式 Apache 运行 Pyspark (Python) 查询:
参考: https://learn.microsoft.com/en-us/azure/hdinsight/spark/apache-spark-shell
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.