Problem with traefik:v2.4
and traefik:v2.5
:
- cannot connect to mariadb over tcp without tls
transport endpoint is not connected
Static conf
entryPoints:
stackdb:
address: ':63001'
proxyProtocol:
insecure: true
Dynamic conf
tcp:
routers:
stackdb:
rule: "HostSNI(`*`)"
service: stackdb
entryPoints:
- stackdb
services:
stackdb:
loadBalancer:
servers:
- address: "192.168.54.112:3306"
[mariadb]
bind_address = 0.0.0.0
proxy-protocol-networks = *
MariaDB [(none)]> SHOW GRANTS FOR 'dizbi'@'%';
+------------------------------------------------------------------------------------------------------+
| Grants for dizbi@% |
+------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `dizbi`@`%` IDENTIFIED BY PASSWORD '*2507C83A880C4CB12C16D3DD57E5A28F08717081' |
| GRANT SELECT, INSERT, UPDATE, DELETE ON `dizbi`.* TO `dizbi`@`%` |
+------------------------------------------------------------------------------------------------------+
Try to connect
mysql --host 192.168.54.108 --port 63001 --user dizbi --verbose -p --connect-timeout 3
Enter password:
ERROR 2013 (HY000): Lost connection to MySQL server at 'handshake: reading initial communication packet', system error: 110
Or just telnet
telnet 192.168.54.108 63001
Trying 192.168.54.108...
Connected to 192.168.54.108.
Escape character is '^]'.
bye
m
5.5.5-10.6.4-MariaDB-1:10.6.4+maria~focalpegVW4:h{��`SmLs|8?tJTIOmysql_native_passwordConnection closed by foreign host.
Traefik logs
time="2021-08-10T11:35:37Z" level=debug msg="No default certificate, generating one"
time="2021-08-10T11:35:37Z" level=debug msg="Creating TCP server 0 at 192.168.54.112:3306" entryPointName=stackdb routerName=stackdb@file serviceName=stackdb serverName=0
time="2021-08-10T11:35:37Z" level=debug msg="Adding route * on TCP" entryPointName=stackdb routerName=stackdb@file
time="2021-08-10T11:35:37Z" level=debug msg="No default certificate, generating one"
time="2021-08-10T11:35:37Z" level=debug msg="Creating TCP server 0 at 192.168.54.112:3306" serviceName=stackdb serverName=0 entryPointName=stackdb routerName=stackdb@file
time="2021-08-10T11:35:37Z" level=debug msg="Adding route * on TCP" entryPointName=stackdb routerName=stackdb@file
time="2021-08-10T11:35:49Z" level=debug msg="Handling connection from 192.168.54.22:37120"
time="2021-08-10T11:35:49Z" level=error msg="Error during connection: read tcp 192.168.54.108:36008->192.168.54.112:3306: read: connection reset by peer"
time="2021-08-10T11:35:49Z" level=debug msg="Error while terminating connection: close tcp 192.168.54.108:36008->192.168.54.112:3306: shutdown: transport endpoint is not connected"
time="2021-08-10T11:36:01Z" level=debug msg="Handling connection from 192.168.54.22:37126"