cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1484
Views
15
Helpful
12
Replies

Static Route automation switch

dpsw120
Level 1
Level 1

Hello can someone help me with my case?

So someboody knew pgpool? i have 2 db server running pgpool, each db server has virtual db that act as gateway so basically this method is like HSRP. The problem is another server which need access to db run in different subnet to make it connect to virtual db is just simply applying static route and the hardest part is the automation if virtual db fail on first db and change to second db, how we gonna make a route to that?

12 Replies 12

omz
VIP Alumni
VIP Alumni

i think it can't, so let me share my brief conf and maybe someone will light me up

 

track 1 ip sla 1 reachability

ip sla 1
 icmp-echo 1.1.1.1
ip sla schedule 1 life forever start-time now

 

ip route 1.1.1.1 255.255.255.255 2.2.2.2 track 1
ip route 1.1.1.1 255.255.255.255 3.3.3.3 200

 

* 1.1.1.1 = virtual db that run in db1 and if db1 is down this ip will active in db2

* 2.2.2.2 = db1

* 3.3.3.3 = db2

Hi

in your SLA you are pinging 1.1.1.1 this could lead to a flapping route. Try pinging 2.2.2.2 instead.

track 1 ip sla 1 reachability

ip sla 1
icmp-echo 2.2.2.2
ip sla schedule 1 life forever start-time now



ip route 1.1.1.1 255.255.255.255 2.2.2.2 track 1
ip route 1.1.1.1 255.255.255.255 3.3.3.3 200



* 1.1.1.1 = virtual db that run in db1 and if db1 is down this ip will active in db2

* 2.2.2.2 = db1

* 3.3.3.3 = db2

so it will track the db 1 interface not the virtual db right?

if the virtual db is down then the route will not change to db 2 i think because we track db 1 not the virtual db

Hello

There is no point in tracking the VIP as I assume this address will follow whatever physical DB server is running as the primary, like in you post its currently running on 2.2.2.2 so Rasmus is stating you need to track the physical servers reachability and if that goes down then that tracked static route will be removed and the less preferred one will then become active.

 

 

 

 

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Yes VIP right now running on 2.2.2.2 but there is probability that this virtual will change not because the DB1 interface is down. so how do i tackle this?

Is it possible to track the SQL TCP port in your IP SLA instead?
So if the TCP port of DB1 is down the IP SLA will be unreachable and the routing will be moved to 3.3.3.3?

The example I gave above will route all traffic to 1.1.1.1 to 2.2.2.2 if 2.2.2.2 is pingable.
If 2.2.2.2 is not pingable traffic will be routed to 3.3.3.3.

Hope it makes sense...

i think my config run so good right now with little problem

track 1 ip sla 1 reachability
delay down 1 up 1

ip sla 1
icmp-echo 1.1.1.1
ip sla schedule 1 life forever start-time now

ip route 1.1.1.1 255.255.255.255 2.2.2.2 track 1
ip route 1.1.1.1 255.255.255.255 3.3.3.3 200

* 1.1.1.1 = virtual db that run in db1 and if db1 is down this ip will active in db2

* 2.2.2.2 = db1

* 3.3.3.3 = db2

with the config above the route installed in routing table

S 1.1.1.1/32 [1/0] via 2.2.2.2

and track 1 status is active

Track 1
IP SLA 1 reachability
Reachability is Up
4 changes, last change 1w0d
Delay up 1 sec, down 1 sec
Latest operation return code: OK
Latest RTT (millisecs) 1
Tracked by:
Static IP Routing 0

and if 1.1.1.1 (virtual db) is down, route will chage via 3.3.3.3 (db2)
but the problem is whent the 1.1.1.1 (virtual ) in 2.2.2.2 (db1) is active again, the route won't change back.

do you know to config ip sla that track port?

Hello

did you try to track the DB physical addresses instead of the vip?


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

if i track db physical address and db server went down of course it'll work right but if vip goes down and db physical address still up, basically the route will not change right? because it keep tracking db physical instead vip. is tracking vip will cause floating route?

Hello

 


@dpsw120 wrote:
if i track db physical address and db server went down of course it'll work right but if vip goes down and db physical address still up, basically the route will not change right? because it keep tracking db physical instead vip. is tracking vip will cause floating route?

The VIP should never go down, it is virtual , that why you have a vip, So your applications are not tied to the physical address and as such should not notice any physical failure.

 

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul