jfrog artifactory无法验证路由器错误



当我下载、解压缩并启动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,我怀疑启动脚本获取了ipv6 ip,导致了这种情况。

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

shared:
node:
ip: <your ipv4 IP>

相关文件:https://jfrog.com/help/r/access-router-connectivity-node-ip/getting-access-service/router-connectivity-issues-on-startup-try-setting-the-node-ip.

可能对任何人都有帮助。我曾尝试过谷歌上提到的许多方法来解决这个问题,但都不起作用。最后,通过设置适当的资源来解决问题。我使用了4GB RAM和2核,它可以

Alexey,你在中看到任何错误吗

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

潜在问题可能是-

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

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

在我的情况下,我在尝试访问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虚拟机中运行artifactory,并通过windows机器访问artifactory图形界面。这意味着,我正在使用web浏览器(Chrome)导航到artifactory实例。

为此,在虚拟机端,我更新了文件"hosts"one_answers"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

(为了获得虚拟机的ip,运行命令ifconfig)

然后,我通过运行以下命令启动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   ###
###############################################################

附言:我的artifactory版本是OSS 7.2.1

我们已经在节点中放置了IP,但这不起作用。

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

这运行得很好(运行系统超过4个月),然后最近的更新开始失败。

有人比";检查文件"-这实际上解决了以下问题:

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

  • JFROG路由器是";愚蠢的";因为它获取了urlhttps://localhost:8046,但随后尝试对::1进行解析(针对IPv6进行全面解析)。

  • 许多SO售票节目@prasanna和其他人正在做";编辑";到文件,但即使使用正确的语法,我们也可以看到JFROG的产品并没有做它所说的事情。

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

共享配置

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

共享:##安全配置安全性:##用于加入群集的Join键值(优先于"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显示的操作时,您可以清楚地看到日志中的内容。

样本日志

路由器只有在建立数据库连接后才会启动。systemctl status -l artifactory会告诉它已经启动,但有几个服务在不同的端口上侦听。如果一切正常,路由器会监听8082。

检查事项:

  • ss -tan|grep 5432应列出已建立的jdbc连接
  • 可以禁用IPv6,但从/etc/hosts中删除localhost IPv6条目
  • system.yaml shared.node.ip在一个简单的设置中应该是127.0.0.1
  • system.yaml shared.database.url应该是一个可解析的服务器名称或ip
  • JDBC密码最好是字母数字

最新更新