【问题标题】:How to deploy a nutch job on google dataproc?如何在 google dataproc 上部署 nutch 作业?
【发布时间】:2023-03-18 16:34:01
【问题描述】:

我一直在尝试在我的 Google Hadoop dataproc 集群上部署一个 nutch 作业(使用自定义插件),但我遇到了很多错误(我怀疑是一些基本错误)。

我需要有关如何执行此操作的分步明确指南。该指南应包括如何在 gs 存储桶和本地文件系统(Windows 7)上设置权限和访问文件。

我试过这个配置,但没有成功:

Region: global
Cluster: first-cluster
Job type: Hadoop
Jar files gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/depl‌​oy/apache-nutch-1.12‌​-SNAPSHOT.job
Main class or jar: gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-<p>asia/ deploy/bin/nutch
Arguments: gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/seed‌​.txt, -depth 4

我也试过了:

Region: global 
Cluster: first-cluster
Job type: Hadoop
Jar files gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/depl‌​oy/apache-nutch-1.12‌​-SNAPSHOT.job
Main class or jar: gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/ deploy/bin/crawl
Arguments: gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/seed‌​.txt, -depth 4

还有:

Region: global
Cluster: first-cluster
Job type: Hadoop
Jar files gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/depl‌​oy/apache-nutch-1.12‌​-SNAPSHOT.job
Main class or jar: org.apache.nutch.crawl.Crawl
Arguments: gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/seed‌​.txt, -depth 4

跟进:我已经取得了一些进展,但我现在收到此错误:

17/07/28 18:59:11 INFO crawl.Injector: Injector: 从 2017-07-28 18:59:11 开始 17/07/28 18:59:11 INFO crawl.Injector: Injector: crawlDb: https://console.cloud.google.com/storage/browser/dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/deploy /网址 17/07/28 18:59:11 INFO crawl.Injector: Injector: urlDir: https://console.cloud.google.com/storage/browser/dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/deploy /crawlDb 17/07/28 18:59:11 INFO Configuration.deprecation:mapred.temp.dir 已弃用。相反,使用 mapreduce.cluster.temp.dir 17/07/28 18:59:11 INFO crawl.Injector: Injector: 将注入的 url 转换为爬取数据库条目。 17/07/28 18:59:11 信息 gcs.GoogleHadoopFileSystemBase:GHFS 版本:1.6.1-hadoop2 17/07/28 18:59:11 ERROR crawl.Injector: Injector: java.lang.IllegalArgumentException: Wrong FS: https://console.cloud.google.com/storage/browser/dataproc-60f583ce-a087-42b1- a62e-4319584631d3-asia/deploy/urls,预期:hdfs://first-cluster-m 在 org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:648) 在 org.apache.hadoop.hdfs.DistributedFileSystem.getPathName(DistributedFileSystem.java:194) 在 org.apache.hadoop.hdfs.DistributedFileSystem.access$000(DistributedFileSystem.java:106) 在 org.apache.hadoop.hdfs.DistributedFileSystem$22.doCall(DistributedFileSystem.java:1305) 在 org.apache.hadoop.hdfs.DistributedFileSystem$22.doCall(DistributedFileSystem.java:1301) 在 org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81) 在 org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1301) 在 org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1426) 在 org.apache.nutch.crawl.Injector.inject(Injector.java:298) 在 org.apache.nutch.crawl.Injector.run(Injector.java:379) 在 org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) 在 org.apache.nutch.crawl.Injector.main(Injector.java:369) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:498) 在 com.google.cloud.hadoop.services.agent.job.shim.HadoopRunClassShim.main(HadoopRunClassShim.java:19)

我知道这与文件系统有关。如何访问 gcp 文件系统和 hadoop 文件?

跟进:我在这个配置上取得了一些进展:

