我是流星新手,刚使用帐户谷歌遇到问题(见下文).我所做的只是按照http://docs.meteor.com/#meteor_loginwithexternalservice上的说明进行操作.有关如何解决此问题并使Google登录正常工作的任何想法?谢谢!
终端输出:
W20141003-09:42:57.115(7)? (STDERR)
W20141003-09:42:57.116(7)? (STDERR) /Users/aw/.meteor/packages/meteor-tool/.1.0.33.alt9dq++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
W20141003-09:42:57.116(7)? (STDERR) throw(ex);
W20141003-09:42:57.117(7)? (STDERR) ^
W20141003-09:42:57.118(7)? (STDERR) ReferenceError: ServiceConfiguration is not defined
W20141003-09:42:57.119(7)? (STDERR) at app/server/accounts.js:26:1
W20141003-09:42:57.120(7)? (STDERR) at app/server/accounts.js:35:3
W20141003-09:42:57.120(7)? (STDERR) at /Users/aw/TS/.meteor/local/build/programs/server/boot.js:168:10
W20141003-09:42:57.120(7)? (STDERR) at Array.forEach (native)
W20141003-09:42:57.121(7)? (STDERR) at Function._.each._.forEach (/Users/aw/.meteor/packages/meteor-tool/.1.0.33.alt9dq++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
W20141003-09:42:57.121(7)? (STDERR) at /Users/aw/TS/.meteor/local/build/programs/server/boot.js:82:5
=> Exited with code: 8
Run Code Online (Sandbox Code Playgroud)
当我注释掉我的服务配置代码时(如下)
// first, remove configuration entry in case service is already configured
ServiceConfiguration.configurations.remove({
service: "google"
});
ServiceConfiguration.configurations.insert({
service: "google",
clientId: "xxxxxxxx",
secret: "xxxxxxxxx"
});
Run Code Online (Sandbox Code Playgroud)
它要求我从bootstrap下拉列表中输入clientId和secret.那之后没有任何事情发生.
添加service-configuration后,登录后收到以下错误:

我已按照此帖子中的说明从现有 Postgres 数据库中读取数据,该数据库中的表名为“对象”,该表由ObjectsSQLalchemy 中的类定义和创建。在我的 Jupyter 笔记本中,我的代码是
from pyspark import SparkContext
from pyspark import SparkConf
from random import random
#spark conf
conf = SparkConf()
conf.setMaster("local[*]")
conf.setAppName('pyspark')
sc = SparkContext(conf=conf)
from pyspark.sql import SQLContext
sqlContext = SQLContext(sc)
properties = {
"driver": "org.postgresql.Driver"
}
url = 'jdbc:postgresql://PG_USER:PASSWORD@PG_SERVER_IP/db_name'
df = sqlContext.read.jdbc(url=url, table='objects', properties=properties)
Run Code Online (Sandbox Code Playgroud)
最后一行结果如下:
Py4JJavaError: An error occurred while calling o25.jdbc.
: java.lang.NullPointerException
at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:158)
at org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation.<init>(JDBCRelation.scala:117)
at org.apache.spark.sql.DataFrameReader.jdbc(DataFrameReader.scala:237)
at org.apache.spark.sql.DataFrameReader.jdbc(DataFrameReader.scala:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) …Run Code Online (Sandbox Code Playgroud) 我正在将Postgres数据库导入Spark。我知道我可以在导入时进行分区,但是这需要我有一个数字列(我不想使用该value列,因为它到处都是而且不保持顺序):
df = spark.read.format('jdbc').options(url=url, dbtable='tableName', properties=properties).load()
df.printSchema()
root
|-- id: string (nullable = false)
|-- timestamp: timestamp (nullable = false)
|-- key: string (nullable = false)
|-- value: double (nullable = false)
Run Code Online (Sandbox Code Playgroud)
相反,我将数据帧转换为(枚举元组的)rdd,并尝试对其进行分区:
rdd = df.rdd.flatMap(lambda x: enumerate(x)).partitionBy(20)
Run Code Online (Sandbox Code Playgroud)
请注意,我20之所以使用,是因为我的集群中有5个工人,每个工人有一个核心5*4=20。
不幸的是,以下命令仍然需要永远执行:
result = rdd.first()
Run Code Online (Sandbox Code Playgroud)
因此,我想知道我上面的逻辑是否有意义?我做错什么了吗?从Web GUI来看,好像没有使用工作程序:
我在 EST 并尝试使用date.today(),但它第二天就会返回。文档指出应该是当地时间。有谁知道我怎样才能让它返回我的本地(EST)日期?
classmethod date.today() 返回当前本地日期。这相当于 date.fromtimestamp(time.time())。
https://docs.python.org/2/library/datetime.html#date-objects
更新:澄清一下,它在大多数情况下都有效,除了我在东部时间晚上 10 点左右尝试的时候。我检查了我的时区time.strftime('%X %x %Z'),它看起来像 UTC。鉴于这种情况,我如何获得今天的日期?请注意,我想保留系统 UTC,同时获取 EST 日期。
我找不到与我的问题相关的现有帖子.在数字海洋Droplet上,mup设置很好,但是当我尝试部署时,我收到以下错误.有任何想法吗?谢谢!
root@ts:~/ts-deploy# mup deploy
Meteor Up: Production Quality Meteor Deployments
Building Started: /root/TS/
Bundling Error: code=137, error:
-------------------STDOUT-------------------
Figuring out the best package versions to use. This may take a moment.
-------------------STDERR-------------------
bash: line 1: 31217 Killed meteor build --directory /tmp/dc37af3e-eca0-4a19-bf1a-d6d38bb8f517
Run Code Online (Sandbox Code Playgroud)
以下是日志.node -v表示我使用的是0.10.31.如何检查哪个脚本正在退出并显示错误?还有其他想法吗?谢谢!
error: Forever detected script exited with code: 1
error: Script restart attempt #106
Meteor requires Node v0.10.29 or later.
error: Forever detected script exited with code: 1
error: Script restart attempt #107
Meteor requires Node v0.10.29 or …Run Code Online (Sandbox Code Playgroud) apache-spark ×2
jdbc ×2
meteor ×2
postgresql ×2
pyspark ×2
date ×1
datetime ×1
google-api ×1
meteor-up ×1
oauth-2.0 ×1
python ×1
rdd ×1