运行hadoop群集时在google云平台上获取“sudo:unknown user:hadoop”和“sudo:unable to initialized policy plugin error”

hpxqektj  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(999)

我正在尝试部署google提供的示例hadoop应用程序https://github.com/googlecloudplatform/solutions-google-compute-engine-cluster-for-hadoop 在谷歌云平台上。
我一步一步地按照上面给出的安装说明进行操作。我成功地设置了环境并启动了集群。但是我不能运行mapreduce部分。我正在终端上执行此命令:

./compute_cluster_for_hadoop.py mapreduce <project ID> <bucket name> [--prefix <prefix>]
--input gs://<input directory on Google Cloud Storage>  \
--output gs://<output directory on Google Cloud Storage>  \
--mapper sample/shortest-to-longest-mapper.pl  \
--reducer sample/shortest-to-longest-reducer.pl  \
--mapper-count 5  \
--reducer-count 1

我得到以下错误:

sudo: unknown user: hadoop
sudo: unable to initialize policy plugin
Traceback (most recent call last):
File "./compute_cluster_for_hadoop.py", line 230, in <module>
main()
File "./compute_cluster_for_hadoop.py", line 226, in main
ComputeClusterForHadoop().ParseArgumentsAndExecute(sys.argv[1:])
File "./compute_cluster_for_hadoop.py", line 222, in ParseArgumentsAndExecute
params.handler(params)
File "./compute_cluster_for_hadoop.py", line 51, in MapReduce
gce_cluster.GceCluster(flags).StartMapReduce()
File "/home/ubuntu-gnome/Hadoop-sample-app/solutions-google-compute-engine-cluster-for-hadoop-master/gce_cluster.py", line 545, in StartMapReduce
input_dir, output_dir)
File "/home/ubuntu-gnome/Hadoop-sample-app/solutions-google-compute-engine-cluster-for-hadoop-master/gce_cluster.py", line 462, in _StartScriptAtMaster
raise RemoteExecutionError('Remote execution error')
gce_cluster.RemoteExecutionError: Remote execution error

既然我已经按照上面的步骤做了,我就不明白为什么会出现这个问题?
“hadoop”用户实际上不是在以前执行的脚本中创建的,还是用户权限有问题?或者问题出在别的地方?
请帮我解决这个错误。。!!我被困在这里,不能再往前走了。

zfciruhq

zfciruhq1#

安装过程通常会自动创建用户“hadoop”;在第75-76行的startup-script.sh中完成:


# Set up user and group

groupadd --gid 5555 hadoop
useradd --uid 1111 --gid hadoop --shell /bin/bash -m hadoop

有可能安装程序的某些部分实际上失败了。
也就是说,如果您正在编写自己的python应用程序,直接与gceapi交互,那么您所引用的示例作为一个起点仍然很有用,但是作为在google计算引擎上部署hadoop的一种方式,它是不受欢迎的。如果您真的想使用hadoop,那么应该使用google支持的部署工具bdutil及其关联的quickstart。在部署的集群中有一些相似之处,包括用户的设置 hadoop . 然而,关键的区别在于 bdutil 还将包括并配置用于hadoop的gcs连接器,以便mapreduce可以直接针对gcs中的数据进行操作,而不需要首先将其复制到hdfs中。

相关问题