Editing
HAProxy
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Replicare Master/Slave === [[File:HaproxySQL_MS.png|782x616px|none|HAProxy Master-Slave]] Destinat infrastructurilor clasice Master/Slave. Aplicația folosește un singur punct de conexiune (db.domeniu.lan:3306). HAProxy trimite tot traficul către Master, în timp ce Slave-ul stă în așteptare (backup) și preia automat activitatea doar dacă Masterul intră în crash. <code class="mw-code mw-highlight plainlinks" style="display:block"><!-- -->''' # nano /etc/haproxy/haproxy.cfg'''    # FRONTEND DATABASE (Master/Slave)  frontend fe_mysql_master_slave     bind *:3306     mode tcp     default_backend be_mysql_master_slave    # BACKEND DATABASE (Master/Slave)  backend be_mysql_master_slave     mode tcp     balance leastconn     option mysql-check user haproxy_check       # Serverul Master - preia 100% din trafic în mod normal     server dbm 192.168.14.11:3306 check on-marked-down shutdown-sessions       # Serverul Slave - preia traficul DOAR dacă dbm devine offline     server dbs 192.168.14.22:3306 check backup </code> * mode tcp - Obligatoriu pentru baze de date. Suprascrie modul HTTP implicit. * balance leastconn - Direcționează conexiunile noi către nodul cu cele mai puține sesiuni active. * option mysql-check user ... - Interoghează nativ serverul MySQL pentru a-i verifica starea. * on-marked-down shutdown-sessions - Dacă Masterul pică testul de sănătate, HAProxy taie instant toate conexiunile active/persistente din pool, forțând aplicația să se mute imediat pe Slave-ul de backup. * backup - Marchează serverul ca pasiv. Nu primește trafic atât timp cât nodul principal este online.
Summary:
Please note that all contributions to Linux Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linux Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Navigation
Main page
Aplicatii Linux
UrBackup
rSyslog
KeepAlived
HAProxy
USB over IP
Pi-hole
DHCP
BIND DNS
Hardware Linux
Adaugare Disk
Extindere Disk
Docker
Instalare Docker CE
Portainer
Container UrBackup
Container PiHole
Raspberry Pi
NTP Server
Snippets
History Command
Access Control List
Troubleshooting
Colectare Info
CPU
RAM
Disk
Tools
What links here
Related changes
Special pages
Page information