cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4439
Views
0
Helpful
10
Replies

How to use the same IP address of a real server with different port numbers

HI 

 

We have run service on 2 ports (26810,26811) on same server. Using ACE 20 module.

 

 

server 1:172.16.101.4 running port with 26810,26811

server 2:172.16.101.5 running port with 26810,26811

 

 

Now I need to hit VIP (10.10.10.1) and load balanced among the 2 servers with the mention port.

 

 http://10.10.10.1:26810 ------> load balanced among 172.16.101.4 :26810 and 172.16.101.5:26810

http://10.10.10.1:26811------> load balanced among 172.16.101.4 :26811 and 172.16.101.5:26811

 

Or,

 

Simply hit http://10.10.10.1---> load balanced among 172.16.101.4 :26810 and 172.16.101.5:26810

and                                           load balanced among 172.16.101.4 :26811 and 172.16.101.5:26811

 

Is it possible?

 

Pls assist...

10 Replies 10

thiland
Level 3
Level 3

As long as you specify the port number in the associated class-map you should be fine.  For example:

class-map match-any CLASS-VIP-APPLICATION1
  2 match virtual-address 10.10.10.1 tcp eq 26810

class-map match-any CLASS-VIP-APPLICATION2
  2 match virtual-address 10.10.10.1 tcp eq 26811

HI thiland,

 

Many thanks for Your reply. Requirement has changed . Is it possible to load balanced between servers with respective ports?

Communication will be as follows:

 

Client hits VIP (10.101.32.74:7777) --- Will load balance between 10.101.26.58:26810, 10.101.26.71:26810, 10.101.26.58:26811 and 10.101.26.71:26811

 

 

That's fine.  Just specify the real server port if it's not the same as the VIP port.

 

class-map match-any CLASS-VIP-APPLICATION1
  2 match virtual-address 10.101.32.74 tcp eq 7777

serverfarm host FARM-APPLICATION1
  description Application1 Serverfarm
  probe PROBE-ICMP-ECHO
  rserver REAL-SERVER1 26810
    inservice
  rserver REAL-SERVER2 26811
    inservice

 

 

HI,

Have configured it as follows but no luck,

 

Can You please check and revert:

probe tcp PORT_26810
  port 26810
  interval 15
  passdetect interval 30
  receive 5
  open 3
probe tcp PORT_26811
  port 26811
  interval 15
  passdetect interval 30
  receive 5
  open 3

 

rserver host osb_server1
  ip address 10.101.26.58
  inservice
rserver host osb_server2
  ip address 10.101.26.71
    inservice

 

serverfarm host OSB_svrfirm_app
  probe PORT_26810
  probe PORT_26811
  probe PORT_80
  probe PORT_8080
  rserver osb_server1 26810
  rserver osb_server1 26811
    inservice
  rserver osb_server2 26810
  rserver osb_server2 26811
    inservice

 

------------------------------------------

 

Then See :

 

ACE01/pubail-ace# sh serverfarm OSB_svrfirm_app 
 serverfarm     : OSB_svrfirm_app, type: HOST
 total rservers : 4
 ---------------------------------
                                                ----------connections-----------
       real                  weight state        current    total      failures 
   ---+---------------------+------+------------+----------+----------+---------
   rserver: osb_server1
       10.101.26.58:26810    8      OUTOFSERVICE 0          0          0
       10.101.26.58:26811    8      PROBE-FAILED 0          0          0
   rserver: osb_server2
       10.101.26.71:26810    8      OUTOFSERVICE 0          0          0
       10.101.26.71:26811    8      PROBE-FAILED 0          0          0

 

Pls have a look on following points:

 

1. You didn't specify REAL-SERVER1 running with 26811 port also. So script should be as follows:

 

serverfarm host FARM-APPLICATION1
  description Application1 Serverfarm
  probe PROBE-ICMP-ECHO
  rserver REAL-SERVER1 26810
rserver REAL-SERVER1 26811

    inservice
rserver REAL-SERVER2 26810

  rserver REAL-SERVER2 26811
    inservice

Right?

 

2. You specify PROBE-ICMP-ECHO but we push customize Probe for port 26810 & 26811

Is this is the main difference?

see show serverfarm command shows that it's probe-failed , Is it app side problem or ACE side?

 

3. How the ACE providing service in this case:

-If  1st packet goes to 10.101.26.58:26810 then how ACE understand 2nd packet goes to 

10.101.26.71:26810 hitting the same VIP:7777?

 - Likewise how packet 

goes to 10.101.26.58:26811 then how ACE understand 2nd packet goes to 

10.101.26.71:26811 hitting the same VIP:7777?

Meaning how ACE will understand he has to load balanced between servers based on service running on specific ports?

 

 

When you specify probes directly under the serverfarm it's treated as an AND for all rservers configured.  Since each server isn't listening on tcp/26810, 26811, 80, AND 8080, you should specify the probes under the rserver directly.  For example:

serverfarm host FARM-APPLICATION1
  description Application1 Serverfarm
  rserver REAL-SERVER1 26810
    probe PORT_26810
    inservice

 

The load balancing algorithm ACE uses is round robin by default.  If you want to modify, try "predictor ?" under the serverfarm configuration to see other options.

So it should be like this:

 

serverfarm host OSB_svrfirm_app
  rserver osb_server1 26810

probe PORT_26810

inservice
  rserver osb_server1 26811

probe PORT_26811
    inservice
  rserver osb_server2 26810

probe PORT_26810

inservice
  rserver osb_server2 26811

probe PORT_26811
    inservice

 

Right?

 

Considering the current senerio if it is Round robin then this particular solution will work?

Client hits VIP (10.101.32.74:7777) --- Will load balance between 10.101.26.58:2681010.101.26.71:2681010.101.26.58:26811and 10.101.26.71:26811

Looks good (assuming you have the rserver configured with the right IP,s etc.).

 

 

Many thanks for keep replying ...

Can You clarifies the following points:

 

As You see there are 2 services running on 2 ports 26810 and 26811, how ACE can identifies 

 

Clients seeking seeking service on port 26810 will be load balanced between servers 10.101.26.58 and 10.101.26.71?

similarly for port 26811 also?

 

The clients only seek service on the VIP and port defined by your class-map virtual-address statement on tcp/7777.  When traffic hits the VIP, ACE is just picking one of the rservers to forward the connection to.  When it selects any of your rservers, it changes the destination port from 7777 to the port number defined in your rserver statement (e.g., 26810 or 26811).

  1. Receive traffic on VIP and port
  2. Select rserver
  3. Change packet IP and port to match desired rserver
  4. Forward packet to rserver