cancel
Showing results for 
Search instead for 
Did you mean: 

Redhat clustering for squid

SOLVED
Go to solution
Adithyan
Frequent Advisor

Redhat clustering for squid

Dear friends,

I am trying to create a redhat cluster for squid as cluster service. My requirement is like this.

I would have 2 servers and both the servers would have squid running locally and the cache data is also independed each other, only the virtual IP is common for both the nodes.Only one node will server the request at a time.

Incase any one of the node is going down the virtual IP should get failed over to the other node.

Please let me know whether it is possible to create one like this? and if yes please any one could share the steps with me?

I have configured a basic cluster and my cmanager daemon is running.

clustat

msg_open: No such file or directory

Member Status: Quorate



Member Name ID Status

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

MYUSVWSHQLABHA2 1 Online

MYUSVWSHQLABHA1 2 Online, Local


Thanks,
Adithyan
Keen to learn HP UX
6 REPLIES
Ivan Ferreira
Honored Contributor

Re: Redhat clustering for squid

I think that a better approach is to have both squid servers "serving" the clients. You can do that with piranha, part of the red hat cluster suite. Basically, you must configure a linux virtual server. The only problem is that in this configuration, you will need at least 3 servers.

In case of a failover cluster, then is more simple, just create a IP address resource and attach to it a script resource, that points to the /etc/rc.d/init.d/squid script.

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Adithyan
Frequent Advisor

Re: Redhat clustering for squid

Hi Ivan,

Thanks for your quick responce. I have a question here, can I configure the fail over cluster without a shared storage? If yes, do you have any sample config file?

And do you know how to check the heartbeat status in redhat cluster and how would I dedicate an interface for heartbeat?

Thanks again for your support.
Regds, Adi.
Keen to learn HP UX
Ivan Ferreira
Honored Contributor

Re: Redhat clustering for squid

>>> can I configure the fail over cluster without a shared storage? If yes, do you have any sample config file?

Yes you can, but I don't have a sample config file. Just use system-config-cluster.

>>> And do you know how to check the heartbeat status in redhat cluster and how would I dedicate an interface for heartbeat?

I don't understand this question. You should take a look at the red hat cluster suite documentation available at the red hat page.

One more thing, if your service will be started by red hat cluster, ensure to disable it from the start at boot with the chkconfig command.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor
Solution

Re: Redhat clustering for squid

Shalom,

With Red Hat Clustering this is possible.

You build the two node cluster as you have done.

What you need to add is a sync script that copies the squid cache data from the active node to the passive node.

rsync -avH --stats --delete -e ssh /var/httpd/ $othernode:/var/httpd/

The variable othernode is set in a configuration file. The rsync command which saves a lot of time with files that have not changed uses ssh (to maintain encrypted data stream) from the active node to the passive node.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Adithyan
Frequent Advisor

Re: Redhat clustering for squid

Hi SEP,

Thanks a ton for your advice.

Here I am not looking for the cache data to be copied between servers. I just need to do the IP fail over. My confusion here is, how to assign the virtual IP address to the proxy?

I have 2 proxy servers running on both the servers. Normally the clients access the proxy using either their name or IP address, how would I assign a virtual IP for it so that both the servers can serve (One at a time) clients using this VIP. This may be very simple in cluster but honestly I do not have any idea in doing this. If you could give me the steps it would be really grateful!

Regards,
Adi.
Keen to learn HP UX
Steven E. Protter
Exalted Contributor

Re: Redhat clustering for squid

Shalom,

All you need to do is set up a resource as an IP address, and put it into a failover domain that includes both nodes or:

You can include the IP address with the squid package to insure the IP address and squid are always running on the same node.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com