1

I'm running windows 8 and would like to launch a spark cluster. I'm using the this tutorial. It isn't running with windows CLI, so I tried installing and using cygwin. With that I was able to change the environment variables and also run the ec2 script but I get the error:

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

So I'm stuck here. I saw that in This Question it was suggested to run the python file directly, which is actually what I want to do, but I'm not sure how. e.g. When you run the script, you have to specify things like

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

How do you tell that to the python script?

Community
  • 1
  • 1
Elliott Miller
  • 355
  • 2
  • 5
  • 13
  • The error is clear: Your problem is that the permissions on your `pem` file are incorrect. Have you tried running the suggested fix using `chmod`? – Nick Chammas Aug 03 '15 at 18:17

2 Answers2

4

I ran into the same issue with on windows 10. Luckily the file permission requirements are coded into the spark_ec2.py script, and are not a fundamental limitation of the AWS python API.

I ended up commenting out the following lines in the spark_ec2.py script:

        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)
spinwards
  • 41
  • 2
0

Simply run the suggested fix; Like this:

$ chmod 400 "SpakPlaygroundKeyPair.pem"

This should give only you read permissions to the pem file.

Emaasit
  • 31
  • 1
  • 7