Keepalives for service

Answered Question
Jun 14th, 2007
User Badges:

I have a service dependent on two separate keepalive ports for an ip address. The first keepalive monitors the root server web service and the second keepalive monitors an application web service on the server. If either go down I want the Load Balancer to stop services to that VIP.

I would like the state to go down if either service keepalive goes down or how can I have keepalive services watch each other and go down if it sees the other service down.

Thanks

Correct Answer by Syed Iftekhar Ahmed about 10 years 1 week ago

1. Save the script text as a file with no extension. i.e. ap-kal-tcp-ports


Script text is available at


http://www.cisco.com/en/US/products/hw/contnetw/ps792/products_tech_note09186a00801e1e14.shtml


(

stating line :!--- No echo.

Ending line: function SOCKET_CONNECT end )


2. Open an FTP session to the CSS (use CSS credentials).

3. change the directory to scripts

4. upload the file (ap-kal-tcp-ports)

5. configure keepalive type ap-kal-tcp-ports under service


service server1

ip address 192.168.1.1

port 80

protocol tcp

ap-kal-tcp-ports "192.168.1.1 80 2099"

keepalive freq 15


6. Activate the service

7. Activate the Content rule



hope it helps

Syed iftekhar Ahmed




Correct Answer by RODRGUTI about 10 years 1 week ago

On the CSS you can use the ap-kal-httplist:


The script "ap-kal-httplist" will check a list of webpages with a HEAD request and will be considered failed if any of the pages does not

answer or replies with something different that "200 OK". With it, you should be able to check the status of both the web server and

applications server at the same time.


The correct syntax to use this script is /"keepalive type script ap-kal-httplist "server1 web1 server2 web2 ...."", /so for your environment, you will need to use something like:


service test

ip address 10.10.10.11

protocol tcp

port 80

keepalive port 80

keepalive type script ap-kal-httplist "10.10.10.11 /index_web.html

/index_app.html"

active


Also you use the ap-kal-tcpports:


http://www.cisco.com/en/US/products/hw/contnetw/ps792/products_tech_note09186a00801e1e14.shtml


You need to copy the script and then upload it into the CSS, it open a socket connection for the amount of ports that you need.


Hope this help.


- Rodrigo

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.7 (3 ratings)
Loading.
Syed Iftekhar Ahmed Thu, 06/14/2007 - 11:26
User Badges:
  • Blue, 1500 points or more

You didnt mention the Loadbalancer you are using.I will discuss all the three Cisco LBs for multiple probes requirement


If you are using CSS


There is a custom scripted keepalive; which tests different TCP, however TAC does not

support scripted keepalives.


Cisco TAC can provide you with the script.I dont remember the name of the script but it checks two ports and mark the service down if either one of the probe fails.



On CSM


when you configure multiple probes for the same serverfarm, all of them

have to be succeful in order to maintain the servers in serverfarm OPERATIONAL


serverfarm sfarm1

nat server

no nat client

real 1.1.1.1

inservice

real 1.1.1.2

inservice

probe PING

probe GET


In the above example if we are CSM doesnt get a GET response, CSM will mark it down inpsites of the fact that pings from CSM to service are successful.


On ACE


Similar to CSM if you configure multiple probes, service will go down as soon as one probe fails


Hope it helps

Syed Iftekhar Ahmed

Correct Answer
RODRGUTI Thu, 06/14/2007 - 18:49
User Badges:

On the CSS you can use the ap-kal-httplist:


The script "ap-kal-httplist" will check a list of webpages with a HEAD request and will be considered failed if any of the pages does not

answer or replies with something different that "200 OK". With it, you should be able to check the status of both the web server and

applications server at the same time.


The correct syntax to use this script is /"keepalive type script ap-kal-httplist "server1 web1 server2 web2 ...."", /so for your environment, you will need to use something like:


service test

ip address 10.10.10.11

protocol tcp

port 80

keepalive port 80

keepalive type script ap-kal-httplist "10.10.10.11 /index_web.html

/index_app.html"

active


Also you use the ap-kal-tcpports:


http://www.cisco.com/en/US/products/hw/contnetw/ps792/products_tech_note09186a00801e1e14.shtml


You need to copy the script and then upload it into the CSS, it open a socket connection for the amount of ports that you need.


Hope this help.


- Rodrigo

thumpercisco Fri, 06/15/2007 - 06:19
User Badges:

all I want to do on my CSS11506 is monitor this server ip 192.168.1.1 address and port 80(web service) and 2099(app service) so that if either of these ports goes down the state goes down and users are directed to other server and vice versa.


service server1

ip address 192.168.1.1

port 80

protocol tcp

keepalive port 80

keepalive type tcp

keepalive freq 15


service server1

ip address 192.168.1.1

port 2099

protocol tcp

keepalive port 2099

keepalive type tcp

keepalive freq 15


service server2

ip address 192.168.1.1

port 80

protocol tcp

keepalive port 80

keepalive type tcp

keepalive freq 15


service server2

ip address 192.168.1.1

port 2099

protocol tcp

keepalive port 2099

keepalive type tcp

keepalive freq 15


content with vip and add services

and

group vip and add destination services


thanks

Correct Answer
Syed Iftekhar Ahmed Fri, 06/15/2007 - 10:48
User Badges:
  • Blue, 1500 points or more

1. Save the script text as a file with no extension. i.e. ap-kal-tcp-ports


Script text is available at


http://www.cisco.com/en/US/products/hw/contnetw/ps792/products_tech_note09186a00801e1e14.shtml


(

stating line :!--- No echo.

Ending line: function SOCKET_CONNECT end )


2. Open an FTP session to the CSS (use CSS credentials).

3. change the directory to scripts

4. upload the file (ap-kal-tcp-ports)

5. configure keepalive type ap-kal-tcp-ports under service


service server1

ip address 192.168.1.1

port 80

protocol tcp

ap-kal-tcp-ports "192.168.1.1 80 2099"

keepalive freq 15


6. Activate the service

7. Activate the Content rule



hope it helps

Syed iftekhar Ahmed




thumpercisco Tue, 06/26/2007 - 05:58
User Badges:

When I ran script ap-kal-tcp-ports both ports opened however I received error at end

Error could not remove variable.


attached script play result

thumpercisco Tue, 06/26/2007 - 06:16
User Badges:

When I ran script ap-kal-tcp-ports both ports opened however I received error at end

Error could not remove variable.


attached script play result

thumpercisco Wed, 06/27/2007 - 03:24
User Badges:

Syed, this worked perfectly. I am monitoring both ports and have tested if one goes down the service is down and requests go to other service. For new people, the 5th line in above config is:

keepalive type script then the ap-kal etc...


Thanks, and the only thing I am watching now is when the service goes down clients have to refresh the page from no service page, unless there is an auto redirection that I can put in config above. I'll update if I can figure it out.

Thanks

Actions

This Discussion