Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Issue on heartbeat clustring with Squid revers proxy

  1. #1
    Senior Member
    Join Date
    Jun 2007
    Location
    Hyderabad, AP, India
    Posts
    806
    Thanks
    44
    Thanked 55 Times in 48 Posts
    Rep Power
    13

    Default Issue on heartbeat clustring with Squid revers proxy

    hi all,

    recently i configure Squid reverse proxy and its working fine. now i started implemented heartbeat clustering for fail-over. So we configured 2 servers with same squid configs, which are working fine.. and started implementing clustering.. And the service started successfully but I am unable to get squid requests.. i hear that /etc/ha.d/resources.d/ should contains squid file.. please let me know if any one configure this type of server.. with squid.. then i can provide more info..
    Thanks,
    Surendra Kumar Anne
    Linux: Fast, friendly, flexible and .... free!
    Support Open source.
    http://www.linuxnix.com

  2. #2
    Senior Member
    Join Date
    Jun 2007
    Location
    Hyderabad, AP, India
    Posts
    806
    Thanks
    44
    Thanked 55 Times in 48 Posts
    Rep Power
    13

    Default

    hay i got the script.. but when executing the script i am getting error like this..
    sh -x resource.d/squid
    + SQUID=/opt/squid/sbin/squid
    resource.d/squid: line 40: syntax error near unexpected token `RETVAL=$?'
    resource.d/squid: line 40: ` RETVAL=$?'

    Here is the file content of the file
    ================================================== =====
    cat resource.d/squid
    #!/bin/bash

    SQUID="/opt/squid/sbin/squid"

    function start {
    $SQUID
    RETVAL=$?
    # If binary isn't executable or doesn't exist,
    give
    if [ $RETVAL -eq 127 ]; then
    echo "$SQUID not executable"
    fi
    return $RETVAL
    }

    function stop {
    $SQUID -k shutdown
    # If binary isn't executable or doesn't exist,
    give
    if [ $? -eq 127 ]; then
    echo "$SQUID not executable"
    fi
    # Even so, don't care if it failed, set to zero to
    comply with LSB
    return 0
    }

    function status {
    PIDS=`pidof squid`;
    if [ "x$PIDS" == "x" ]; then
    echo "Squid not running" >&2
    else
    echo "Squid processes: $PIDS" >&2
    fi
    }

    case $* in
    start)
    start()
    RETVAL=$?
    ;;
    stop)
    stop()
    RETVAL=$?
    ;;
    restart)
    stop()
    sleep 1
    start()
    RETVAL=$?
    ;;
    status)
    status()
    RETVAL=$?
    *)
    echo "usage: $0 {start|stop|restart|status}" >&2
    echo " start start squid" >&2
    echo " stop clean shutdown" >&2
    echo " restart restart squid" >&2
    echo " status show running PIDs" >&2
    exit 1
    ;;
    esac

    exit $RETVAL
    ======================================
    Any inputs will help me a lot.. posting this in shell scripting too, if you people think its a repeated thing please remove it..
    Thanks,
    Surendra Kumar Anne
    Linux: Fast, friendly, flexible and .... free!
    Support Open source.
    http://www.linuxnix.com

  3. #3
    Senior Member
    Join Date
    Jun 2007
    Location
    Hyderabad, AP, India
    Posts
    806
    Thanks
    44
    Thanked 55 Times in 48 Posts
    Rep Power
    13

    Default Able to resolve the script issue..

    Thanks for the inputs..
    now facing an issue with failover.. when i shut one squid proxy(say ser1.example.com) Heartbeat is able to transfer the controle to next server(ser2.example.com) and its able to start squid reverse proxy on srv2.. but i am unable to browse the site
    any inputs on how to resolve the issue..
    i am able to see in heartbeat log files clearly starting of squid service on ser2 but when i am accessing the site i am getting following error

    ERROR

    The requested URL could not be retrieved

    this indicate that server is not running on floating ip.. And when i am reverting heartbeat to main server proxy, its working fine..
    any inputs on this?
    Thanks,
    Surendra Kumar Anne
    Linux: Fast, friendly, flexible and .... free!
    Support Open source.
    http://www.linuxnix.com

  4. #4
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,515
    Thanks
    17
    Thanked 815 Times in 511 Posts
    Rep Power
    10

    Default

    It is been while I played with heartbeat, but check your arp cache (arp command)? Can you ping when VIP failover take place? Run mtr on vip and do ifcomfing eth1 down for server1.
    Code:
    mtr vip.yourdomain.com
    Go to server1 and take down vip interface IP:
    Code:
    ifconfig eth1 down
    See arp cache from both server and other workstation and monitor output of mtr. If you are dropping packets than you have networking problem. It can be as simple as VLAN or router issue. Oh and most important run tcpdump when vip failover take place it should immediately announce mac for VIP fail over. Run tcpdump on 2nd server.
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


  5. #5
    Senior Member
    Join Date
    Jun 2007
    Location
    Hyderabad, AP, India
    Posts
    806
    Thanks
    44
    Thanked 55 Times in 48 Posts
    Rep Power
    13

    Default

    lot more to do.. thanks for the info nix.. will do it and update you.. mean time i found a link for troubleshooting heartbeat..
    TroubleshootingHeartBeat - CoolSolutionsWiki
    Thanks,
    Surendra Kumar Anne
    Linux: Fast, friendly, flexible and .... free!
    Support Open source.
    http://www.linuxnix.com

  6. #6
    Senior Member
    Join Date
    Jun 2007
    Location
    Hyderabad, AP, India
    Posts
    806
    Thanks
    44
    Thanked 55 Times in 48 Posts
    Rep Power
    13

    Default

    got the solution, actual problem is back-end web server is down from y'day morning and ser1 is serving the cached content. so not realized that back-end web server is down.. when checked squid logs on ser2 i realized that back-end web server is down..

    Now the setup is running fine.. thanks for the inputs.. you can close this thread..
    Thanks,
    Surendra Kumar Anne
    Linux: Fast, friendly, flexible and .... free!
    Support Open source.
    http://www.linuxnix.com

  7. #7
    Senior Member raj's Avatar
    Join Date
    Jun 2005
    Location
    Hyderabad
    Posts
    566
    Thanks
    57
    Thanked 41 Times in 38 Posts
    Rep Power
    14

    Default

    Hey kumarat9pm,

    Any chance you can write a small tutorial on this one? It can be useful to all of us. How do you manage a public IP? We have one public IP given by BSNL router which is given to eth1. How can I setup something like this for 100 desktop computer? Can you write it?

    thanks!
    Raj
    Linux rulz.
    I have never turned back in my life ; I shall not do so today.. haha

  8. #8
    Senior Member
    Join Date
    Jun 2007
    Location
    Hyderabad, AP, India
    Posts
    806
    Thanks
    44
    Thanked 55 Times in 48 Posts
    Rep Power
    13

    Default

    Sure will update it in couple of days in my blog..
    Thanks,
    Surendra Kumar Anne
    Linux: Fast, friendly, flexible and .... free!
    Support Open source.
    http://www.linuxnix.com

  9. #9
    Senior Member
    Join Date
    Jun 2007
    Location
    Hyderabad, AP, India
    Posts
    806
    Thanks
    44
    Thanked 55 Times in 48 Posts
    Rep Power
    13

    Default

    hay all,

    When the cluster switche active node the mac address too getting changed.. is this a common thing happens. Is there any way to keep the mac address to constant irrespective of node changes?
    Thanks,
    Surendra Kumar Anne
    Linux: Fast, friendly, flexible and .... free!
    Support Open source.
    http://www.linuxnix.com

  10. #10
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,515
    Thanks
    17
    Thanked 815 Times in 511 Posts
    Rep Power
    10

    Default

    Mac will change as your physical card is differnet in two server.
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Facing an issue with squid reverse proxy
    By kumarat9pm in forum Proxy Servers
    Replies: 5
    Last Post: 15th July 2010, 07:00 PM
  2. Squid Proxy Msn Messenger Login Issue
    By ifti in forum Proxy Servers
    Replies: 4
    Last Post: 10th November 2009, 03:46 PM
  3. Replies: 2
    Last Post: 17th July 2009, 03:50 PM
  4. squid configuration issue
    By kathy79 in forum CentOS / RHEL / Fedora
    Replies: 0
    Last Post: 4th July 2008, 06:06 PM
  5. Restrict number of simultaneous proxy connections in SQUID proxy
    By pkvmreddy in forum Getting started tutorials
    Replies: 1
    Last Post: 15th June 2007, 04:52 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •