首页 > 解决方案 > 在 Amazon EMR 集群上运行 jupyter notebook 时出现 Pyspark 内核错误

问题描述

我是 AWS EMR 的新手。我想使用 pyspark 内核从命令行在我的集群上运行 jupyter notebook。
为了创建集群,我运行了如下命令:

aws emr create-cluster --release-label emr-5.32.0 --name 'spark_jupyter_2'
--applications Name=Hadoop Name=Spark Name=Livy Name=JupyterEnterpriseGateway Name=Hive 
--ec2-attributes KeyName=…………..,InstanceProfile=EMR_EC2_DefaultRole --service-role EMR_DefaultRole 
--instance-groups InstanceGroupType=MASTER,
InstanceCount=1,InstanceType=m5.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m5.xlarge 
--region eu-central-1 --log-uri s3://………….../logs/ --no-termination-protected

然后我安装了jupytersudo pip3 install jupyter

然后我再次登录ssh -i "…………...pem" -L 8888:localhost:8888 hadoop@ec2-…………..compute.amazonaws.com

,运行命令jupyter notebook并从屏幕上的链接转到网页。

直到这一步一切都很顺利,但是当我尝试使用 pyspark 内核运行笔记本时,我得到了“内核错误”

我不完全明白为什么会这样。当我从命令行运行pyspark时,没有错误。

我该怎么做才能在没有任何错误的情况下使用 pyspark 内核运行 jupyter?1.

标签: pysparkjupyter-notebookamazon-emr

解决方案


推荐阅读