未定义IBM Bluemix sc [英] IBM Bluemix sc not defined

查看:89
本文介绍了未定义IBM Bluemix sc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在IBM Bluemix上运行为Apache Spark服务提供的示例之一时,出现以下错误:

I am getting the following error when I try to run one of the samples that is given for the Apache Spark service on IBM Bluemix:

NameErrorTraceback (most recent call last)
<ipython-input-5-7de9805c358e> in <module>()
----> 1 set_hadoop_config(credentials_1)

<ipython-input-2-e790e4773aec> in set_hadoop_config(credentials)
      1 def set_hadoop_config(credentials):
      2     prefix = "fs.swift.service." + credentials['name']
----> 3     hconf = sc._jsc.hadoopConfiguration()
      4     hconf.set(prefix + ".auth.url", credentials['auth_url']+'/v3/auth/tokens')
      5     hconf.set(prefix + ".auth.endpoint.prefix", "endpoints")

NameError: global name 'sc' is not defined

我正在使用数据源面板上的插入代码选项加载一个简单的CSV文件.但是,生成的凭据中没有'name'属性.

I am loading a simple CSV file using the insert to code options on the data sources palette. However, the credentials that are generated do not have the 'name' attribute in it.

credentials['name']不在我单击插入代码后生成的键值对中.

credentials['name'] is not in the key value pairs that are generated after I click on insert to code.

我想知道是否还有其他方法可以加载数据,或者是否是IBM Bluemix问题.

I want to know if there is any other way to load the data or this issue an IBM Bluemix issue.

推荐答案

您被Bluemix问题打中了.默认情况下定义sc变量,其中保留一个SparkContext.但是,如果Python笔记本内核启动时Spark master无法访问,您会注意到延迟了几秒钟,然后内核启动了,但sc尚未定义. 您的任务已经有两天了(它是否缺少标签之一?),所以事情应该已经恢复了.请再试一次.如果失败,请重新启动内核.如果仍然没有sc,请联系Bluemix支持以解决Apache Spark服务的问题.

You were hit by a Bluemix issue. The sc variable is defined by default, holding a SparkContext. But if the Spark master is not reachable when the Python notebook kernel starts, you'll notice a delay of several seconds, then the kernel comes up but sc is undefined. Your queston is already two days old (was it missing one of the tags?), so things should have recovered by now. Just give it another try. If it fails, restart the kernel. If you still got no sc, contact Bluemix support about an issue with the Apache Spark service.

这篇关于未定义IBM Bluemix sc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