Unable to connect to RDS Aurora SQL DB via ToxiProxy server
Followed steps mentioned below:
- I have created proxy using following command: toxiproxy-cli create -l 0.0.0.0:26379 -u {RDS Aurora DB endpoint}:3306 RDS
- Replaced RDS aurora endpoint in url below with IP of proxy server jdbc:mysql://{proxy_server_ip}:26379/{DB_name}
- When I try to access SQL server as earlier, I get following error - "ERROR: Unexpected error: Could not connect to MySQL instance. Error is: (2003, "Can't connect to MySQL server on '{Proxy ip address}' (timed out)")"
jdbc:mysql://{proxy_server_ip}:3306/{DB_name}
Should be jdbc:mysql://{proxy_server_ip}:26379/{DB_name}
@miry I did change it to "jdbc:mysql://{proxy_server_ip}:26379/{DB_name}". It was a typo. Apologies. Request you to help me here.
@ashish-k I propose to check toxiproxy with simple commands:
- Make sure toxiproxy server and client are uptodated:
$ toxiproxy-server --version
toxiproxy-server version 2.5.0
$ toxiproxy-cli --version
toxiproxy-cli version 2.5.0
- Run server with debug log level.
LOG_LEVEL=debug toxiproxy-server
- Create a new proxy
toxiproxy-cli create -l 0.0.0.0:26379 -u {RDS Aurora DB endpoint}:3306 rds
toxiproxy-cli inspect rds
- Test that port is open
curl -v 0.0.0.0:26379
curl -v 127.0.0.1:26379
- Check logs from toxiproxy-server.
Pls share output of commands and logs, it would help me to identify the problem.
@miry Thank you for your inputs.
After running command "LOG_LEVEL=debug toxiproxy-server", following output is printed and nothing happens after that. Can you please suggest if there is some alternative way to change LOG_LEVEL. Thanks again!
{"level":"info","host":"localhost","port":"8474","version":"2.5.0","caller":"api.go:119","time":"2022-10-14T11:54:21Z","message":"Starting HTTP server on endpoint localhost:8474"}
@ashish-k Have you done commands with curl? According the logs, it looks there were no any requests done.
Can you please suggest if there is some alternative way to change LOG_LEVEL.
It is not possible right now, sorry for this. Probably we can move log level in config later.
@miry Please find below the output of curl commands.
curl -v 0.0.0.0:26379
Output:
- Trying 0.0.0.0:26379...
- Connected to 0.0.0.0 (127.0.0.1) port 26379 (#0)
GET / HTTP/1.1 Host: 0.0.0.0:26379 User-Agent: curl/7.81.0 Accept: /
- Received HTTP/0.9 when not allowed
- Closing connection 0 curl: (1) Received HTTP/0.9 when not allowed
curl -v 127.0.0.1:26379
Output:
- Trying 127.0.0.1:26379...
- Connected to 127.0.0.1 (127.0.0.1) port 26379 (#0)
GET / HTTP/1.1 Host: 127.0.0.1:26379 User-Agent: curl/7.81.0 Accept: /
- Received HTTP/0.9 when not allowed
- Closing connection 0 curl: (1) Received HTTP/0.9 when not allowed
@miry Request you to help me here. Do let me know if any other inputs are required.
Can anyone else help me here please if @miry is not available
@miry Can you please help me here
@ashish-k As I see toxiproxy shows the reply from Aurora DB. You did not provide logs from toxiproxy during your experiments with curl.
I am not familiar with Aurora DB, I could guess that some sort Handshake verification enabled. Example SSL or encription, where server see that proxy used.
You should check Toxiproxy server logs and Aurora DB logs.