JFrog Xray启动失败:无法连接localhost:8046路由器端口
排查Xray启动后无法连接localhost:8046的故障
问题概述
安装并启动Xray后无法正常运行,日志显示持续尝试连接localhost:8046失败,且服务器上无该端口监听记录:
2023-08-23T08:41:02.629Z [jfxps] [INFO ] [02b179b60069f31b] [access_client_bootstrap:203 ] [main ] (--wrapper--)Cluster join: Retry 50: Service registry ping failed, will retry. Error: Error while trying to connect to local router at address 'http://localhost:8046/access': Get "http://localhost:8046/access/api/v1/system/ping": dial tcp 127.0.0.1:8046: connect: connection refused [root@VM-0-8-centos etc]# netstat -tlnp |grep 8046 [root@VM-0-8-centos etc]#
排查步骤
确认Router组件状态
Xray的Router是独立运行的核心组件,先检查它是否已启动:# 用systemd管理的情况 systemctl status xray-router # 直接检查进程 ps aux | grep xray-router如果进程不存在,先补装Router组件,再启动服务。
检查Router端口配置
找到Router的配置文件(通常在/etc/xray/router/config.yaml),确认监听端口是否为8046:server: port: 8046 # 需与Xray主配置中的Router地址端口一致若配置的是其他端口,要么修改Router端口为8046,要么同步更新Xray主配置中指向Router的地址。
排查Router启动失败原因
如果Router未正常启动,查看它的日志文件(通常在/var/log/xray/router.log),或手动启动Router排查错误:xray-router run -c /path/to/router/config.yaml常见问题包括配置文件语法错误、端口被占用、权限不足等。
验证端口与防火墙状态
用更全面的命令确认端口监听:ss -tulnp | grep 8046检查防火墙是否拦截了8046端口:
# 查看开放端口 firewall-cmd --list-ports # 若未开放,添加端口 firewall-cmd --add-port=8046/tcp --permanent && firewall-cmd --reload若开启SELinux,需确认端口规则:
getenforce # 若为Enforcing模式,添加端口规则 semanage port -a -t http_port_t -p tcp 8046核对Xray主配置中的Router地址
打开Xray主配置文件,确认Router地址配置正确:access: router: address: http://localhost:8046/access # 需与Router实际监听地址一致
内容的提问来源于stack exchange,提问作者janusyao
相关产品推荐
相关产品推荐

