0

在此 ML 文档之后,我使用文档中的配置运行示例 marklogic-hello-world.xml。我的本地主机名称是ubuntu.localdomain. 当我在我的配置文件中给出相同的值时,它会抛出这样的错误

    18/01/04 22:39:54 INFO mapred.MapTask: (EQUATOR) 0 kvi 26214396(104857584)
18/01/04 22:39:54 INFO mapred.MapTask: mapreduce.task.io.sort.mb: 100
18/01/04 22:39:54 INFO mapred.MapTask: soft limit at 83886080
18/01/04 22:39:54 INFO mapred.MapTask: bufstart = 0; bufvoid = 104857600
18/01/04 22:39:54 INFO mapred.MapTask: kvstart = 26214396; length = 6553600
18/01/04 22:39:54 INFO mapred.MapTask: Map output collector class = org.apache.hadoop.mapred.MapTask$MapOutputBuffer
18/01/04 22:40:05 INFO mapred.MapTask: Starting flush of map output
18/01/04 22:40:05 INFO mapred.LocalJobRunner: map task executor complete.
18/01/04 22:40:05 WARN mapred.LocalJobRunner: job_local196795803_0001
java.lang.Exception: java.lang.IllegalArgumentException: Default provider - Not a usable net address: ubuntu.localdomain:8000
    at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
    at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)
Caused by: java.lang.IllegalArgumentException: Default provider - Not a usable net address: ubuntu.localdomain:8000
    at com.marklogic.xcc.ContentSourceFactory.defaultConnectionProvider(ContentSourceFactory.java:453)
    at com.marklogic.xcc.ContentSourceFactory.newContentSource(ContentSourceFactory.java:264)
    at com.marklogic.xcc.ContentSourceFactory.newContentSource(ContentSourceFactory.java:321)
    at com.marklogic.mapreduce.utilities.InternalUtilities.getInputContentSource(InternalUtilities.java:127)
    at com.marklogic.mapreduce.MarkLogicRecordReader.init(MarkLogicRecordReader.java:348)
    at com.marklogic.mapreduce.MarkLogicRecordReader.initialize(MarkLogicRecordReader.java:247)
    at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.initialize(MapTask.java:548)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:786)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
    at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:243)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.base/java.lang.Thread.run(Thread.java:844)
18/01/04 22:40:05 INFO mapreduce.Job: Job job_local196795803_0001 failed with state FAILED due to: NA
18/01/04 22:40:05 INFO mapreduce.Job: Counters: 0

我的配置文件是这样的

<configuration>
    <property>
        <name>mapreduce.marklogic.input.username</name>
        <value>admin</value>
    </property>
    <property>
        <name>mapreduce.marklogic.input.password</name>
        <value>admin</value>
    </property>
    <property>
        <name>mapreduce.marklogic.input.host</name>
        <value>ubuntu.localdomain</value>
    </property>
    <property>
        <name>mapreduce.marklogic.input.port</name>
        <value>8000</value>
    </property>
    <property>
        <name>mapreduce.marklogic.input.mode</name>
        <value>basic</value>
    </property>
    <property>
        <name>mapreduce.marklogic.input.valueclass</name>
        <value>com.marklogic.mapreduce.DatabaseDocument</value>
    </property>
    <property>
        <name>mapreduce.marklogic.output.username</name>
        <value>admin</value>
    </property>
    <property>
        <name>mapreduce.marklogic.output.password</name>
        <value>admin</value>
    </property>
    <property>
        <name>mapreduce.marklogic.output.host</name>
        <value>ubuntu.localdomain</value>
    </property>
    <property>
        <name>mapreduce.marklogic.output.port</name>
        <value>8000</value>
    </property>
    <property>
        <name>mapreduce.marklogic.output.content.type</name>
        <value>TEXT</value>
    </property>
</configuration>

我曾尝试为此提供各种名称,mapreduce.marklogic.input.host我尝试使用127.0.0.1&localhost但默认情况下使用ubuntu.localdomain.

我不知道为什么它采用默认值而不是采用我在 configuration.xml 文件(即127.0.0.1等)中指定的那个。

我使用下面的命令来运行它

hadoop jar \
  $CONNECTOR_HOME/lib/marklogic-mapreduce-examples-version.jar \
  com.marklogic.mapreduce.examples.HelloWorld -libjars $LIBJARS \
  -conf marklogic-hello-world.xml

如文档中指定。

我怎样才能克服这个?任何帮助表示赞赏..

谢谢

4

1 回答 1

0

通过将 Marklogic 配置页面中的 localhost 名称从 更改为 解决了该问题,ubuntu.localdomain然后localhost上述配置运行良好。但仍然无法找到为什么它不hostname从配置文件中选择而不是去 ML 。

于 2018-01-06T02:28:34.253 回答