HAproxy 基础9

2022-01-19 11:11:15 浏览数 (1)

启动haproxy

代码语言:javascript复制
[root@h102 ~]# /usr/local/haproxy/sbin/haproxy -f /etc/haproxy/transparent_proxy.cfg
...
...
...
----------
[root@h102 ~]# netstat  -ant | grep 1234
tcp        0      0 0.0.0.0:1234                0.0.0.0:*                   LISTEN      
[root@h102 ~]# 

进行访问


启动监控

代码语言:javascript复制
[root@h102 ~]# vim  /etc/haproxy/transparent_proxy.cfg
[root@h102 ~]# grep -v "^#" /etc/haproxy/transparent_proxy.cfg

global
defaults
	timeout client		30s
	timeout server		30s
	timeout connect		30s
	stats  enable
	stats uri /admin
	stats auth admin:admin

frontend MyFrontend
	bind	0.0.0.0:1234
	default_backend		TransparentBack_http

backend TransparentBack_http
	mode			http
	server			MyWebServer 127.0.0.1:80

[root@h102 ~]# /usr/local/haproxy/sbin/haproxy -f /etc/haproxy/transparent_proxy.cfg
[WARNING] 049/222700 (33939) : config : 'stats' statement ignored for frontend 'MyFrontend' as it requires HTTP mode.
...
...
...

0 人点赞