【问题标题】:Launching a spark ec2 cluster from windows从 Windows 启动 spark ec2 集群
【发布时间】:2015-10-24 21:49:09
【问题描述】:

我正在运行 Windows 8 并想启动一个 spark 集群。我正在使用this tutorial。它没有使用 Windows CLI 运行,所以我尝试安装和使用 cygwin。这样我就可以更改环境变量并运行 ec2 脚本,但出现错误:

ERROR: The identity file must be accessible only by you.
You can fix this with: chmod 400 "SpakPlaygroundKeyPair.pem"

所以我被困在这里。我在This Question看到有人建议直接运行python文件,这实际上是我想做的,但我不确定如何。例如运行脚本时,您必须指定诸如

之类的内容
 --key-pair=SpakPlaygroundKeyPair --identity-file=SpakPlaygroundKeyPair.pem --region=us-east-1 --zone=us-east-1a --instance-type=t2.micro launch my-spark-cluster

你是怎么告诉python脚本的?

【问题讨论】:

  • 错误很明显:您的问题是您的pem文件的权限不正确。您是否尝试过使用 chmod 运行建议的修复程序?

标签: python amazon-web-services amazon-ec2 apache-spark


【解决方案1】:

我在 Windows 10 上遇到了同样的问题。幸运的是,文件权限要求已编码到 spark_ec2.py 脚本中,并且不是 AWS python API 的基本限制。

我最终在 spark_ec2.py 脚本中注释掉了以下几行:

        if not (file_mode & S_IRUSR) or not oct(file_mode)[-2:] == '00':
        print("ERROR: The identity file must be accessible only by you.", file=stderr)
        print('You can fix this with: chmod 400 "{f}"'.format(f=opts.identity_file),
              file=stderr)
        sys.exit(1)

【讨论】:

    【解决方案2】:

    只需运行建议的修复程序;像这样:

    $ chmod 400 "SpakPlaygroundKeyPair.pem"
    

    这应该只授予您对 pem 文件的读取权限。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-12
      • 1970-01-01
      • 1970-01-01
      • 2017-05-26
      • 2014-10-07
      • 2018-06-25
      • 1970-01-01
      • 2015-03-16
      相关资源
      最近更新 更多