# Logstash - jdbc retry multiple ips

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-retry-multiple-ips/297107>\
**Category:** Logstash\
**Created:** [February 14, 2022, 7:50am UTC](https://discuss.elastic.co/t/logstash-jdbc-retry-multiple-ips/297107 "2022-02-14T07:50:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nasser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nasser/32/99437_2.png) [@Nasser](https://discuss.elastic.co/u/Nasser)\
**Post date:** [February 14, 2022, 7:50am UTC](https://discuss.elastic.co/t/logstash-jdbc-retry-multiple-ips/297107/1 "2022-02-14T07:50:17Z")

</div>

Hi

i'm connecting to my database via scan name and my scan name resolve to 3 IPs  
but the issue is sometimes 1 or 2 IPs get unavailable  
my question how i can set the connection to retry all IPs as below

```auto
jdbc_connection_string => "jdbc:oracle:thin:@ip1:0000"
if not available retry 
jdbc_connection_string => "jdbc:oracle:thin:@ip2:0000"
if not available retry 
jdbc_connection_string => "jdbc:oracle:thin:@ip3:0000" 

```

thanks

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 14, 2022, 6:03pm UTC](https://discuss.elastic.co/t/logstash-jdbc-retry-multiple-ips/297107/2 "2022-02-14T18:03:12Z")

</div>

The syntax for an Oracle JDBC connection string is

> "jdbc:oracle:thin:@(description=(address\_list=(address=(protocol=tcp)  
> (port=1521)(host=prodHost)))(connect\_data=(INSTANCE\_NAME=Foo)))"

So I think you should try

> jdbc\_connection\_string =\> "jdbc:oracle:thin:@(description=(address\_list=  
> (address=(protocol=tcp)(port=1521)(host=ip1))  
> (address=(protocol=tcp)(port=1521)(host=ip2))  
> (address=(protocol=tcp)(port=1521)(host=ip3))  
> )(connect\_data=(INSTANCE\_NAME=Foo)))"

See [this](https://docs.oracle.com/cd/E11882_01/network.112/e10835/tnsnames.htm#NETRF263) page for information about the FAILOVER and LOAD\_BALANCE options, one of which you probably want.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 14, 2022, 6:03pm UTC](https://discuss.elastic.co/t/logstash-jdbc-retry-multiple-ips/297107/3 "2022-03-14T18:03:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
