1, Scenario:
The SQL Server database server does not have a public IP address, only an internal IP address. Development engineers need to use Microsoft SQL Server Management Studio 18 tools to remotely connect to the database.
2, Solution:
In the Centos server, install haproxy and use it to forward the SQL server database port, enabling development engineers to remotely connect to the database.
3, Specific steps:
1. Install haproxy
Yum install - y haproxy.
2. Configure connection to SQL server
/The content of the/etc/haproxy/haproxy.cfg configuration file is as follows.
Global.
Maxconn 1500.
Nbproc 1.
Daemon.
Defaults.
Mode TCP.
Retries 3.
Option abortonclose.
Maxconn 32000.
Timeout connect 30000ms.
Timeout client 30000ms.
Timeout server 30000ms.
Log 127.0.0.1 local0 err.
Listen sqlDB_01.
Bind 0.0.0.0:1544.
Mode TCP.
#Balance source.
Server s1 172.16.1.10-1544 weight 1 maxconn 2000 inter 60s.
3. Start
Systemctl start haproxy.