向dataprocsqoop提交作业时出现问题

pxq42qpu  于 2021-05-27  发布在  Hadoop
关注(0)|答案(1)|浏览(360)

我对apachesqoop非常陌生。我在gcp中创建了dataproc集群,并尝试使用以下命令提交sqoop作业:

gcloud dataproc jobs submit hadoop --cluster cluster123 --class=org.apache.sqoop.Sqoop --import -Dmapreduce.job.user.classpath.first=true --jars=gs://bucket123/sqoop-1.4.7-hadoop260.jar,gs://bucket123/mssql-jdbc-8.4.1.jre11.jar --connect="jdbc:sqlserver://server_ip:1433/db_name" --username=sql_user --password-file=gs://bucket123/password.txt --target-dir gs://bucket123/mssql-output-folder/ --table=table123

获取以下错误:

ERROR: (gcloud.dataproc.jobs.submit.hadoop) unrecognized arguments:
  --import (did you mean '--format'?)
  -Dmapreduce.job.user.classpath.first=true
  --connect=jdbc:sqlserver://server_ip:1433/table123 (did you mean '--project'?)
  --username=sqlserver (did you mean '--cluster'?)
  --password-file=gs://bucket123/password.txt (did you mean '--flags-file'?)
  --target-dir
  gs://bucket123/mssql-output-folder/
  --table=test1 (did you mean '--labels'?)
  To search the help text of gcloud commands, run:
  gcloud help -- SEARCH_TERMS
toe95027

toe950271#

在命令中添加作业参数之前,需要将“--”。
试试这个:

gcloud dataproc jobs submit hadoop \
  --cluster cluster123 \
  --class=org.apache.sqoop.Sqoop \
  --jars=gs://bucket123/sqoop-1.4.7-hadoop260.jar,gs://bucket123/mssql-jdbc-8.4.1.jre11.jar \
  -- \
  --import -Dmapreduce.job.user.classpath.first=true --connect="jdbc:sqlserver://server_ip:1433/db_name" --username=sql_user --password-file=gs://bucket123/password.txt --target-dir gs://bucket123/mssql-output-folder/ --table=table123

相关问题