我尝试按照本教程运行mapreduce。
我将mrjob.conf, readme.txt和word_count.py文件上传到EC2实例的~/hello_mapreduce文件夹中,并尝试运行命令:
python word_count.py -r emr README.txt
返回以下内容:
no configs found; falling back on auto-configuration
no configs found; falling back on auto-configuration
Traceback (most recent call last):
File "word_count.py", line 21, in <module>
MRWordFrequencyCount.run()
File "/usr/local/lib/python2.7/dist-packages/mrjob/job.py", line 494, in run
mr_job.execute()
File "/usr/local/lib/python2.7/dist-packages/mrjob/job.py", line 512, in execute
super(MRJob, self).execute()
File "/usr/local/lib/python2.7/dist-packages/mrjob/launch.py", line 147, in execute
self.run_job()
File "/usr/local/lib/python2.7/dist-packages/mrjob/launch.py", line 207, in run_job
with self.make_runner() as runner:
File "/usr/local/lib/python2.7/dist-packages/mrjob/job.py", line 535, in make_runner
return super(MRJob, self).make_runner()
File "/usr/local/lib/python2.7/dist-packages/mrjob/launch.py", line 162, in make_runner
return EMRJobRunner(**self.emr_job_runner_kwargs())
File "/usr/local/lib/python2.7/dist-packages/mrjob/emr.py", line 579, in __init__
self._fix_s3_scratch_and_log_uri_opts()
File "/usr/local/lib/python2.7/dist-packages/mrjob/emr.py", line 664, in _fix_s3_scratch_and_log_uri_opts
s3_conn = self.make_s3_conn()
File "/usr/local/lib/python2.7/dist-packages/mrjob/fs/s3.py", line 226, in make_s3_conn
host=self._s3_endpoint)
File "/usr/lib/python2.7/dist-packages/boto/__init__.py", line 108, in connect_s3
return S3Connection(aws_access_key_id, aws_secret_access_key, **kwargs)
File "/usr/lib/python2.7/dist-packages/boto/s3/connection.py", line 154, in __init__
suppress_consec_slashes=suppress_consec_slashes)
File "/usr/lib/python2.7/dist-packages/boto/connection.py", line 486, in __init__
host, config, self.provider, self._required_auth_capability())
File "/usr/lib/python2.7/dist-packages/boto/auth.py", line 406, in get_auth_handler
'Check your credentials' % (len(names), str(names)))
boto.exception.NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV1Handler'] Check your credentials
我可能是错的,但我猜可能的/主要问题是,文件mrjob.conf是不可见的,但不知道为什么。
mrjob.conf的内容如下:
runners:
emr:
aws_access_key_id: xxxxx
aws_secret_access_key: xxxxxxxxxx
ec2_key_pair: EMR
ec2_key_pair_file: ~/.ssh/EMR.pem # ~/ and $ENV_VARS allowed here
ssh_tunnel_to_job_tracker: true
作为一个AWS用户新手,如果有人能帮助解决这个问题,以便使用mrjob和AWS成功运行mapreduce,我将非常感谢。
谢谢!
已解决。
我使用命令(显式定义位置)运行作业:
python word_count.py -r emr readme.txt --conf-path mrjob.conf
和用于建立SSH连接的行从.conf文件中删除:
runners:
emr:
aws_access_key_id: xxxxx
aws_secret_access_key: xxxxxxxxxx