|
| 1 | +## cloud-sql-proxy wait |
| 2 | + |
| 3 | +Wait for another Proxy process to start |
| 4 | + |
| 5 | +### Synopsis |
| 6 | + |
| 7 | + |
| 8 | +Waiting for Proxy Startup |
| 9 | + |
| 10 | + Sometimes it is necessary to wait for the Proxy to start. |
| 11 | + |
| 12 | + To help ensure the Proxy is up and ready, the Proxy includes a wait |
| 13 | + subcommand with an optional --max flag to set the maximum time to wait. |
| 14 | + The wait command uses a separate Proxy's startup endpoint to determine |
| 15 | + if the other Proxy process is ready. |
| 16 | + |
| 17 | + Invoke the wait command, like this: |
| 18 | + |
| 19 | + # waits for another Proxy process' startup endpoint to respond |
| 20 | + ./cloud-sql-proxy wait |
| 21 | + |
| 22 | +Configuration |
| 23 | + |
| 24 | + By default, the Proxy will wait up to the maximum time for the startup |
| 25 | + endpoint to respond. The wait command requires that the Proxy be started in |
| 26 | + another process with the HTTP health check enabled. If an alternate health |
| 27 | + check port or address is used, as in: |
| 28 | + |
| 29 | + ./cloud-sql-proxy <INSTANCE_CONNECTION_NAME> \ |
| 30 | + --http-address 0.0.0.0 \ |
| 31 | + --http-port 9191 |
| 32 | + |
| 33 | + Then the wait command must also be told to use the same custom values: |
| 34 | + |
| 35 | + ./cloud-sql-proxy wait \ |
| 36 | + --http-address 0.0.0.0 \ |
| 37 | + --http-port 9191 |
| 38 | + |
| 39 | + By default the wait command will wait 30 seconds. To alter this value, |
| 40 | + use: |
| 41 | + |
| 42 | + ./cloud-sql-proxy wait --max 10s |
| 43 | + |
| 44 | + |
| 45 | +``` |
| 46 | +cloud-sql-proxy wait [flags] |
| 47 | +``` |
| 48 | + |
| 49 | +### Options |
| 50 | + |
| 51 | +``` |
| 52 | + -h, --help help for wait |
| 53 | + -m, --max duration maximum amount of time to wait for startup (default 30s) |
| 54 | +``` |
| 55 | + |
| 56 | +### Options inherited from parent commands |
| 57 | + |
| 58 | +``` |
| 59 | + --http-address string Address for Prometheus and health check server (default "localhost") |
| 60 | + --http-port string Port for Prometheus and health check server (default "9090") |
| 61 | +``` |
| 62 | + |
| 63 | +### SEE ALSO |
| 64 | + |
| 65 | +* [cloud-sql-proxy](cloud-sql-proxy.md) - cloud-sql-proxy authorizes and encrypts connections to Cloud SQL. |
| 66 | + |
0 commit comments