【问题标题】:jfrog artifactory could not validate router errorjfrog artifactory 无法验证路由器错误
【发布时间】:2021-08-31 23:40:27
【问题描述】:

当我下载、解压并启动 artifactory.sh 时,我看到以下错误

2020-02-26T21:32:50.496Z [jfac ] [ERROR] [c1b4de79a3f11666] [.j.a.s.s.r.JoinServiceImpl:253] [http-nio-8040-exec-1] - Could not validate router Check-url: http://XXXXXX:8082/router/api/v1/system/ping

然后

2020-02-26T21:32:55.636Z [jfac ] [WARN ] [67b9d42698f5614c] [o.j.c.ExecutionUtils:141      ] [pool-6-thread-2     ] - Retry 20 Elapsed 9.04 secs failed: Registration with router on URL http://localhost:8046 failed with error: UNAVAILABLE: io exception. Trying again

我意识到我遗漏了一些明显的东西,但还没有弄清楚。有什么建议么?谢谢。

【问题讨论】:

  • 我已尝试全新安装,问题仍然存在。

标签: artifactory


【解决方案1】:

Alexey,我怀疑 ipv6 ip 被 start-script 拾取,导致了这个。

您可以使用以下内容更新您的 system.yaml(将在 var/etc/ 文件夹中)并尝试吗?

shared:
    node:
        ip: <your ipv4 IP>

【讨论】:

  • Prasanna,感谢您的建议。我尝试了 127.0.0.1 和分配给我的机器的特定 IPv4。但这并没有什么不同。我仍然在日志中看到 IPv6。
  • 我假设你重启了?你可以发送 router-service.log 的初始部分 - 它记录它选择的 SHARED_NODE_IP 吗?
  • 鉴于它没有启动,我不会让它继续运行。所以我总是启动./artifactory.sh。按照指示将127.0.0.1 放入system.yaml,我在终端上看到这个2020-03-03T11:12:08.556Z [shell] [INFO ] [] [installerCommon.sh:2518 ] [main] - Setting JF_SHARED_NODE_IP to fe80::20ac:2da:2a77:51ab%enp0s31f6 然后JF_SHARED_NODE_IP : fe80::20ac:2da:2a77:51ab%enp0s31f6 然后2020-03-03T11:16:06.821Z [jfrou] [INFO ] [ ] [bootstrap.go:73 ] [main ] - JFrog Router IP: fe80::20ac:2da:2a77:51ab%enp0s31f6 进入router-service.log
  • 共享:##节点设置节点:##默认:由启动脚本自动解析ip:127.0.0.1
  • Prasanna,您在system.yaml 中设置ip 的建议实际上解决了这个问题。它最初对我不起作用的原因是该文件在开始时显然已重新格式化。 #ip 原本被注释掉了,所以我直接取消注释,当然这还不够。通过确保 ip 嵌套在“节点”下调整格式后,我指定的值 127.0.0.1 生效。感谢您抽出宝贵时间帮助解决问题。
【解决方案2】:

可能对任何人都有帮助。我已经尝试了谷歌上提到的很多东西来解决这个问题,但没有奏效。最后,通过设置适当的资源来解决它。我使用了 4 GB RAM 和 2 个核心,它工作正常

