[fatedier/frp]客户端心跳校验失败

2019-12-01 714 views
1

环境:

  • 服务端:阿里云ECS ubuntu 16.04
  • 客户端:win10 1903 专业版
  • frp 版本 0.30.0
  • 客户端测试 web 服务:python -m http.server 8000

服务端配置 frps.ini

[common]
bind_addr = 0.0.0.0
bind_port = 7000

vhost_http_port = 8080
vhost_https_port = 8443

dashboard_addr = 0.0.0.0
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin

log_file = ./frps.log
log_level = trace
log_max_days = 3

token = 12345678
#allow_ports = 10000-50000
max_pool_count = 5
max_ports_per_client = 3
subdomain_host = frp.mydm.com

客服端配置 frpc.ini:

[common]
server_addr = x.x.x.x
server_port = 7000

log_file = ./frpc.log
log_level = trace
log_max_days = 3

token = 12345678

admin_addr = 127.0.0.1
admin_port = 7400
admin_user = admin
admin_pwd = admin

[web01]
type = http
local_ip = 127.0.0.1
local_port = 8000
use_encryption=true
use_compression=true
subdomain = web01
health_check_type = http
health_check_url = /status
health_check_interval_s = 10
health_check_max_failed = 3
health_check_timeout_s = 3

如上启动后,无法访问 web01.frp.mydm.com:8080,页面显示:

The page you visit not found.
Sorry, the page you are looking for is currently unavailable.
Please try again later.
The server is powered by frp.
Faithfully yours, frp.

服务端 trace 级别日志:

2019/12/01 21:19:35 [I] [service.go:141] frps tcp listen on 0.0.0.0:7000
2019/12/01 21:19:35 [I] [service.go:183] http service listen on 0.0.0.0:8080
2019/12/01 21:19:35 [I] [service.go:204] https service listen on 0.0.0.0:8443
2019/12/01 21:19:35 [I] [service.go:240] Dashboard listen on 0.0.0.0:7500
2019/12/01 21:19:35 [I] [root.go:205] start frps success
2019/12/01 21:19:41 [T] [service.go:274] start check TLS connection...
2019/12/01 21:19:41 [T] [service.go:282] success check TLS connection
2019/12/01 21:19:41 [I] [service.go:372] [48b6ee380001dcee] client login info: ip [222.90.206.74:6808] version [0.30.0] hostname [] os [windows] arch [amd64]
2019/12/01 21:19:41 [D] [control.go:205] [48b6ee380001dcee] new work connection registered
2019/12/01 21:20:11 [D] [control.go:432] [48b6ee380001dcee] receive heartbeat
2019/12/01 21:20:41 [D] [control.go:432] [48b6ee380001dcee] receive heartbeat
...
2019/12/01 21:38:10 [W] [http.go:95] do http proxy request error: no such domain: web01.frp.brothereye.cn /
2019/12/01 21:38:10 [W] [http.go:95] do http proxy request error: no such domain: web01.frp.brothereye.cn /

客户端 trace 级别日志:

2019/12/01 21:36:30 [I] [service.go:249] [92206a4c1adba57b] login to server success, get run id [92206a4c1adba57b], server udp port [0]
2019/12/01 21:36:30 [T] [proxy_wrapper.go:92] [92206a4c1adba57b] [web] enable health check monitor
2019/12/01 21:36:30 [I] [proxy_manager.go:144] [92206a4c1adba57b] proxy added: [web]
2019/12/01 21:36:30 [I] [service.go:130] admin server listen on 127.0.0.1:7400
2019/12/01 21:36:30 [W] [health.go:116] [92206a4c1adba57b] [web] do one health check failed: do http health check, StatusCode is [404] not 2xx
2019/12/01 21:36:40 [W] [health.go:116] [92206a4c1adba57b] [web] do one health check failed: do http health check, StatusCode is [404] not 2xx
2019/12/01 21:36:46 [I] [admin_api.go:212] Http get request [/api/config]
2019/12/01 21:36:46 [I] [admin_api.go:214] Http get response [/api/config], code [200]
2019/12/01 21:36:47 [I] [admin_api.go:175] Http request [/api/status]
2019/12/01 21:36:47 [I] [admin_api.go:177] Http response [/api/status]
2019/12/01 21:36:49 [I] [admin_api.go:175] Http request [/api/status]
2019/12/01 21:36:49 [I] [admin_api.go:177] Http response [/api/status]
2019/12/01 21:36:50 [W] [health.go:116] [92206a4c1adba57b] [web] do one health check failed: do http health check, StatusCode is [404] not 2xx
2019/12/01 21:37:00 [D] [control.go:284] [92206a4c1adba57b] send heartbeat to server
2019/12/01 21:37:00 [W] [health.go:116] [92206a4c1adba57b] [web] do one health check failed: do http health check, StatusCode is [404] not 2xx
2019/12/01 21:37:00 [D] [control.go:305] [92206a4c1adba57b] receive heartbeat from server
2019/12/01 21:37:10 [W] [health.go:116] [92206a4c1adba57b] [web] do one health check failed: do http health check, StatusCode is [404] not 2xx

上面日志是我截取的,时间可能对不上。 错误信息就是 do http health check, StatusCode is [404] not 2xx 防火墙方面:我开启了阿里云 ECS 的 7000。7500、8080 的入方向,日志中也没有看到任何关于网络问题。我感觉应该不是我的网络问题。

麻烦大家,可以给我指导下吗?

回答

5

这不是心跳检测失败,是健康检查失败,不需要健康检查的话把 health_check 开头的部分都删掉。

1

嗯。去掉这部分确实可以了,谢谢啦。那为什么健康检查不通过呀?

4

这是你自己配置的,自行检查下。