Skip to content

Commit 93db74a

Browse files
authored
Detail configuring Oracle with multiple hostnames (#60573)
* Detail configuring Oracle with multiple hostnames * address review comments * expand yaml reference config
1 parent a098987 commit 93db74a

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

docs/pages/enroll-resources/database-access/enroll-managed-databases/oracle-exadata.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,10 @@ $ tsh db logout oracle
394394
$ tsh db logout
395395
```
396396

397+
## (Optional) Configure additional hostnames
398+
399+
(!docs/pages/includes/database-access/oracle-multihost.mdx!)
400+
397401
## Troubleshooting
398402

399403
(!docs/pages/includes/database-access/oracle-troubleshooting.mdx!)

docs/pages/enroll-resources/database-access/enroll-self-hosted-databases/oracle-self-hosted.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ $ tsh db logout oracle
263263
$ tsh db logout
264264
```
265265

266+
## (Optional) Configure additional hostnames
267+
268+
(!docs/pages/includes/database-access/oracle-multihost.mdx!)
269+
266270
## Troubleshooting
267271

268272
(!docs/pages/includes/database-access/oracle-troubleshooting.mdx!)

docs/pages/includes/config-reference/database-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ db_service:
117117
# When this option is set the Database Agent doesn't try to check the MySQL server version.
118118
server_version: 8.0.28
119119

120+
# Oracle only options.
121+
oracle:
122+
# Randomize host order per connection attempt to spread load. Optional.
123+
shuffle_hostnames: true
124+
# Retries per host on network errors only; non-network errors stop (default: 2). Optional.
125+
retry_count: 5
126+
120127
# Optional admin user configuration for Automatic User Provisioning.
121128
admin_user:
122129
# Name of the admin user.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
In some deployments the same logical database is reachable via multiple hostnames with different characteristics, for example:
2+
3+
* replicated databases
4+
* hostnames that traverse different network paths
5+
6+
If this applies to your setup, list all hosts in order of preference to improve connection resiliency.
7+
8+
If a TCP dial error occurs for a host, the next host in the list is tried automatically. Non-network errors (e.g., certificate or authentication failures) are not retried and do not advance to the next host.
9+
10+
By default, hosts are attempted in the listed order. Retries cycle through the list and wrap to the start as needed (e.g., `host1 → host2 → host3 → host1 → ...`). To randomize the sequence per connection attempt, set `shuffle_hostnames`; the same cyclic pattern then applies to that randomized order.
11+
12+
`retry_count` controls the number of retries per host after the initial attempt on a network error. The default is `2`, so there are 3 total attempts per host (1 initial + 2 retries) before moving to the next host in sequence.
13+
14+
This setup supports failover and basic load-balancing for new connections: enabling `shuffle_hostnames` spreads initial connection attempts across hosts (load-balancing), while retries automatically move to the next host if the current one is unreachable (failover).
15+
16+
```yaml
17+
- name: oracle
18+
protocol: oracle
19+
uri: host1:2484,host2:2484,host3:2484 # Multiple hosts; dials in sequence and wraps (host1 → host2 → host3 → host1 ...). Dialing sequence can be randomized with `shuffle_hostnames`.
20+
static_labels:
21+
env: dev
22+
oracle:
23+
# Randomize host order per connection attempt to spread load. Optional.
24+
shuffle_hostnames: true
25+
# Retries per host on network errors only; non-network errors stop (default: 2). Optional.
26+
retry_count: 5
27+
```

docs/pages/reference/agent-services/database-access-reference/configuration.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ spec:
181181
# connection made by a user.
182182
server_version: 8.0.28
183183

184+
# Oracle only options.
185+
oracle:
186+
# Randomize host order per connection attempt to spread load. Optional.
187+
shuffle_hostnames: true
188+
# Retries per host on network errors only; non-network errors stop (default: 2). Optional.
189+
retry_count: 5
190+
184191
# Optional AWS configuration for RDS/Aurora/Redshift. Can be auto-detected from the endpoint.
185192
aws:
186193
# Region the database is deployed in.

0 commit comments

Comments
 (0)