I have 2 cloud sql server ( dev and qa) , How to do port forwarding for both sql server to 1 cloud proxy vm. I did port forwarding for dev sql server long back and its listening on 1433 in cloud proxy vm.
sudo iptables -t nat -I PREROUTING -p tcp --dport 1433 -j DNAT --to-destination 127.0.0.1:1433
sudo nohup ./cloud_sql_proxy -instances=project:region:dev-sqlserver=tcp:1433
Now i have another qa sql server which i want to do port forwarding in same cloud proxy vm.
I want the way to do port forwarding for both sql server in same cloud proxy vm.
1 Answer 1
The Cloud SQL Proxy supports multiple instances. As per documentation:
./cloud-sql-proxy --port 6000 <INSTANCE_CONNECTION_NAME_1> <INSTANCE_CONNECTION_NAME_2>
Consider migrating to v2, follow the Migration Guide.
2 Comments
$ ./cloud-sql-proxy <INSTANCE_CONNECTION_NAME_1> <INSTANCE_CONNECTION_NAME_2> Authorizing with Application Default Credentials [INSTANCE_CONNECTION_NAME_1] Listening on 127.0.0.1:1433 [INSTANCE_CONNECTION_NAME_2] Listening on 127.0.0.1:1434 The proxy has started successfully and is ready for new connections! You can specify the IP address and port as per documentation Explore related questions
See similar questions with these tags.