Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation of haproxy

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Download address:

Http://www.haproxy.org/#down

Document address:

Http://www.haproxy.org/#doc1.6

After downloading the source code, decompress:

Install make install

Cat / etc/test-sql.cfg

# This is a test configuration.

# It requires a mysql server running on local port 3306.

Global

Maxconn 500

Pidfile / tmp/proxy.pid

Defaults

Contimeout 1000

Clitimeout 5000

Srvtimeout 5000

Retries 1

Option redispatch

Mode tcp

Listen test

Bind: 3307

Mode tcp

Balance roundrobin

Option tcp-check

# option mysql-check user haproxy

Server srv1 10.10.230.172:3306 check port 3306 inter 1000 fall 1

# server srv2 127.0.0.2:3306 check port 3306 inter 1000 fall 1

# server srv3 127.0.0.3:3306 check port 3306 inter 1000 fall 1

# server srv4 127.0.0.4:3306 check port 3306 inter 1000 fall 1

Start:

Haproxy-f / etc/test-sql.cfg

[root@10-10-157-43 tests] # ps-ef | grep pro

Root 3177 728 0 19:59 pts/0 00:00:00 haproxy-f / etc/test-sql.cfg

Root 3187 728 0 20:00 pts/0 00:00:00 grep pro

Reload:

[root@10-10-157-43 tests] # haproxy-f / etc/test-sql.cfg-sf 3177 &

Please indicate the source of the reprint.

QQ 273002188 Welcome to study together.

QQ group 236941212

Oracle,mysql,PG communicate with each other

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report