【讨论】:

    【解决方案3】:

    Alexey,你有没有看到以下错误:

    • tomcat localhost 日志 - 将位于 var/log/tomcat
    • router_service.log - 将位于 var/log
    • access_service.log - 将位于 var/log

    潜在的问题可能是 -

    • 您的盒子不允许本地主机调用(由于某些安全设置),或者
    • 由于其他原因,所有相关服务都没有启动

    另外 - 请检查您使用的是哪个脚本,在 app/bin 文件夹中打包了一个新的 artifactory.sh 脚本,应该使用它。

    【讨论】:

    • 您好 Prasanna,感谢您的回复。我确实使用了artifactory-oss-7.2.1/app/bin/artifactory.sh
    【解决方案4】:

    就我而言,我在尝试访问 artifactory 时遇到了类似的错误。 router-service的日志:

    [root@artifactory-master log]# tail -f router-service.log
    2020-03-20T22:17:05.328Z [jfrou] [INFO ] [                ] [bootstrap.go:70               ] [main                ] - Router (jfrou) service initialization started. Version: 1.1.0 Revision: c2646fcb28e2d4ca095b07aacebe509d934cef77 PID: 19062 Home: /opt/jfrog/artifactory
    2020-03-20T22:17:05.329Z [jfrou] [INFO ] [                ] [bootstrap.go:73               ] [main                ] - JFrog Router IP: ::1
    2020-03-20T22:17:05.334Z [jfrou] [INFO ] [                ] [bootstrap.go:159              ] [main                ] - System configuration encryption report:
    shared.newrelic.licenseKey: does not exist in the config file
    shared.security.joinKeyFile: file '/opt/jfrog/artifactory/var/etc/security/join.key' - already encrypted
    2020-03-20T22:17:05.336Z [jfrou] [INFO ] [                ] [bootstrap.go:78               ] [main                ] - JFrog Router Service ID: jfrou@01e3wgemz9esckmd8v48etdy18
    2020-03-20T22:17:05.336Z [jfrou] [INFO ] [                ] [bootstrap.go:79               ] [main                ] - JFrog Router Node ID: artifactory-master
    2020-03-20T22:17:07.354Z [jfrou] [INFO ] [                ] [config_holder.go:107          ] [main                ] - configuration update detected
    2020-03-20T22:17:10.738Z [jfrou] [FATAL] [                ] [bootstrap.go:100              ] [main                ] - Cluster join: Failed joining the cluster; Error: Error response from service registry, status code: 400; message: Could not validate router Check-url: http://::1:8082/router/api/v1/system/ping; detail: I/O error on GET request for "http:///:1:8082/router/api/v1/system/ping": URI does not specify a valid host name: http:///:1:8082/router/api/v1/system/ping; nested exception is org.apache.http.client.ClientProtocolException: URI does not specify a valid host name: http:///:1:8082/router/api/v1/system/ping
    

    为了给你一些背景信息,我正在一个 centos 8 虚拟机中运行 artifactory,我正在通过 windows 机器访问 artifactory 图形界面。 这意味着,我正在使用网络浏览器 (Chrome) 导航到工件实例。

    为此,我在虚拟机端更新了文件“hosts”和“hostname”(/etc/):

    主持人:

    127.0.0.1   localhost artifactory-master
    ::1         localhost artifactory-master
    

    主机名:

    artifactory-master
    

    在 windows 机器上,我用虚拟机主机 ip 和主机名更新了位于“C:\Windows\System32\drivers\etc”中的主机文件:

    # localhost name resolution is handled within DNS itself.
    #   127.0.0.1       localhost
    #   ::1             localhost
    
    192.100.100.10 artifactory-master
    

    (为了获取VM机器的ip,运行命令ifconfig)

    然后,我通过运行命令启动了 artifactory:

    service artifactory start
    

    并尝试在浏览器中访问工件失败:

    http://artifactory-master:8082/ui
    

    我停止了服务,为了完成我的目标,经过一些尝试,我意识到我必须在“hosts”文件(/etc/)中注释掉地址“::1”:

    主持人:

    127.0.0.1   localhost artifactory-master
    #::1         localhost artifactory-master
    

    最后,我再次启动了服务,并且能够访问 artifactory。路由器服务日志:

    2020-03-24T23:02:17.219Z [jfrou] [INFO ] [                ] [bootstrap.go:70               ] [main                ] - Router (jfrou) service initialization started. Version: 1.1.0 Revision: c2646fcb28e2d4ca095b07aacebe509d934cef77 PID: 14542 Home: /opt/jfrog/artifactory
    2020-03-24T23:02:17.220Z [jfrou] [INFO ] [                ] [bootstrap.go:73               ] [main                ] - JFrog Router IP: 127.0.0.1
    2020-03-24T23:02:17.224Z [jfrou] [INFO ] [                ] [bootstrap.go:159              ] [main                ] - System configuration encryption report:
    shared.newrelic.licenseKey: does not exist in the config file
    shared.security.joinKeyFile: file '/opt/jfrog/artifactory/var/etc/security/join.key' - already encrypted
    2020-03-24T23:02:17.227Z [jfrou] [INFO ] [                ] [bootstrap.go:78               ] [main                ] - JFrog Router Service ID: jfrou@01e3wgemz9esckmd8v48etdy18
    2020-03-24T23:02:17.227Z [jfrou] [INFO ] [                ] [bootstrap.go:79               ] [main                ] - JFrog Router Node ID: artifactory-master
    2020-03-24T23:02:19.572Z [jfrou] [INFO ] [                ] [config_holder.go:107          ] [main                ] - configuration update detected
    2020-03-24T23:02:25.663Z [jfrou] [INFO ] [                ] [join_executor.go:180          ] [main                ] - Cluster join: Successfully joined the cluster
    2020-03-24T23:02:25.813Z [jfrou] [INFO ] [                ] [registry_handler.go:89        ] [main                ] - the following services were registered automatically based on persisted data: jfac@01e3wgdn6q0gvj0czswc8k0gp8, jffe@000, jfmd@01e3wges9tvwawj403y5mxfjp7, jfrt@01e3wgfass87mh1nbcv5rv1t98
    2020-03-24T23:02:25.984Z [jfrou] [INFO ] [                ] [main.go:36                    ] [main                ] - Router (jfrou) service initialization completed in 8.808 seconds. Listening on port: 8082
    2020-03-24T23:03:01.281Z [jfrou] [INFO ] [7e7df2f621a4e1aa] [local_topology.go:212         ] [main                ] -
    ###############################################################
    ###   All services started successfully in 44.081 seconds   ###
    ###############################################################
    

    PS:我的神器版本是OSS 7.2.1

    【讨论】:

    • 有道理。总结:如果system.yaml中没有提供shared.node.ip,脚本使用hostname -i生成。如果您让hostname -i 返回 ipv4 或在 system.yaml 中强制使用 ipv4 ip,它将起作用。
    【解决方案5】:

    我们已将 IP 放入我们的节点,但这不起作用。

    我们可以看到路由器仍在使用 LOCALHOST 并且它使用 ::1 IPV6,尽管我们的 system.yaml 被正确缩进。

    这工作正常(运行系统超过 4 个月),然后最近的更新开始失败。

    有没有比“检查文件”更好的方法——实际上解决了这个问题,如下:

    • 操作系统通常将 localhost 设置为 127.0.0.1,将 ::1 设置为 localhost。

    • JFROG 路由器是“愚蠢的”,因为它获取 url https://localhost:8046,但随后尝试解析 ::1(捕获所有 IPv6)。

    • 许多 SO 票显示 @prasanna 和其他人对文件进行“编辑”,但即使语法正确,我们也可以看到 JFROG 的产品并没有按照它所说的那样做。

    system.yaml 的例子(你可以看到缩进是正确的,实际上这是来自 JFROG 提供的 system.yaml-full-example 模板。

    共享配置

    此配置中所有服务的密钥共享部分

    分享: ## 安全配置 安全: ## 加入集群的加入键值(优先于'joinKeyFile') #joinKey: ""

    ## Join key file location
    #joinKeyFile: "<For example: JFROG_HOME/artifactory/var/etc/security/join.key>"
    
    ## Master key file location
    ## Generated by the product on first startup if not provided
    #masterKeyFile: "<For example: JFROG_HOME/artifactory/var/etc/security/master.key>"
    
    ## Maximum time to wait for key files (master.key and join.key)
    #bootstrapKeysReadTimeoutSecs: 120
    
    ## Node Settings
    node:
        ## A unique id to identify this node.
        ## Default auto generated at startup.
        id: "art-00"
        ## Default auto resolved by startup script
        ip: 10.x.34.63    (x is there on purpose)
    ## Sets this node as primary in HA installation
    

    当您启动 OP 显示的内容时,您可以在日志中清楚地看到。

    SAMPLE LOG

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多