Vespa教程 - Pig无法连接到本地Vespa端点:URISyntaxException

时间:2017-10-16 06:22:30

标签: vespa

当关注Vespa's tutorial about blog recommendation时,在使用ENDPOINT=$(hostname):8080从命令行调用Pig时,我遇到了连接到本地Vespa端点的问题:

ERROR org.apache.pig.PigServer - exception during parsing: Error during parsing. Pig script failed to parse: 
<file tutorial_feed_content_and_tensor_vespa.pig, line 131, column 0> pig script failed to validate:
  java.lang.IllegalArgumentException: 
  java.net.URISyntaxException: Relative path in absolute URI: localhost:8080

对于不熟悉Pig的人来说,这有点令人沮丧。按照教程的步骤进行操作。

接受的答案可以获得正确的端口集。 Problem with Handshake flying-otter.local:8080仍然是一个问题,但可能不相关。

编辑添加,如果有任何用途:Problem with Handshake似乎在应用程序未激活时发生(即已部署但忘记执行下一步)。

2 个答案:

答案 0 :(得分:2)

据我所知,由于Pig检查字符串是否是正确的URI,因此失败。

不那么明显的解决方案(至少在开始......)只是在主机名前添加http://,使其成为有效的URI ENDPOINT="http://localhost:8080"

因此对Pig的完整调用变为:

pig -x local -f tutorial_feed_content_and_tensor_vespa.pig \
    -param VESPA_HADOOP_JAR=vespa-hadoop.jar \
    -param DATA_PATH=trainPosts.json \
    -param TEST_INDICES=blog-job/training_and_test_indices/testing_set_ids \
    -param BLOG_POST_FACTORS=blog-job/user_item_cf/product_features \
    -param USER_FACTORS=blog-job/user_item_cf/user_features \
    -param ENDPOINT=http://$(hostname):8080

编辑:好吧,在运行了一段时间之后,问题现在变成了,所以在验证URI时,猪似乎还是添加了默认端口。

 com.yahoo.vespa.http.client.core.communication.IOThread cycle
     INFO: Problem with Handshake localhost:8080:4080 ssl=false

此时我刚用socat将4080端口重新连接到8080,以避免重新启动docker vm:/ socat tcp-listen:4080,reuseaddr,fork tcp:localhost:8080

答案 1 :(得分:2)

正确使用

-param ENDPOINT=$(hostname) -D vespa.feed.defaultport=8080 

我看到你通过重新连接端口来解决它,但使用-Dvespa.feed.defaultport对于生产用例会更好。

https://github.com/vespa-engine/vespa/pull/3576