{ "reference": { "projectId": "ageless-valor-174413", "jobId": "108a7d43-671a-4f61-8ba8-b87010a8a823" }, "placement": { "clusterName": "first-cluster", "clusterUuid": "f3795563-bd44-4896-bec7-0eb81a3f685a" }, "status": { "state": "ERROR", "details": "Google Cloud Dataproc Agent reports job failure. If logs are available, they can be found in 'gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/google-cloud-dataproc-metainfo/f3795563-bd44-4896-bec7-0eb81a3f685a/jobs/108a7d43-671a-4f61-8ba8-b87010a8a823/driveroutput'.", "stateStartTime": "2017-07-28T18:59:13.518Z" }, "statusHistory": [ { "state": "PENDING", "stateStartTime": "2017-07-28T18:58:57.660Z" }, { "state": "SETUP_DONE", "stateStartTime": "2017-07-28T18:59:00.811Z" }, { "state": "RUNNING", "stateStartTime": "2017-07-28T18:59:02.347Z" } ], "driverOutputResourceUri": "gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/google-cloud-dataproc-metainfo/f3795563-bd44-4896-bec7-0eb81a3f685a/jobs/108a7d43-671a-4f61-8ba8-b87010a8a823/driveroutput", "driverControlFilesUri": "gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/google-cloud-dataproc-metainfo/f3795563-bd44-4896-bec7-0eb81a3f685a/jobs/108a7d43-671a-4f61-8ba8-b87010a8a823/", "hadoopJob": { "mainClass": "org.apache.nutch.crawl.Injector", "args": [ "https://console.cloud.google.com/storage/browser/dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/deploy/urls/", "https://console.cloud.google.com/storage/browser/dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/deploy/crawlDb/" ], "jarFileUris": [ "gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/deploy/apache-nutch-1.12-SNAPSHOT.job" ], "loggingConfig": {} } }

但我现在收到此错误:

17/07/28 18:59:11 INFO crawl.Injector: Injector: 从 2017-07-28 18:59:11 开始 17/07/28 18:59:11 INFO crawl.Injector: Injector: crawlDb: https://console.cloud.google.com/storage/browser/dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/deploy /网址 17/07/28 18:59:11 INFO crawl.Injector: Injector: urlDir: https://console.cloud.google.com/storage/browser/dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/deploy /crawlDb 17/07/28 18:59:11 INFO Configuration.deprecation:mapred.temp.dir 已弃用。相反,使用 mapreduce.cluster.temp.dir 17/07/28 18:59:11 INFO crawl.Injector: Injector: 将注入的 url 转换为爬取数据库条目。 17/07/28 18:59:11 信息 gcs.GoogleHadoopFileSystemBase:GHFS 版本:1.6.1-hadoop2 17/07/28 18:59:11 ERROR crawl.Injector: Injector: java.lang.IllegalArgumentException: Wrong FS: https://console.cloud.google.com/storage/browser/dataproc-60f583ce-a087-42b1- a62e-4319584631d3-asia/deploy/urls,预期:hdfs://first-cluster-m 在 org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:648) 在 org.apache.hadoop.hdfs.DistributedFileSystem.getPathName(DistributedFileSystem.java:194) 在 org.apache.hadoop.hdfs.DistributedFileSystem.access$000(DistributedFileSystem.java:106) 在 org.apache.hadoop.hdfs.DistributedFileSystem$22.doCall(DistributedFileSystem.java:1305) 在 org.apache.hadoop.hdfs.DistributedFileSystem$22.doCall(DistributedFileSystem.java:1301) 在 org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81) 在 org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1301) 在 org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1426) 在 org.apache.nutch.crawl.Injector.inject(Injector.java:298) 在 org.apache.nutch.crawl.Injector.run(Injector.java:379) 在 org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) 在 org.apache.nutch.crawl.Injector.main(Injector.java:369) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:498) 在 com.google.cloud.hadoop.services.agent.job.shim.HadoopRunClassShim.main(HadoopRunClassShim.java:19)

【问题讨论】:

  • 这太宽泛了,很可能会关闭。您最好展示您尝试过的内容,包括您提到的那些错误,然后有人可以提供帮助。
  • 我已经尝试过这个配置,但没有成功 Region global Cluster first-cluster Job type Hadoop Jar files gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/deploy/apache- nutch-1.12-SNAPSHOT.job 主类或 jar gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/ deploy/bin/'nutch 参数 gs://dataproc-60f583ce-a087-42b1-a62e- 4319584631d3-asia/seed.txt -depth 4

标签: hadoop nutch google-cloud-dataproc


【解决方案1】:

您可以通过使用正确的方案(gs)引用google云存储文件,然后将默认文件系统更改为google云存储来解决此问题。

第 1 步:

替换
https://console.cloud.google.com/storage/browser/dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/deploy/urls

gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia/deploy/urls

第 2 步:

将以下属性添加到您的 nutch-site.xml 文件中:

<property> <name>fs.defaultFS</name> <value>gs://dataproc-60f583ce-a087-42b1-a62e-4319584631d3-asia</value> <description>The name of the default file system. A URI whose scheme and authority determine the FileSystem implementation. The uri's scheme determines the config property (fs.SCHEME.impl) naming the FileSystem implementation class. The uri's authority is used to determine the host, port, etc. for a filesystem.</description> </property>

(在旧版本的 hadoop 中,此属性称为“fs.default.name”。)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-03-13
    • 1970-01-01
    • 1970-01-01
    • 2018-07-04
    • 1970-01-01
    • 2019-12-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多