jfrog artifactory could not validate router 错误

jfrog artifactory could not validate router error

当我下载、解压并启动时 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

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

Alexey,你看到任何错误了吗:

  • tomcat 本地主机日志 - 将位于 var/log/tomcat
  • router_service.log - 将在 var/log
  • access_service.log - 将在 var/log

潜在问题可能是 -

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

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

Alexey,我怀疑 ipv6 ip 被启动脚本获取,导致了这个。

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

shared:
    node:
        ip: <your ipv4 IP>

就我而言,我在尝试访问 artifactory 时遇到了类似的错误。路由器服务日志:

[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 虚拟机中 运行 宁神器,我正在通过 windows 机器访问神器图形界面。 这意味着,我正在使用网络浏览器 (Chrome) 导航到人工制品实例。

为此,我在 VM 端更新了文件 "hosts" 和 "hostname" (/etc/):

主持人:

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

主机名:

artifactory-master

在 windows 机器中,我使用 VM 主机 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)

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

service artifactory start

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

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

可能对任何人都有帮助。我尝试了 google 中提到的许多方法来解决问题,但没有用。最后,它通过设置适当的资源得到解决。我使用了 4 GB RAM 和 2 个核心,它工作正常

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

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

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

有没有人有比“检查文件”更好的方法 - 实际解决了以下问题:

  • OS 通常将 localhost 设置为 127.0.0.1 并将 ::1 设置为 localhost。

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

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

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

共享配置

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

分享: ## 安全配置 安全: ## 加入集群的join key值(优先于'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